public void cancelSalesOrder(object sender, EventArgs e) { Sales_Order newSalesOrder = (Sales_Order)((Button)sender).FindForm(); //save newSalesOrder.Dispose(); // _view.Show(); }
public void createSalesOrder(object sender, EventArgs e) { Sales_Order newSalesOrder = (Sales_Order)((Button)sender).FindForm(); //save OrderItems items = new OrderItems(); string id = new SalesOrder().set(franchiseeUserId, newSalesOrder.getServiceAddressId(), type == 2 ? newSalesOrder.getId() : "NULL", newSalesOrder.getTotal(), tax.ToString(), newSalesOrder.getCompleted() == true ? "1" : "NULL"); DataGridView dt = newSalesOrder.getOrderItems(); for (int i = 0; i < dt.Rows.Count - 1; i++) { items.set(dt.Rows[i].Cells[0].Value.ToString(), dt.Rows[i].Cells[4].Value != null && dt.Rows[i].Cells[4].Value.ToString() != "" ? dt.Rows[i].Cells[4].Value.ToString() : "NULL", dt.Rows[i].Cells[3].Value != null && dt.Rows[i].Cells[3].Value.ToString() != "" ? dt.Rows[i].Cells[3].Value.ToString() : "NULL", dt.Rows[i].Cells[5].Value.ToString(), dt.Rows[i].Cells[1].Value.ToString(), id); } newSalesOrder.Dispose(); MessageBox.Show("The Sales Order ID is " + id + "!"); // _view.Show(); }
public void saveSalesOrder(object sender, EventArgs e) { Sales_Order newSalesOrder = (Sales_Order)((Button)sender).FindForm(); //save OrderItems items = new OrderItems(); new SalesOrder().update(newSalesOrder.getId(), franchiseeUserId, newSalesOrder.getServiceAddressId(), newSalesOrder.getTotal(), tax.ToString(), newSalesOrder.getCompleted() == true ? "1" : "NULL"); for (int i = 0; i < rowsDeletedCounter; i++) { items.delete(rowsDeleted[i].ToString(), newSalesOrder.getId()); } DataGridView dt = newSalesOrder.getOrderItems(); for (int i = 0; i < dt.Rows.Count - 1; i++) { items.setUpdate(dt.Rows[i].Cells[0].Value.ToString(), dt.Rows[i].Cells[4].Value != null && dt.Rows[i].Cells[4].Value.ToString() != "" ? dt.Rows[i].Cells[4].Value.ToString() : "NULL", dt.Rows[i].Cells[3].Value != null && dt.Rows[i].Cells[3].Value.ToString() != "" ? dt.Rows[i].Cells[3].Value.ToString() : "NULL", dt.Rows[i].Cells[5].Value.ToString(), dt.Rows[i].Cells[1].Value.ToString(), newSalesOrder.getId()); } newSalesOrder.Dispose(); // _view.Show(); }