示例#1
0
        public InvoiceForm(int id)
        {
            InitializeComponent();

            user = new Users();

            my_controller = new InvoiceController();

            this.Find_btn.Click += new System.EventHandler(my_controller.Find_btn_Click);
            this.Send_btn.Click += new System.EventHandler(my_controller.Send_btn_Click);
            this.Preview_btn.Click += new System.EventHandler(my_controller.Preview_btn_Click);
            Issued.Value = DateTime.Today;

            //Combobox datasource fill in
            t = new Term();
            DataTable ts = new DataTable();
            ts = t.get().Tables[0];
            txtTerm.DataSource = ts;
            txtTerm.DisplayMember = ts.Columns[0].ToString();

            //User label
            userid = id;
            setup(userid.ToString(), "FAFOS Invoice Form");

            DataTable dt = new SalesOrder().getDone(userid.ToString()).Tables[0];
            DataTable orders = dt.Clone();
            orders.Rows.Add(new String[] { "", "0" });
            foreach (DataRow r in dt.Rows)
                orders.ImportRow(r);

            txtSalesOrder.DataSource = orders;
            txtSalesOrder.DisplayMember = orders.Columns[0].ToString();
            txtSalesOrder.ValueMember = orders.Columns[1].ToString();
        }
示例#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 MapsForm(int id, object orders, object services)
        {
            InitializeComponent();

            //User label
            userid = id;
            setup(userid.ToString(), "FAFOS Day Itinerary");

            //Tables
            DataTable dt = new SalesOrder().getWorkOrders(userid);
            workOrderTable.DataSource = dt;

            DataTable dt2 = new ClientContract().getServices(userid.ToString());
            servicesTable.DataSource = dt2;

            order = (WorkOrder[])orders;
            service = (ContractService[])services;
            prefetch = true;

            //Load the map
            AsyncMapLoadCaller asyncMapLoad = new AsyncMapLoadCaller(LoadMap);
            asyncMapLoad.BeginInvoke(new AsyncCallback(MapLoaded), null);
            //LoadMap();
        }