internal void AddNewProduct() { ExcelLib.PopulateInCollection(InventoryTest.ExcelPath, "ProductPage"); Thread.Sleep(2000); //Select Invenotory menu Invetory.Click(); Thread.Sleep(2000); //Select Product menu Product.Click(); Thread.Sleep(2000); //Select Add New Product from menu AddProduct.Click(); Thread.Sleep(2000); //sending product code ProductCode.SendKeys(ExcelLib.ReadData(2, "ProductCode")); Thread.Sleep(1000); //sending product desc ProductDesc.SendKeys(ExcelLib.ReadData(2, "ProductDesc")); Thread.Sleep(1000); //sending barcode Barcode.SendKeys(ExcelLib.ReadData(2, "Barcode")); Thread.Sleep(1000); //sending Unitof measure //UnitOfMesureClick.Click(); //Thread.Sleep(2000); //UnitOfMesure.SendKeys(ExcelLib.ReadData(2, "UnitOfMesure")); var UnitOfMesure = CommonMethods.driver.FindElement(By.Id("Product_UnitOfMeasureId")); var selectUnitOfMesure = new SelectElement(UnitOfMesure); Thread.Sleep(1000); selectUnitOfMesure.SelectByText(ExcelLib.ReadData(2, "UnitOfMesure")); //sending Product group //ProductGrp.SendKeys(ExcelLib.ReadData(2, "ProductGroup")); var ProductGrpList = CommonMethods.driver.FindElement(By.Id("Product_ProductGroupId")); var selectProGrpVal = new SelectElement(ProductGrpList); Thread.Sleep(1000); selectProGrpVal.SelectByText(ExcelLib.ReadData(2, "ProductGroup")); Thread.Sleep(1000); //sending Pack size PackSize.SendKeys(ExcelLib.ReadData(2, "PackSize")); Thread.Sleep(1000); //Sending Weight ProductWeight.SendKeys(ExcelLib.ReadData(2, "ProductWeight")); Thread.Sleep(1000); //Sending Product width ProductWidth.SendKeys(ExcelLib.ReadData(2, "ProductWidth")); Thread.Sleep(1000); //sending Product Height ProductHeight.SendKeys(ExcelLib.ReadData(2, "ProductHeight")); Thread.Sleep(1000); //sending ProductDepth ProductDepth.SendKeys(ExcelLib.ReadData(2, "ProductDepth")); Thread.Sleep(1000); ////select Types //NeverDimishing.Click(); //Thread.Sleep(1000); ////CommonMethods.driver.SwitchTo().Alert().Dismiss(); //Obsolete.Click(); //Thread.Sleep(1000); ////CommonMethods.driver.SwitchTo().Alert().Dismiss(); //Sending Notes Notes.SendKeys(ExcelLib.ReadData(2, "Notes")); //savedata SaveBtn.Click(); Thread.Sleep(2000); ProductView.Click(); Thread.Sleep(1000); ProductCodeFilter.SendKeys(ExcelLib.ReadData(2, "ProductCode")); Thread.Sleep(1000); //press enter ProductCodeFilter.SendKeys(Keys.Enter); Thread.Sleep(4000); try { //verify record is added if (ExcelLib.ReadData(2, "ProductCode") == CommonMethods.driver.FindElement(By.XPath(".//*[@id='ProductList_tccell0_2']/div/a")).Text) { if (ExcelLib.ReadData(2, "ProductDesc") == CommonMethods.driver.FindElement(By.XPath(".//*[@id='ProductList_tccell0_3']/div/a")).Text) { if (ExcelLib.ReadData(2, "ProductGrp") == CommonMethods.driver.FindElement(By.XPath(".//*[@id='ProductList_tccell0_3']/div/a")).Text) { SaveScreenShotClass.SaveScreenshot(CommonMethods.driver, "Found Added Product "); } } } else { SaveScreenShotClass.SaveScreenshot(CommonMethods.driver, "No record found "); } } catch (Exception e) { Console.WriteLine("Can not find added Product,Test failed" + e.Message); } }
private void lnkUpdateProductWidths_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Tools.displayForm(new MasterData.ProductWidths_Form(FormMode.New)); ProductWidth.populateDropDownList(_inputDDLProductWidths.Dropdownlist, false, true); }
private void setupControls() { Settings.setGeneralSettings(this); if (_formMode == FormMode.Browse) { flpButtons.Enabled = false; //splitContainer1.Panel1Collapsed = true; } lblRowInfoHeader.Text = ""; Grade.populateInputControlCheckedListBox(iclb_Grades, false); ProductWidth.populateInputControlCheckedListBox(iclb_ProductWidths, false); ProductStoreName.populateInputControlCheckedListBox(iclb_ProductStoreNames, false); LengthUnit.populateInputControlCheckedListBox(iclb_LengthUnits, false); FabricColor.populateInputControlCheckedListBox(iclb_Colors, false); grid.AutoGenerateColumns = false; grid.SelectionMode = DataGridViewSelectionMode.FullRowSelect; col_grid_active.DataPropertyName = Inventory.COL_DB_ACTIVE; col_grid_receiveDate.DataPropertyName = Inventory.COL_DB_RECEIVEDATE; col_grid_code.DataPropertyName = Inventory.COL_DB_CODE; col_grid_grade.DataPropertyName = Inventory.COL_GRADE_NAME; col_grid_product.DataPropertyName = Inventory.COL_PRODUCTSTORENAME; col_grid_productWidth.DataPropertyName = Inventory.COL_PRODUCT_WIDTH_NAME; col_grid_color.DataPropertyName = Inventory.COL_COLOR_NAME; col_grid_sellPrice.DataPropertyName = Inventory.COL_SELLPRICE; col_grid_buyPrice.DataPropertyName = Inventory.COL_DB_BUYPRICE; col_grid_unit.DataPropertyName = Inventory.COL_LENGTH_UNIT_NAME; col_grid_availablePcs.DataPropertyName = Inventory.COL_AVAILABLEQTY; col_grid_availableQty.DataPropertyName = Inventory.COL_AVAILABLEITEMLENGTH; col_grid_totalPcs.DataPropertyName = Inventory.COL_QTY; col_grid_totalQty.DataPropertyName = Inventory.COL_ITEMLENGTH; col_grid_PONo.DataPropertyName = Inventory.COL_PONo; col_grid_invoiceNo.DataPropertyName = Inventory.COL_VENDORINVOICENO; col_grid_packingListNo.DataPropertyName = Inventory.COL_DB_PACKINGLISTNO; col_grid_isConsignment.DataPropertyName = Inventory.COL_DB_IsConsignment; col_grid_OpnameMarker.DataPropertyName = Inventory.COL_DB_OpnameMarker; col_grid_code.Frozen = true; col_grid_buyPrice.Visible = false; gridSummary.AutoGenerateColumns = false; gridSummary.SelectionMode = DataGridViewSelectionMode.FullRowSelect; col_gridSummary_availablePcs.DataPropertyName = Inventory.COL_AVAILABLEQTY; col_gridSummary_availableQty.DataPropertyName = Inventory.COL_AVAILABLEITEMLENGTH; col_gridSummary_averagePrice.DataPropertyName = Inventory.COL_DB_BUYPRICE; col_gridSummary_grade.DataPropertyName = Inventory.COL_GRADE_NAME; col_gridSummary_Product_Id.DataPropertyName = Inventory.COL_PRODUCTID; col_gridSummary_StoreName.DataPropertyName = Inventory.COL_PRODUCTSTORENAME; col_gridSummary_unitName.DataPropertyName = Inventory.COL_LENGTH_UNIT_NAME; col_gridSummary_Width.DataPropertyName = Inventory.COL_PRODUCT_WIDTH_NAME; col_gridSummary_BuyValue.DataPropertyName = Inventory.COL_BUYVALUE; col_gridSummary_SellValue.DataPropertyName = Inventory.COL_SELLVALUE; gridSummaryByColor.AutoGenerateColumns = false; gridSummaryByColor.SelectionMode = DataGridViewSelectionMode.FullRowSelect; col_gridSummaryByColor_availablePcs.DataPropertyName = Inventory.COL_AVAILABLEQTY; col_gridSummaryByColor_AvailableQty.DataPropertyName = Inventory.COL_AVAILABLEITEMLENGTH; col_gridSummaryByColor_AveragePrice.DataPropertyName = Inventory.COL_DB_BUYPRICE; col_gridSummaryByColor_Grade.DataPropertyName = Inventory.COL_GRADE_NAME; col_gridSummaryByColor_ColorName.DataPropertyName = Inventory.COL_COLOR_NAME; col_gridSummaryByColor_ProductId.DataPropertyName = Inventory.COL_PRODUCTID; col_gridSummaryByColor_ProductStoreName.DataPropertyName = Inventory.COL_PRODUCTSTORENAME; col_gridSummaryByColor_UnitName.DataPropertyName = Inventory.COL_LENGTH_UNIT_NAME; col_gridSummaryByColor_ProductWidthName.DataPropertyName = Inventory.COL_PRODUCT_WIDTH_NAME; col_gridSummaryByColor_BuyValue.DataPropertyName = Inventory.COL_BUYVALUE; col_gridSummaryByColor_SellValue.DataPropertyName = Inventory.COL_SELLVALUE; if (GlobalData.UserAccount.role != Roles.Super) { chkShowHidden.Visible = false; pbLog.Enabled = false; chkRearrange.Visible = false; chkCalculateBuyValue.Visible = false; col_grid_isConsignment.Visible = false; col_gridSummary_averagePrice.Visible = false; col_gridSummary_BuyValue.Visible = false; col_gridSummary_SellValue.Visible = false; col_gridSummaryByColor_AveragePrice.Visible = false; col_gridSummaryByColor_BuyValue.Visible = false; col_gridSummaryByColor_SellValue.Visible = false; } }
/*******************************************************************************************************/ #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; } }
protected override void update() { ProductWidth.update(selectedRowID(), _inputTxtName.TextValue); }
protected override void add() { ProductWidth.add(_inputTxtName.TextValue); }
protected override void populateInputFields() { ProductWidth obj = new ProductWidth(selectedRowID()); _inputTxtName.TextValue = obj.Name; }
protected override System.Data.DataView loadGridviewDataSource() { return(ProductWidth.getByFilter(chkIncludeInactive.Checked, _inputTxtName.TextValue).DefaultView); }
protected override void updateDefaultRow(Guid id) { ProductWidth.updateDefaultRow(id); }
protected override void updateActiveStatus(Guid id, Boolean activeStatus) { ProductWidth.updateActiveStatus(id, activeStatus); }
private void btnAddProductWidth_Click(object sender, EventArgs e) { Tools.displayForm(new MasterData.ProductWidths_Form(FormMode.New)); ProductWidth.populateDropDownList(cbProductWidths, false, true); }