تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
ممكن حل لمشكلة التعديل داخل DGv
#1
السلام عليكم
ممكن حل لمشكلة التعديل داخل الداتا قرد فيو  داخل فورم فاتورة بيع
حيت عند التعديل داخل الداتا قرد فيو لا تحسب العمليات الحسابية متلا
حسب الصورة المرفقة

عند تغير الكمية المباعة من 10 الي 20 لازم حساب صافي الجمهور واجمالي الشراء من خلال  الاجراء         SaleCalcu()
الكود
PHP كود :
Public Sub SaleCalcu()
 
       Dim t1 As Double
        If IsNothing
(DGV.CurrentRowOrElse IsNothing(DGV.CurrentRow.Cells(6).ValueThen
            t1 
0
        Else
            t1 
Val(DGV.CurrentRow.Cells(6).Value)
 
       End If
 
       Dim T2 As Double
        If IsNothing
(DGV.CurrentRowOrElse IsNothing(DGV.CurrentRow.Cells(2).ValueThen
            T2 
0
        Else
            T2 
Val(DGV.CurrentRow.Cells(2).Value)
 
       End If
 
       Dim T3 As Double
        If IsNothing
(DGV.CurrentRowOrElse IsNothing(DGV.CurrentRow.Cells(7).ValueThen
            T3 
0
        Else
            T3 
Val(DGV.CurrentRow.Cells(7).Value)
 
       End If
 
       Dim T4 As Double
        If IsNothing
(DGV.CurrentRowOrElse IsNothing(DGV.CurrentRow.Cells(8).ValueThen
            T4 
0
        Else
            T4 
Val(DGV.CurrentRow.Cells(8).Value)
 
       End If
 
       Dim T5 As Double
        If IsNothing
(DGV.CurrentRowOrElse IsNothing(DGV.CurrentRow.Cells(9).ValueThen
            T5 
0
        Else
            T5 
Val(DGV.CurrentRow.Cells(9).Value)
 
       End If
 
       Dim t6 As Double
        If IsNothing
(DGV.CurrentRowOrElse IsNothing(DGV.CurrentRow.Cells(10).ValueThen
            t6 
0
        Else
            t6 
Val(DGV.CurrentRow.Cells(10).Value)
 
       End If
 
       Dim t7 As Double
        If IsNothing
(DGV.CurrentRowOrElse IsNothing(DGV.CurrentRow.Cells(12).ValueThen
            t7 
0
        Else
            t7 
Val(DGV.CurrentRow.Cells(12).Value)
 
       End If
 
       '----- اجمالي الجمهور------
        ' 
total qty*price
        
'7=6*2
        T3 = t1 * T2
        '
---اجمالي الشراء-----
 
       ' totalB = total-(total*discound)
        T5 = T3 - ((T3 * T4) / 100)
        '
------قيمة الربح---------
 
       'Eran= = total- totalb
        '
12=8-11
        t6 
T3 T5
        Dim totl
totlBcoutErnPerc As Double
        For i 
As Integer 0 To DGV.Rows.Count 1
            totl 
totl Val(DGV(9DGV.Rows(i).Index).Value)
 
           totlB totlB Val(DGV(11DGV.Rows(i).Index).Value)
 
           Ern totl totlB
            cout 
DGV.Rows.Count
            Perc 
= (- (totlB totl)) * 100
        Next
        SaleTotalG
.Text totl
        SaleTotalS
.Text totlB
        SaleItemCount
.Text cout
        SaleEran
.Text Ern
        SaleEranPercent
.Text Math.Round(Perc2

 و وضعت الدالة SaleCalcu
داخل DGV EndEdit

PHP كود :
Private Sub DGV_CellEndEdit(sender As ObjectAs DataGridViewCellEventArgsHandles DGV.CellEndEdit
        SaleCalcu
()

 
   End Sub 


ياريت لو في حل او هناك حطاء في كتابة الكود اخباري
الرد }}}
تم الشكر بواسطة: asemshahen5 , نيمو


الردود في هذا الموضوع
ممكن حل لمشكلة التعديل داخل DGv - بواسطة Ofealas - 25-07-21, 07:37 PM


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


يقوم بقرائة الموضوع: