Ejemplo n.º 1
0
        /************************************Inventory************************************************************/
        public void Load(object sender, EventArgs e)
        {
            _view         = (InventoryForm)((InventoryForm)sender).FindForm();
            servicesTable = franchisee_inventory.getServices(user.getFranchiseeId(_view.getUser()));
            productsTable = franchisee_inventory.getProducts(user.getFranchiseeId(_view.getUser()));
            DataTable categoryTable = category.get();
            DataTable supplierTable = supplier.get();

            _view.getCategory().DataSource    = categoryTable;
            _view.getCategory().DisplayMember = "type";
            _view.getCategory().ValueMember   = "id";
            _view.getSupplier().DataSource    = supplierTable;
            _view.getSupplier().DisplayMember = "name";
            _view.getSupplier().ValueMember   = "service_id";

            fillProductcombo();
            fillServicecombo();
            try
            {
                _view.SetProductsTable(productsTable);
                _view.SetServicesTable(servicesTable);
            }
            catch (InvalidCastException ef)
            {
                MessageBox.Show("Incorrect data was loaded in this form.");
            }
        }
Ejemplo n.º 2
0
 public void addService_btn_Click(object sender, EventArgs e)
 {
     _view = (InventoryForm)((Button)sender).FindForm();
     franchisee_inventory.insertService(user.getFranchiseeId(_view.getUser()), _view.getServiceName(), _view.getServiceDescription(), _view.getServicePrice());
     servicesTable = franchisee_inventory.getServices(user.getFranchiseeId(_view.getUser()));
     _view.SetServicesTable(servicesTable);
     fillServicecombo();
 }
Ejemplo n.º 3
0
 public void addService_btn_Click(object sender, EventArgs e)
 {
     _view = (InventoryForm)((Button)sender).FindForm();
     franchisee_inventory.insertService(user.getFranchiseeId(_view.getUser()), _view.getServiceName(), _view.getServiceDescription(), _view.getServicePrice());
     servicesTable = franchisee_inventory.getServices(user.getFranchiseeId(_view.getUser()));
     _view.SetServicesTable(servicesTable);
     fillServicecombo();
 }
Ejemplo n.º 4
0
        private void btnInventory_Click(object sender, EventArgs e)
        {
            pnlOps.Visible = false;

            InventoryForm form = new InventoryForm(userid);

            form.TopLevel = false;
            pnlPage.Controls.Add(form);
            form.Show();
        }
Ejemplo n.º 5
0
 public void addProduct_btn_Click(object sender, EventArgs e)
 {
     _view = (InventoryForm)((Button)sender).FindForm();
     //_view.getCategory().ValueMember = "category_id";
     String category_id = _view.getCategory().SelectedValue.ToString();
        // _view.getCategory().DisplayMember = "type";
       //  _view.getSupplier().ValueMember = "supplier_id";
     String supplier_id = _view.getSupplier().SelectedValue.ToString();
     //_view.getSupplier().DisplayMember = "name";
     franchisee_inventory.insertProduct(user.getFranchiseeId(_view.getUser()), _view.getProductName(), _view.getProductDescription(), _view.getProductPrice(), category_id, supplier_id);
     productsTable = franchisee_inventory.getProducts(user.getFranchiseeId(_view.getUser()));
     _view.SetProductsTable(productsTable);
     fillProductcombo();
 }
Ejemplo n.º 6
0
        public void addProduct_btn_Click(object sender, EventArgs e)
        {
            _view = (InventoryForm)((Button)sender).FindForm();
            //_view.getCategory().ValueMember = "category_id";
            String category_id = _view.getCategory().SelectedValue.ToString();
            // _view.getCategory().DisplayMember = "type";
            //  _view.getSupplier().ValueMember = "supplier_id";
            String supplier_id = _view.getSupplier().SelectedValue.ToString();

            //_view.getSupplier().DisplayMember = "name";
            franchisee_inventory.insertProduct(user.getFranchiseeId(_view.getUser()), _view.getProductName(), _view.getProductDescription(), _view.getProductPrice(), category_id, supplier_id);
            productsTable = franchisee_inventory.getProducts(user.getFranchiseeId(_view.getUser()));
            _view.SetProductsTable(productsTable);
            fillProductcombo();
        }
Ejemplo n.º 7
0
        private void btnInventory_Click(object sender, EventArgs e)
        {
            pnlOps.Visible = false;

            InventoryForm form = new InventoryForm(userid);
            form.TopLevel = false;
            pnlPage.Controls.Add(form);
            form.Show();
        }
Ejemplo n.º 8
0
        /************************************Inventory************************************************************/
        public void Load(object sender, EventArgs e)
        {
            _view = (InventoryForm)((InventoryForm)sender).FindForm();
            servicesTable = franchisee_inventory.getServices(user.getFranchiseeId(_view.getUser()));
            productsTable = franchisee_inventory.getProducts(user.getFranchiseeId(_view.getUser()));
            DataTable categoryTable = category.get();
            DataTable supplierTable = supplier.get();
            _view.getCategory().DataSource = categoryTable;
            _view.getCategory().DisplayMember = "type";
            _view.getCategory().ValueMember = "id";
            _view.getSupplier().DataSource = supplierTable;
            _view.getSupplier().DisplayMember = "name";
            _view.getSupplier().ValueMember = "service_id";

            fillProductcombo();
            fillServicecombo();
            try
            {
                _view.SetProductsTable(productsTable);
                _view.SetServicesTable(servicesTable);
            }
            catch (InvalidCastException ef)
            {
                MessageBox.Show("Incorrect data was loaded in this form.");
            }
        }