تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] خطا في كود عند الحفظ
#1
كود :
Private Sub BtnSave_Click(sender As System.Object, e As System.EventArgs) Handles BtnSave.Click, BtnClose.Click
      Total.Text = Val(Total.Text) + Val(DiscountTotal.Text)
      Insert_Buy_Tbl(Buy_ID.Text, Buy_Date.Value, Imp_Inv_No.Text, Inv_Type.Text, SalesMan.Text, Imp_ID.Text, Item_Count.Text, Total.Text, TaxValue.Text, TaxTotal.Text, DiscountValue.Text, DiscountTotal.Text, FinalTotal.Text, Paid.Text, UnPaid.Text)
      Insert_Buy_Details_Tbl()
      InsertStore()
      Update_Imp_Balance()
      Insert_Imp_Move(Buy_Date.Value, Imp_ID.Text, "فاتورة شراء", FinalTotal.Text, Paid.Text, UnPaid.Text, SalesMan.Text)
  End Sub
كود :
Public Sub Insert_Buy_Tbl(ByVal Buy_ID As Int32, ByVal Buy_Date As Date, ByVal Imp_Inv_No As String, ByVal Inv_Type As String, ByVal SalesMan As String, ByVal Imp_ID As Int32, ByVal Item_Count As Int32, ByVal Total As Double, ByVal Tax_Per As Double, ByVal TaxTotal As Double, ByVal Discount_Per As Double, ByVal DiscountTotal As Double, ByVal FinalTotal As Double, ByVal Paid As Double, ByVal UnPaid As Double)
      Dim Cmd As New SqlCommand
      With Cmd
          .Connection = Con
          .CommandType = CommandType.Text
          .CommandText = "Insert Into Buy_Tbl ( Buy_ID,Buy_Date,Imp_Inv_No,Inv_Type,SalesMan,Imp_ID,Item_Count,Total,Tax_Per,TaxTotal,Discount_Per,DiscountTotal,FinalTotal,Paid,UnPaid)values(@Buy_ID,@Buy_Date,@Imp_Inv_No,@Inv_Type,@SalesMan,@Imp_ID,@Item_Count,@Total,@Tax_Per,@TaxTotal,@Discount_Per,@DiscountTotal,@FinalTotal,@Paid,@UnPaid)"
          .Parameters.Clear()
          .Parameters.AddWithValue("@Buy_ID", SqlDbType.Int).Value = Buy_ID
          .Parameters.AddWithValue("@Buy_Date", SqlDbType.Date).Value = Buy_Date
          .Parameters.AddWithValue("@Imp_Inv_No", SqlDbType.VarChar).Value = Imp_Inv_No
          .Parameters.AddWithValue("@Inv_Type", SqlDbType.VarChar).Value = Inv_Type
          .Parameters.AddWithValue("@SalesMan", SqlDbType.VarChar).Value = SalesMan
          .Parameters.AddWithValue("@Imp_ID", SqlDbType.Int).Value = Imp_ID
          .Parameters.AddWithValue("@Item_Count", SqlDbType.Int).Value = Item_Count
          .Parameters.AddWithValue("@Total", SqlDbType.Decimal).Value = Total
          .Parameters.AddWithValue("@Tax_Per", SqlDbType.Decimal).Value = Tax_Per
          .Parameters.AddWithValue("@TaxTotal", SqlDbType.Decimal).Value = TaxTotal
          .Parameters.AddWithValue("@Discount_Per", SqlDbType.Decimal).Value = Discount_Per
          .Parameters.AddWithValue("@DiscountTotal", SqlDbType.Decimal).Value = DiscountTotal
          .Parameters.AddWithValue("@FinalTotal", SqlDbType.Decimal).Value = FinalTotal
          .Parameters.AddWithValue("@Paid", SqlDbType.Decimal).Value = Paid
          .Parameters.AddWithValue("@UnPaid", SqlDbType.Decimal).Value = UnPaid
      End With
      If Con.State = 1 Then Con.Close()
      Con.Open()
      Cmd.ExecuteNonQuery()
      Con.Close()
      Cmd = Nothing
  End Sub


صورة الخطا


الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
خطا في كود عند الحفظ - بواسطة حيدر الشرهاني - 17-06-22, 01:49 PM


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


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