private void setupControls()
        {
            Settings.setGeneralSettings(this);

            ProductStoreName.populateDropDownList(cbProductStoreNames, false, false);
            Grade.populateDropDownList(cbGrades, false, false);
            ProductWidth.populateDropDownList(cbProductWidths, false, false);
            LengthUnit.populateDropDownList(cbLengthUnits, false, false);
            FabricColor.populateDropDownList(cbColors, false, false);

            grid.AutoGenerateColumns            = false;
            grid.SelectionMode                  = DataGridViewSelectionMode.FullRowSelect;
            col_grid_colorname.DataPropertyName = ProductPrice.COL_COLORNAME;
            col_grid_Checked.DataPropertyName   = ProductPrice.COL_DB_Checked;
            col_grid_BuyPrice.DataPropertyName  = ProductPrice.COL_DB_BuyPrice;

            if (GlobalData.UserAccount.role != Roles.Super)
            {
                col_grid_Checked.Visible  = false;
                chkOnlyNotOK.Visible      = false;
                in_BuyPrice.Visible       = false;
                col_grid_BuyPrice.Visible = false;
                btnDelete.Enabled         = false;
            }
        }
Exemplo n.º 2
0
        private void setupControls()
        {
            Settings.setGeneralSettings(this);

            Grade.populateDropDownList(cbGrades, false, true);
            ProductWidth.populateDropDownList(cbProductWidths, false, true);
            LengthUnit.populateDropDownList(cbLengthUnits, false, true);
            FabricColor.populateDropDownList(cbColors, false, true);
            VendorInvoice.populateDropDownList(cbVendorInvoices, true);

            //set window title
            switch (_formMode)
            {
            case FormMode.New:
                this.Text       = "ADD NEW INVENTORY";
                lblCode.Visible = false;
                txtCode.Visible = false;
                break;

            case FormMode.Update:
                this.Text = "UPDATE INVENTORY";
                break;
            }

            if (GlobalData.UserAccount.role == Roles.User)
            {
                lblBuyPrice.Visible = false;
                txtBuyPrice.Visible = false;
                this.Height        -= 60;
            }
        }
Exemplo n.º 3
0
        /*******************************************************************************************************/
        #region METHODS

        protected override void setupFields()
        {
            Settings.setGeneralSettings(this);

            //disableFieldActive();
            DoNotClearInputAfterSubmission = true;

            //NOTES: must use inputColumns sequentially from the first one to the next. Otherwise calculation of the form width will be off

            //Field ID
            col_grid_id.DataPropertyName = GordenItem.COL_DB_ID;

            //Field Default
            col_grid_default.Visible = false;

            //Field Name - textbox
            _inputTxtName = (InputTextbox)setupInputControl(new InputTextbox(), 0, "Name", GordenItem.COL_DB_NAME, false);
            _inputTxtName.setMaxLength(50);                          //set max length
            col_grid_name.DataPropertyName = GordenItem.COL_DB_NAME; //set field's data property name in gridview

            //Field Categories - dropdownlist
            _inputDDLCategories = (InputEnumDropdownlist)setupInputControl(new InputEnumDropdownlist(), 0, "Category", GordenItem.COL_CATEGORYNAME, (int)MasterDataColumnWidth.Fit, true, false, null);
            Tools.populateDropDownList(_inputDDLCategories.Dropdownlist, typeof(GordenItemCategories));

            //Field Vendor - dropdownlist
            _inputDDLVendors = (InputDropdownlist)setupInputControl(new InputDropdownlist(), 0, "Vendor", GordenItem.COL_VENDORNAME, (int)MasterDataColumnWidth.Fit, true, false, null);
            _inputDDLVendors.UpdateLink.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkUpdateVendors_LinkClicked); //add event handler for update link
            Vendor.populateDropDownList(_inputDDLVendors.Dropdownlist, false, false);                                      //populate

            //Field Product Width - dropdownlist
            _inputDDLProductWidths = (InputDropdownlist)setupInputControl(new InputDropdownlist(), 0, "Lebar cm", GordenItem.COL_PRODUCTWIDTHNAME, (int)MasterDataColumnWidth.Fit, true, false, null);
            _inputDDLProductWidths.UpdateLink.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkUpdateProductWidths_LinkClicked); //add event handler for update link
            ProductWidth.populateDropDownList(_inputDDLProductWidths.Dropdownlist, false, false);                                      //populate

            //Field Retail Length Units - dropdownlist
            _inputDDLRetailLengthUnits = (InputDropdownlist)setupInputControl(new InputDropdownlist(), 1, "Retail Unit", GordenItem.COL_RETAILLENGTHUNITNAME, (int)MasterDataColumnWidth.Fit, true, false, null);
            _inputDDLRetailLengthUnits.UpdateLink.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkUpdateLengthUnits_LinkClicked); //add event handler for update link
            LengthUnit.populateDropDownList(_inputDDLRetailLengthUnits.Dropdownlist, false, false);                                      //populate

            //Field Buy Retail Price - textbox
            _inputTxtBuyRetailPricePerUnit = (InputTextbox)setupInputControl(new InputTextbox(), 1, "Buy Retail", GordenItem.COL_DB_BUYRETAILPRICEPERUNIT, (int)MasterDataColumnWidth.Fit, true, false, "N2");
            _inputTxtBuyRetailPricePerUnit.setMaxLength(10); //set max length

            //Field Sell Retail Price - textbox
            _inputTxtSellRetailPricePerUnit = (InputTextbox)setupInputControl(new InputTextbox(), 1, "Sell Retail", GordenItem.COL_DB_SELLRETAILPRICEPERUNIT, (int)MasterDataColumnWidth.Fit, true, false, "N2");
            _inputTxtSellRetailPricePerUnit.setMaxLength(10); //set max length

            //Field Bulk Length Units - dropdownlist
            _inputDDLBulkLengthUnits = (InputDropdownlist)setupInputControl(new InputDropdownlist(), 1, "Roll Unit", GordenItem.COL_BULKLENGTHUNITNAME, (int)MasterDataColumnWidth.Fit, true, false, null);
            _inputDDLBulkLengthUnits.UpdateLink.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkUpdateLengthUnits_LinkClicked); //add event handler for update link
            LengthUnit.populateDropDownList(_inputDDLBulkLengthUnits.Dropdownlist, false, false);                                      //populate

            //Field Buy Bulk Price - textbox
            _inputTxtBuyBulkPricePerUnit = (InputTextbox)setupInputControl(new InputTextbox(), 1, "Buy Roll", GordenItem.COL_DB_BUYBULKPRICEPERUNIT, (int)MasterDataColumnWidth.Fit, true, false, "N2");
            _inputTxtBuyBulkPricePerUnit.setMaxLength(10); //set max length

            //Field Sell Bulk Price - textbox
            _inputTxtSellBulkPricePerUnit = (InputTextbox)setupInputControl(new InputTextbox(), 1, "Sell Roll", GordenItem.COL_DB_SELLBULKPRICEPERUNIT, (int)MasterDataColumnWidth.Fit, true, false, "N2");
            _inputTxtSellBulkPricePerUnit.setMaxLength(10); //set max length

            //Field Notes - textbox
            _inputTxtNotes = (InputTextbox)setupInputControl(new InputTextbox(), 2, "Notes", GordenItem.COL_DB_NOTES, 100, true, true, null);
            _inputTxtNotes.setToMultiline(4);
            _inputTxtNotes.setMaxLength(100); //set max length

            //set default control to focus
            DefaultInputToFocus = _inputTxtName;

            if (GlobalData.UserAccount.role != Roles.Super)
            {
                _inputTxtBuyRetailPricePerUnit.Visible = false;
                gridview.Columns[GordenItem.COL_DB_BUYRETAILPRICEPERUNIT].Visible = false;
                _inputTxtBuyBulkPricePerUnit.Visible = false;
                gridview.Columns[GordenItem.COL_DB_BUYBULKPRICEPERUNIT].Visible = false;
                _inputTxtSellRetailPricePerUnit.Visible = false;
                gridview.Columns[GordenItem.COL_DB_SELLRETAILPRICEPERUNIT].Visible = false;
            }
        }
Exemplo n.º 4
0
 private void lnkUpdateProductWidths_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     Tools.displayForm(new MasterData.ProductWidths_Form(FormMode.New));
     ProductWidth.populateDropDownList(_inputDDLProductWidths.Dropdownlist, false, true);
 }
Exemplo n.º 5
0
        /*******************************************************************************************************/
        #region METHODS

        protected override void setupFields()
        {
            Settings.setGeneralSettings(this);

            DoNotClearInputAfterSubmission = true;

            col_grid_name.Visible = false;
            disableFieldActive();

            btnAction1.Enabled = true;
            btnAction1.Text    = "DELETE";
            btnAction1.Width   = 100;

            btnAction2.Enabled = true;
            btnAction2.Text    = "CLEAR QTY";
            btnAction2.Width   = 100;

            btnAction3.Enabled = true;
            btnAction3.Text    = "CREATE PO";
            btnAction3.Width   = 100;

            btnAction4.Enabled = true;
            btnAction4.Text    = "HIDE COLUMNS";
            btnAction4.Width   = 120;

            btnAction5.Enabled = true;
            btnAction5.Text    = "-";
            btnAction5.Width   = 30;

            btnAction6.Enabled = true;
            btnAction6.Text    = "+";
            btnAction6.Width   = 30;

            //NOTES: must use inputColumns sequentially from the first one to the next. Otherwise calculation of the form width will be off

            //Field ID
            col_grid_id.DataPropertyName = InventoryStockLevel.COL_DB_ID;

            //Field Default
            col_grid_default.Visible = false;


            //Filter Vendor - dropdownlist
            _inputDDLVendors = (InputDropdownlist)setupInputControl(new InputDropdownlist(), 0, "Vendor", InventoryStockLevel.COL_VENDORNAME, (int)MasterDataColumnWidth.Fit, true, false, null);
            Vendor.populateDropDownList(_inputDDLVendors.Dropdownlist, false, true);                                                  //populate
            _inputDDLVendors.UpdateLink.LinkClicked            += new LinkLabelLinkClickedEventHandler(lnkUpdateVendors_LinkClicked); //add event handler for update link
            _inputDDLVendors.Dropdownlist.SelectedIndexChanged += new System.EventHandler(this.cbVendors_SelectedIndexChanged);
            _inputDDLVendors.Dropdownlist.TextChanged          += new System.EventHandler(this.cbVendors_TextChanged);

            //Field Name/Store - dropdownlist
            _inputDDLProducts = (InputDropdownlist)setupInputControl(new InputDropdownlist(), 0, "Product", InventoryStockLevel.COL_PRODUCTSTORENAME, (int)MasterDataColumnWidth.Fit, true, false, null);
            _inputDDLProducts.UpdateLink.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkUpdateProducts_LinkClicked); //add event handler for update link
            _inputDDLProducts.Enabled = false;

            //Field Grades - dropdownlist
            _inputDDLGrades = (InputDropdownlist)setupInputControl(new InputDropdownlist(), 0, "Grade", InventoryStockLevel.COL_GRADE_NAME, (int)MasterDataColumnWidth.Fit, true, false, null);
            _inputDDLGrades.UpdateLink.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkUpdateGrades_LinkClicked); //add event handler for update link
            Grade.populateDropDownList(_inputDDLGrades.Dropdownlist, false, true);                                       //populate

            //Field Product Widths - dropdownlist
            _inputDDLProductWidths = (InputDropdownlist)setupInputControl(new InputDropdownlist(), 0, "Lebar", InventoryStockLevel.COL_PRODUCT_WIDTH_NAME, (int)MasterDataColumnWidth.Fit, true, false, null);
            _inputDDLGrades.UpdateLink.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkUpdateProductWidths_LinkClicked); //add event handler for update link
            ProductWidth.populateDropDownList(_inputDDLProductWidths.Dropdownlist, false, true);                                //populate

            //Field Color - dropdownlist
            _inputDDLColors = (InputDropdownlist)setupInputControl(new InputDropdownlist(), 1, "Color", InventoryStockLevel.COL_COLOR_NAME, (int)MasterDataColumnWidth.Fit, true, false, null);
            _inputDDLColors.UpdateLink.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkUpdateColors_LinkClicked); //add event handler for update link
            FabricColor.populateDropDownList(_inputDDLColors.Dropdownlist, false, true);                                 //populate

            //Field Length Units - dropdownlist
            _inputDDLLengthUnits = (InputDropdownlist)setupInputControl(new InputDropdownlist(), 1, "Unit", InventoryStockLevel.COL_LENGTH_UNIT_NAME, (int)MasterDataColumnWidth.Fit, true, false, null);
            _inputDDLLengthUnits.UpdateLink.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkUpdateLengthUnits_LinkClicked); //add event handler for update link
            LengthUnit.populateDropDownList(_inputDDLLengthUnits.Dropdownlist, false, true);                                       //populate

            //Field Lot Qty - textbox
            _inputTxtOrderLotQty = (InputTextbox)setupInputControl(new InputTextbox(), 1, "Lot Qty", InventoryStockLevel.COL_DB_ORDERLOTQTY, (int)MasterDataColumnWidth.Fit, true, false, null);
            _inputTxtOrderLotQty.setMaxLength(5); //set max length

            //Field Qty - textbox
            _inputTxtQty = (InputTextbox)setupInputControl(new InputTextbox(), 1, "Min Qty", InventoryStockLevel.COL_DB_QTY, 40, true, false, null);
            _inputTxtQty.setMaxLength(5); //set max length

            //add columns
            col_grid_remainingQty                 = Tools.addColumn <DataGridViewTextBoxCell>(gridview, "col_grid_remainingQty", "Stock", InventoryStockLevel.COL_REMAININGSTOCKQTY, 40, true, null);        //add field to gridview
            col_grid_bookedQty                    = Tools.addColumn <DataGridViewTextBoxCell>(gridview, "col_grid_bookedQty", "Booked", InventoryStockLevel.COL_BOOKEDQTY, 50, true, null);                  //add field to gridview
            col_grid_orderQty                     = Tools.addColumn <DataGridViewTextBoxCell>(gridview, "col_grid_orderQty", "Pending", InventoryStockLevel.COL_PENDINGDELIVERYQTY, 50, true, null);         //add field to gridview
            col_grid_newQty                       = Tools.addColumn <DataGridViewTextBoxCell>(gridview, "col_grid_newQty", "Order", InventoryStockLevel.COL_NEWORDER_QTY, 40, false, null);                  //add field to gridview
            col_grid_lastOrderInventoryID         = Tools.addColumn <DataGridViewTextBoxCell>(gridview, "col_grid_referencedInventoryID", "", InventoryStockLevel.COL_LASTORDERINVENTORYID, 40, true, null); //add field to gridview
            col_grid_lastOrderInventoryID.Visible = false;
            col_grid_lastOrderTimestamp           = Tools.addColumn <DataGridViewTextBoxCell>(gridview, "col_grid_lastOrderTimestamp", "", InventoryStockLevel.COL_LASTORDERTIMESTAMP, 40, true, null);      //add field to gridview
            col_grid_lastOrderTimestamp.Visible   = false;

            //Field PO Notes - textbox
            _inputTxtPONotes = (InputTextbox)setupInputControl(new InputTextbox(), 2, "PO Notes", InventoryStockLevel.COL_DB_PONOTES, (int)MasterDataColumnWidth.Fit, false, true, null);
            _inputTxtPONotes.setToMultiline(4);
            _inputTxtPONotes.setMaxLength(50); //set max length

            //Field Notes - textbox
            _inputTxtNotes = (InputTextbox)setupInputControl(new InputTextbox(), 2, "Notes", InventoryStockLevel.COL_DB_NOTES, 100, false, true, null);
            _inputTxtNotes.setToMultiline(4);
            _inputTxtNotes.setMaxLength(100); //set max length
            gridview.Columns[InventoryStockLevel.COL_DB_NOTES].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

            //set default control to focus
            DefaultInputToFocus = _inputDDLVendors;

            clearInputFields(); //clear dropdownlists

            if (GlobalData.UserAccount.role != Roles.Super)
            {
                btnAction1.Enabled = false;
                btnAction3.Enabled = false;
                gridview.Columns[InventoryStockLevel.COL_DB_PONOTES].Visible = false;
            }
        }
Exemplo n.º 6
0
 private void btnAddProductWidth_Click(object sender, EventArgs e)
 {
     Tools.displayForm(new MasterData.ProductWidths_Form(FormMode.New));
     ProductWidth.populateDropDownList(cbProductWidths, false, true);
 }