تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
تنبيهات حسب التاريخ
#6
اخي محمد حتى لايبق بنفسك منها شيئ 
عدل الكود الى هذا الكود
 
كود :
Private Sub Dgv_Table_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dgv_Table.SelectionChanged
       Txt_ExpItems.Text = ""
       If Dgv_Table.CurrentRow.Cells("Item_Exp").Value < Datnow Then
           Txt_ExpItems.Text = "انتهت صلاحية هذه المادة"
           Txt_ExpItems.BackColor = Color.Red
       ElseIf Dgv_Table.CurrentRow.Cells("Item_Exp").Value = Datnow Then
           Txt_ExpItems.Text = "اليوم تنتهي صلاحية هذه المادة"
           Txt_ExpItems.BackColor = Color.Yellow
       ElseIf Dgv_Table.CurrentRow.Cells("Item_Exp").Value = Datnow.AddDays(1) Then
           Txt_ExpItems.Text = "باقي يوم على انتهاء الصلاحية"
           Txt_ExpItems.BackColor = Color.Gold
       ElseIf Dgv_Table.CurrentRow.Cells("Item_Exp").Value = Datnow.AddDays(2) Then
           Txt_ExpItems.Text = "باقي يومان على انتهاء الصلاحية"
           Txt_ExpItems.BackColor = Color.Gold
       ElseIf Dgv_Table.CurrentRow.Cells("Item_Exp").Value = Datnow.AddDays(3) Then
           Txt_ExpItems.Text = "باقي 3 ايام على انتهاء الصلاحية"
           Txt_ExpItems.BackColor = Color.Gold
       Else
           Dim Firstdate As Date = Now
           Dim Seconddate As Date = CDate(Dgv_Table.CurrentRow.Cells("Item_Exp").Value)
           Dim kk As String = DateDiff(DateInterval.Day, Seconddate, Firstdate)
           Txt_ExpItems.Text = " باقي على صلاحية هذه المادة" & (kk * -1) & "يوم"
           Txt_ExpItems.BackColor = Color.Green
       End If

   End Sub

اعمل الخير وأجرك لا تنتظره فالله خير من إليك يرده
البرمجة ليست مجرد كود بل هي منهج تفكير منطقي لحل المشكلات







الرد }}}
تم الشكر بواسطة: محمد خيري , Rabeea Qbaha , Rabeea Qbaha , asemshahen5


الردود في هذا الموضوع
تنبيهات حسب التاريخ - بواسطة محمد خيري - 13-09-19, 12:25 AM
RE: تنبيهات حسب التاريخ - بواسطة ابراهيم ايبو - 13-09-19, 02:04 AM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم