Exemplo n.º 1
0
 public InvoiceController()
 {
     sales_order = new SalesOrder();
     order_items = new OrderItems();
     item        = new Item();
     SAddress    = new ServiceAddress();
     client      = new Client();
     contract    = new ClientContract();
     franchisee  = new Franchisee();
     inventory   = new Inventory();
 }
Exemplo n.º 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();
 }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
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();
        }
Exemplo n.º 5
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();
 }