1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
Dim trans As System.Data.SqlClient.SqlTransaction = gconAppConnection.BeginTransaction()
Try
da1 = New SqlClient.SqlDataAdapter
Me.da1.InsertCommand = New System.Data.SqlClient.SqlCommand
Me.da1.InsertCommand.Connection = gconAppConnection
Me.da1.InsertCommand.CommandText = "udp_GoodsInsert"
Me.da1.InsertCommand.CommandType = CommandType.StoredProcedure
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_Id", SqlDbType.Int, 8 , ParameterDirection.Output, 0 , 0 , "Goods_Id", System.Data.DataRowVersion.Current, False, intGoodsId, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_Name", SqlDbType.NVarChar, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_Name", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_ShortName", SqlDbType.NVarChar, 14 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_ShortName", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_ChequeName", SqlDbType.NVarChar, 15 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_ChequeName", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_Tax", SqlDbType.Float, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_Tax", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_TaxImport", SqlDbType.Float, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_TaxImport", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_CostOfGiving", SqlDbType.Money, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_CostOfGiving", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_CostOfReceiving", SqlDbType.Money, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_CostOfReceiving", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_CashCode", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_CashCode", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_NetMass", SqlDbType.NVarChar, 10 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_NetMass", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_GrossMass", SqlDbType.NVarChar, 10 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_GrossMass", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@GoodsType_Id", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "GoodsType_Id", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Unit_ID", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Unit_ID", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@GoodsGroup_Id", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Unit_ID", System.Data.DataRowVersion.Current, False, intGroupKey, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Bottle_Id", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Bottle_Id", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Customer_Id_Deliver", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Customer_Id_Deliver", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Customer_Id_Manufacturer", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Customer_Id_Manufacturer", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_Notes", SqlDbType.NVarChar, 255 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_Notes", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand = New System.Data.SqlClient.SqlCommand
Me.da1.UpdateCommand.Connection = gconAppConnection
Me.da1.UpdateCommand.CommandText = "udp_GoodsUpdate"
Me.da1.UpdateCommand.CommandType = CommandType.StoredProcedure
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_Id", SqlDbType.Int, 8 , ParameterDirection.Input, 0 , 0 , "Goods_Id", System.Data.DataRowVersion.Current, False, intGoodsId, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_Name", SqlDbType.NVarChar, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_Name", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_ShortName", SqlDbType.NVarChar, 14 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_ShortName", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_ChequeName", SqlDbType.NVarChar, 15 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_ChequeName", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_Tax", SqlDbType.Float, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_Tax", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_TaxImport", SqlDbType.Float, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_TaxImport", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_CostOfGiving", SqlDbType.Money, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_CostOfGiving", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_CostOfReceiving", SqlDbType.Money, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_CostOfReceiving", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_CashCode", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_CashCode", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_NetMass", SqlDbType.NVarChar, 10 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_NetMass", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_GrossMass", SqlDbType.NVarChar, 10 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_GrossMass", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@GoodsType_Id", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "GoodsType_Id", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Unit_ID", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Unit_ID", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@GoodsGroup_Id", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Unit_ID", System.Data.DataRowVersion.Current, False, intGroupKey, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Bottle_Id", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Bottle_Id", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Customer_Id_Deliver", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Customer_Id_Deliver", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Customer_Id_Manufacturer", SqlDbType.Int, 30 , System.Data.ParameterDirection.Input, 0 , 0 , "Customer_Id_Manufacturer", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_Notes", SqlDbType.NVarChar, 255 , System.Data.ParameterDirection.Input, 0 , 0 , "Goods_Notes", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.Validate()
Me.bs1.EndEdit()
Me.da1.Update(Me.ds1.Tables( 0 ))
Me.TextBox_GoodName.Tag = intGoodsId.ToString
da1 = New SqlClient.SqlDataAdapter
Me.da1.InsertCommand = New System.Data.SqlClient.SqlCommand
Me.da1.InsertCommand.Connection = gconAppConnection
Me.da1.InsertCommand.CommandText = "udp_GoodsUnitsInsert"
Me.da1.InsertCommand.CommandType = CommandType.StoredProcedure
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@GoodsUnit_Id", SqlDbType.Int, 8 , ParameterDirection.Output, 0 , 0 , "GoodsUnit_Id", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_Id", SqlDbType.Int, 8 , ParameterDirection.Input, 0 , 0 , "Goods_Id", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Unit_Id_From", SqlDbType.Int, 8 , ParameterDirection.Input, 0 , 0 , "Unit_Id_From", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Unit_Id_From_Value", SqlDbType.Float, 8 , ParameterDirection.Input, 0 , 0 , "Unit_Id_From_Value", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Unit_Id_To", SqlDbType.Int, 8 , ParameterDirection.Input, 0 , 0 , "Unit_Id_To", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.InsertCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Unit_Id_To_Value", SqlDbType.Float, 8 , ParameterDirection.Input, 0 , 0 , "Unit_Id_To_Value", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand = New System.Data.SqlClient.SqlCommand
Me.da1.UpdateCommand.Connection = gconAppConnection
Me.da1.UpdateCommand.CommandText = "udp_GoodsUnitsUpdate"
Me.da1.UpdateCommand.CommandType = CommandType.StoredProcedure
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Goods_Id", SqlDbType.Int, 8 , ParameterDirection.Input, 0 , 0 , "Goods_Id", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Unit_Id_From", SqlDbType.Int, 8 , ParameterDirection.Input, 0 , 0 , "Unit_Id_From", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Unit_Id_From_Value", SqlDbType.Float, 8 , ParameterDirection.Input, 0 , 0 , "Unit_Id_From_Value", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Unit_Id_To", SqlDbType.Int, 8 , ParameterDirection.Input, 0 , 0 , "Unit_Id_To", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.da1.UpdateCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Unit_Id_To_Value", SqlDbType.Float, 8 , ParameterDirection.Input, 0 , 0 , "Unit_Id_To_Value", System.Data.DataRowVersion.Current, False, Nothing, "", "", ""))
Me.Validate()
Me.bs7.EndEdit()
Me.da1.Update(Me.ds1.Tables( 6 ))
trans.Commit()
Catch
trans.Rollback()
MessageBox.Show(Err.Description)
End Try