private void Save() { Business.Inventory.ProductMaster objProductMaster = new Business.Inventory.ProductMaster(); Entity.Inventory.ProductMaster productMaster = new Entity.Inventory.ProductMaster(); productMaster.BrandId = int.Parse(ddlBrand.SelectedValue); productMaster.ProductMasterId = ProductMasterId; productMaster.ParentProductMasterId = 0; productMaster.ProductCode = txtProductCode.Text; productMaster.ProductName = txtProductName.Text; productMaster.ProductSpecification = txtProductSpecification.Text; productMaster.MachineLife = int.Parse(txtMachineLife.Text); productMaster.MCBF = (txtMCBF.Text == string.Empty) ? 0 : int.Parse(txtMCBF.Text); productMaster.MTBF = (txtMTBF.Text == string.Empty) ? 0 : int.Parse(txtMTBF.Text); productMaster.ProductCategoryId = int.Parse(ddlProductCategory.SelectedValue); productMaster.UserId = 1; productMaster.CompanyMasterId = 1; int i = objProductMaster.Save(productMaster); if (i > 0) { ClearControl(); LoadProductMaster(); Message.IsSuccess = true; Message.Text = "Product Saved Successfully..."; } else { Message.IsSuccess = false; Message.Text = "Sorry, can not save product!"; } Message.Show = true; }
private void LoadProductMaster() { Business.Inventory.ProductMaster objProductMaster = new Business.Inventory.ProductMaster(); Entity.Inventory.ProductMaster productMaster = new Entity.Inventory.ProductMaster(); productMaster.CompanyMasterId = 1; gvProductMaster.DataSource = objProductMaster.GetAll(productMaster); gvProductMaster.DataBind(); }
//protected void LoadCustomer() //{ // Business.Customer.Customer objCustomer = new Business.Customer.Customer(); // Entity.Customer.Customer customer = new Entity.Customer.Customer(); // if (HttpContext.Current.User.IsInRole(Entity.HR.Utility.CUSTOMER_LIST_SHOW_ALL)) // customer.AssignEngineer = 0; // else // customer.AssignEngineer = int.Parse(HttpContext.Current.User.Identity.Name); // DataTable dt = objCustomer.Customer_Customer_GetByAssignEngineerId(customer); // ddlCustomer.DataSource = dt; // ddlCustomer.DataTextField = "CustomerName"; // ddlCustomer.DataValueField = "CustomerMasterId"; // ddlCustomer.DataBind(); // ddlCustomer.InsertSelect(); //} private void LoadProduct() { Business.Inventory.ProductMaster objProductMaster = new Business.Inventory.ProductMaster(); Entity.Inventory.ProductMaster productmaster = new Entity.Inventory.ProductMaster(); productmaster.CompanyMasterId = 1; ddlProduct.DataSource = objProductMaster.GetAll(productmaster); ddlProduct.DataTextField = "ProductName"; ddlProduct.DataValueField = "ProductMasterId"; ddlProduct.DataBind(); ddlProduct.InsertSelect(); }
protected void btnMap_Click(object sender, EventArgs e) { try { Business.Inventory.ProductMaster objProductMaster = new Business.Inventory.ProductMaster(); Entity.Inventory.ProductMaster productMaster = new Entity.Inventory.ProductMaster(); using (DataTable dt = new DataTable()) { dt.Columns.Add("SpareId"); foreach (GridViewRow gvr in gvSpare.Rows) { CheckBox chkMap = (CheckBox)gvr.FindControl("chkMap"); if (chkMap.Checked) { dt.Rows.Add(); dt.Rows[dt.Rows.Count - 1]["SpareId"] = gvSpare.DataKeys[gvr.RowIndex].Values[0].ToString(); dt.AcceptChanges(); } } productMaster.ProductMasterId = int.Parse(ddlProduct.SelectedValue); productMaster.dtMapping = dt; int i = objProductMaster.ProductSpareMapping_Save(productMaster); if (i > 0) { Message.IsSuccess = true; Message.Text = "Product Spare Mapping Saved..."; } else { Message.IsSuccess = false; Message.Text = "Mapping can not save!"; } Message.Show = true; } } catch (Exception ex) { ex.WriteException(); Message.IsSuccess = false; Message.Text = ex.Message; Message.Show = true; } }
private void PopulateProduct() { Business.Inventory.ProductMaster objProductMaster = new Business.Inventory.ProductMaster(); Entity.Inventory.ProductMaster productMaster = new Entity.Inventory.ProductMaster(); productMaster = objProductMaster.GetById(ProductMasterId); ProductMasterId = productMaster.ProductMasterId; ddlBrand.SelectedValue = Convert.ToString(productMaster.BrandId); txtProductCode.Text = productMaster.ProductCode; txtProductName.Text = productMaster.ProductName; txtProductSpecification.Text = productMaster.ProductSpecification; txtMachineLife.Text = Convert.ToString(productMaster.MachineLife); txtMCBF.Text = (productMaster.MCBF == 0) ? "" : Convert.ToString(productMaster.MCBF); txtMTBF.Text = (productMaster.MTBF == 0) ? "" : Convert.ToString(productMaster.MTBF); ddlProductCategory.SelectedValue = Convert.ToString(productMaster.ProductCategoryId); }
private void LoadProduct() { Business.Inventory.ProductMaster objProductMaster = new Business.Inventory.ProductMaster(); Entity.Inventory.ProductMaster productmaster = new Entity.Inventory.ProductMaster(); productmaster.CompanyMasterId = 1; productmaster.Nature = 1; productmaster.BrandId = (ddlBrand.SelectedIndex == 0) ? 0 : int.Parse(ddlBrand.SelectedValue); DataTable dt = objProductMaster.GetAll(productmaster); ddlProduct.DataSource = dt; ddlProduct.DataTextField = "ProductName"; ddlProduct.DataValueField = "ProductMasterId"; ddlProduct.DataBind(); ddlProduct.InsertSelect(); }
private void LoadProduct() { Business.Inventory.ProductMaster objProductMaster = new Business.Inventory.ProductMaster(); Entity.Inventory.ProductMaster productmaster = new Entity.Inventory.ProductMaster(); productmaster.CompanyMasterId = 1; DataTable dt = objProductMaster.GetAll(productmaster); ddlDocketProduct.DataSource = dt; ddlDocketProduct.DataTextField = "ProductName"; ddlDocketProduct.DataValueField = "ProductMasterId"; ddlDocketProduct.DataBind(); ListItem li = new ListItem("--SELECT ALL--", "0"); ddlDocketProduct.Items.Insert(0, li); }