private void saveProductOrder() { productOrder productOrder = new productOrder(); productOrder.customerID = CustomerID; productOrder.status = 1; productOrder.dateCarried = System.DateTime.Now; productOrder.dateTake = System.DateTime.Now; int productOrderCode; productOrderCode = productOrderOP.productOrderSellAdd(productOrder); productListOP productListOP = new productListOP(); productList productList = new productList(); for (int i = 0; i < dataGridView3.Rows.Count - 1; i++) { productList.ProductOrderID = productOrderCode; productList.amount = Convert.ToInt32(dynamicTableNew.Rows[i][6]); productList.discount = Convert.ToInt32(dynamicTableNew.Rows[i][5]); productList.price = Convert.ToInt32(dynamicTableNew.Rows[i][3]); productList.productCode = Convert.ToInt32(dynamicTableNew.Rows[i][0]); productListOP.productListAdd(productList); } MessageBox.Show("Siparişiniz başarıyla alındı", "Sipariş alımı"); }
private void updateProductOrder() // update productorder içini doldurucan { productOrder productOrder = new productOrder(); productListOP productListOP = new productListOP(); productList productList = new productList(); productOrder.customerID = CustomerID; productOrder.status = 1; productOrder.dateCarried = System.DateTime.Now; productOrder.dateTake = System.DateTime.Now; productOrder.productOrderCode = Convert.ToInt32(dataGridView1.CurrentRow.Cells[3].Value); productOrderOP.productOrderSellUpdate(productOrder); for (int i = 0; i < dynamicTableNew.Rows.Count; i++) { productList.ProductOrderID = productOrder.productOrderCode; productList.amount = Convert.ToInt32(dynamicTableUpdate.Rows[i][6]); productList.discount = Convert.ToInt32(dynamicTableUpdate.Rows[i][5]); productList.price = Convert.ToInt32(dynamicTableUpdate.Rows[i][3]); productList.productCode = Convert.ToInt32(dynamicTableUpdate.Rows[i][0]); productListOP.productListUpdate(productList); } MessageBox.Show("Siparişiniz başarıyla güncellendi", "Sipariş güncelleme"); }
public void productListUpdate(productList productList) { createConnection(); connection.Open(); SqlCommand command = new SqlCommand(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "productListUpdate"; command.Parameters.Add("@code", SqlDbType.Int, 50); command.Parameters["@code"].Value = productList.code; command.Parameters.Add("@productCode", SqlDbType.Int, 50); command.Parameters["@productCode"].Value = productList.productCode; command.Parameters.Add("@price", SqlDbType.Decimal, 50); command.Parameters["@price"].Value = productList.price; command.Parameters.Add("@discount", SqlDbType.Int, 50); command.Parameters["@discount"].Value = productList.discount; command.Parameters.Add("@amount", SqlDbType.Int, 50); command.Parameters["@amount"].Value = productList.amount; command.Parameters.Add("@ProductList", SqlDbType.Int, 50); command.Parameters["@ProductList"].Value = productList.ProductOrderID; command.ExecuteNonQuery(); connection.Close(); connection.Dispose(); }
public void productListAdd(productList productList) { createConnection(); connection.Open(); SqlCommand command = new SqlCommand(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "productListAdd"; command.Parameters.Add("@code", SqlDbType.Int, 50); command.Parameters["@code"].Value = productList.code; command.Parameters.Add("@productCode", SqlDbType.Int, 50); command.Parameters["@productCode"].Value = productList.productCode; command.Parameters.Add("@price", SqlDbType.Decimal, 50); command.Parameters["@price"].Value = productList.price; command.Parameters.Add("@discount", SqlDbType.Int, 50); command.Parameters["@discount"].Value = productList.discount; command.Parameters.Add("@amount", SqlDbType.Int, 50); command.Parameters["@amount"].Value = productList.amount; command.Parameters.Add("@ProductOrderID", SqlDbType.Int, 50); command.Parameters["@ProductOrderID"].Value = productList.ProductOrderID; command.ExecuteNonQuery(); connection.Close(); connection.Dispose(); }
// update productorder içini doldurucan private void updateProductOrder() { productOrder productOrder = new productOrder(); productListOP productListOP = new productListOP(); productList productList = new productList(); productOrder.customerID = CustomerID; productOrder.status = 1; productOrder.dateCarried = System.DateTime.Now; productOrder.dateTake = System.DateTime.Now; productOrder.productOrderCode = Convert.ToInt32(dataGridView1.CurrentRow.Cells[3].Value); productOrderOP.productOrderSellUpdate(productOrder); for (int i = 0; i < dynamicTableNew.Rows.Count; i++) { productList.ProductOrderID = productOrder.productOrderCode; productList.amount = Convert.ToInt32(dynamicTableUpdate.Rows[i][6]); productList.discount = Convert.ToInt32(dynamicTableUpdate.Rows[i][5]); productList.price = Convert.ToInt32(dynamicTableUpdate.Rows[i][3]); productList.productCode = Convert.ToInt32(dynamicTableUpdate.Rows[i][0]); productListOP.productListUpdate(productList); } MessageBox.Show("Siparişiniz başarıyla güncellendi", "Sipariş güncelleme"); }
private void saveProductOrder() { productOrder productOrder = new productOrder(); productOrder.customerID = CustomerID; productOrder.status = 1; productOrder.dateCarried = System.DateTime.Now; productOrder.dateTake = System.DateTime.Now; int productOrderCode; productOrderCode = productOrderOP.productOrderSellAdd(productOrder); productListOP productListOP = new productListOP(); productList productList = new productList(); for (int i = 0; i < dataGridView3.Rows.Count - 1; i++) { productList.ProductOrderID = productOrderCode; productList.amount = Convert.ToInt32(dynamicTableNew.Rows[i][6]); productList.discount = Convert.ToInt32(dynamicTableNew.Rows[i][5]); productList.price = Convert.ToInt32(dynamicTableNew.Rows[i][3]); productList.productCode = Convert.ToInt32(dynamicTableNew.Rows[i][0]); productListOP.productListAdd(productList); } MessageBox.Show("Siparişiniz başarıyla alındı", "Sipariş alımı"); }