private void DropDownListProCategory(Facade facade) { IProductCategoryBL ProductCategoryList = facade.createProductCategoryBL(); List <ProductCategoryInfoDTO> oProCategoryList = ProductCategoryList.GetProductCategoryInfo(); int i = 0; DDLCategory.Items.Clear(); DDLCategory.Items.Add("(Select Product Category Name)"); this.DDLCategory.Items[i].Value = "00000000-0000-0000-0000-000000000000"; foreach (ProductCategoryInfoDTO newDto in oProCategoryList) { i++; this.DDLCategory.Items.Add(newDto.PC_Description); this.DDLCategory.Items[i].Value = newDto.PrimaryKey.ToString(); } }
private void DropDownListCategory(Facade facade) { IProductCategoryBL categoryList = facade.createProductCategoryBL(); List <ProductCategoryInfoDTO> oCategoryList = categoryList.showData(); int i = 0; ddlProductCategory.Items.Clear(); ddlProductCategory.Items.Add("(Select any category)"); this.ddlProductCategory.Items[i].Value = ""; foreach (ProductCategoryInfoDTO newDto in oCategoryList) { i++; this.ddlProductCategory.Items.Add(newDto.PC_Description); this.ddlProductCategory.Items[i].Value = newDto.PrimaryKey.ToString(); } }
protected void btnSave_Click(object sender, EventArgs e) { if (this.lblErrorMessage.Text.Length != 0) { this.lblErrorMessage.Text = ""; } ProductCategoryInfoDTO dto = populate(); Facade facade = Facade.GetInstance(); IProductCategoryBL oCategoryBL = facade.createProductCategoryBL(); try { oCategoryBL.addNewProduct(dto); // this.lblErrorMessage.Text = "Data Save Successfully."; //======================================================================= // btnSave.Attributes.Add("onclick", "test()"); //======================================================================= this.txtHideFieldPK.Value = ""; this.txtProductCategoryCode.Text = ""; this.txtCategoryDescription.Text = ""; this.btnSave.Text = "Save"; this.GridView1.DataBind(); this.lblErrorMessage.Text = "Data Save Successfully."; } catch (Exception Exp) { lblErrorMessage.Text = cls.ErrorString(Exp); } }
//creating reference for interface public UserController() { productCategoryBL = new ProductCategoryBL(); productBL = new ProductBL(); }
//creating reference to interfaces public AdminController() { productDetails = new ProductBL(); productCategoryDetails = new ProductCategoryBL(); userDetailsBL = new UserBL(); }
//creating reference for interface public CartController() { productCategoryBL = new ProductCategoryBL(); productBL = new ProductBL(); ShoppingCartBL = new ShoppingCartBL(); }