07-07-24, 02:02 AM
السلام عليكم ورحمة الله وبركاته
اعمل على شاشة ادخال للمنتجات اواجه مشكلة وهي ان زيادة عدد المنتج لاتوجد بها اي مشكلة
اواجه مشكلة في ادخال السعر الجديد للمنتج سعر الشراء وسعر البيع وتاريخ النفاذ وارجو منكم الحل
cm = New SqlCommand("update tblProduct set ProductQuantity = ProductQuantity + " & CInt(DataGridView1.Rows(i).Cells(7).Value.ToString) & ", ProductBuyPrice=@ProductBuyPrice ,ProductSalePrice=@ProductSalePrice ,ProductDate=@ProductDate where ProductID like '" & DataGridView1.Rows(i).Cells(1).Value.ToString & "'", cn)
تفضل الاخ العزيز [b]Zuhare[/b] بالرد مشكورا
بعد التعديل كما موضح
cm = New SqlCommand("update tblProduct set ProductQuantity = ProductQuantity + " & CInt(DataGridView1.Rows(i).Cells(7).Value.ToString) & ", ProductBuyPrice=@ProductBuyPrice ,ProductSalePrice=@ProductSalePrice ,ProductDate=@ProductDate where ProductID like '" & DataGridView1.Rows(i).Cells(1).Value.ToString & "'", cn)
With cm
.Parameters.AddWithValue("@ProductBuyPrice", CInt(DataGridView1.Rows(i).Cells(8).Value.ToString))
.Parameters.AddWithValue("@ProductSalePrice", CInt(DataGridView1.Rows(i).Cells(9).Value.ToString))
.Parameters.AddWithValue("@ProductDate ", CDate(DataGridView1.Rows(i).Cells(10).Value.ToString))
.ExecuteNonQuery()
End With
المشكلة اصبحت انه عندما اضيف مادة جديدة واحدث اعداد المخزن
يتم تعديل سعر الشراء وسعر البيع وتاريخ النفاذ للمادة المخزونة
المطلوب هي تحديث عدد المادة واضافة السعر الجديد والتاريخ للمادة الجديدة مع الحفاظ على المخزون مسبقا بسعرة وتاريخه
اعمل على شاشة ادخال للمنتجات اواجه مشكلة وهي ان زيادة عدد المنتج لاتوجد بها اي مشكلة
اواجه مشكلة في ادخال السعر الجديد للمنتج سعر الشراء وسعر البيع وتاريخ النفاذ وارجو منكم الحل
cm = New SqlCommand("update tblProduct set ProductQuantity = ProductQuantity + " & CInt(DataGridView1.Rows(i).Cells(7).Value.ToString) & ", ProductBuyPrice=@ProductBuyPrice ,ProductSalePrice=@ProductSalePrice ,ProductDate=@ProductDate where ProductID like '" & DataGridView1.Rows(i).Cells(1).Value.ToString & "'", cn)
تفضل الاخ العزيز [b]Zuhare[/b] بالرد مشكورا
كود :
cm = New SqlCommand("update tblProduct set ProductQuantity = ProductQuantity + " & CInt(DataGridView1.Rows(i).Cells(7).Value.ToString) & ", ProductBuyPrice=@ProductBuyPrice ,ProductSalePrice=@ProductSalePrice ,ProductDate=@ProductDate where ProductID like '" & DataGridView1.Rows(i).Cells(1).Value.ToString & "'", cn)
cm.Parameters.AddWithValue("@ProductBuyPrice",252.44)
cm.Parameters.AddWithValue("@ProductSalePrice",674.11)
cm.Parameters.AddWithValue("@ProductDate ",CDate("2024-07-07"))بعد التعديل كما موضح
cm = New SqlCommand("update tblProduct set ProductQuantity = ProductQuantity + " & CInt(DataGridView1.Rows(i).Cells(7).Value.ToString) & ", ProductBuyPrice=@ProductBuyPrice ,ProductSalePrice=@ProductSalePrice ,ProductDate=@ProductDate where ProductID like '" & DataGridView1.Rows(i).Cells(1).Value.ToString & "'", cn)
With cm
.Parameters.AddWithValue("@ProductBuyPrice", CInt(DataGridView1.Rows(i).Cells(8).Value.ToString))
.Parameters.AddWithValue("@ProductSalePrice", CInt(DataGridView1.Rows(i).Cells(9).Value.ToString))
.Parameters.AddWithValue("@ProductDate ", CDate(DataGridView1.Rows(i).Cells(10).Value.ToString))
.ExecuteNonQuery()
End With
المشكلة اصبحت انه عندما اضيف مادة جديدة واحدث اعداد المخزن
يتم تعديل سعر الشراء وسعر البيع وتاريخ النفاذ للمادة المخزونة
المطلوب هي تحديث عدد المادة واضافة السعر الجديد والتاريخ للمادة الجديدة مع الحفاظ على المخزون مسبقا بسعرة وتاريخه