コード例 #1
0
        public void cancelSalesOrder(object sender, EventArgs e)
        {
            Sales_Order newSalesOrder = (Sales_Order)((Button)sender).FindForm();

            //save
            newSalesOrder.Dispose();
            //   _view.Show();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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();
        }