/// <summary> /// This is the Page Load method for adding an item /// </summary> protected void Page_Load(object sender, EventArgs e) { IAdminBLL objBLL = AdminBLLFactory.CreateAdminBLLObject(); int itemId = Convert.ToInt32(Request.QueryString["ItemID"]); if (!IsPostBack) { List <IItemCategory> itemList = objBLL.GetCategoryList(); ddlCategory.DataSource = itemList; ddlCategory.DataTextField = "CategoryName"; ddlCategory.DataValueField = "CategoryID"; ddlCategory.DataBind(); if (itemId != 0) { //itemId = Convert.ToInt32(Request.QueryString["ItemID"]); IItem objItem = ViewItemBOFactory.CreateItemobject(); // IAdminBLL objBLL = AdminBLLFactory.CreateAdminBLLObject(); objItem = objBLL.GetItemByItemId(itemId); objItem.ItemID = itemId; txtItemName.Text = Convert.ToString(objItem.ItemName); ddlCategory.SelectedValue = Convert.ToString(objItem.ItemCategory); txtItemPrice.Text = Convert.ToString(objItem.ItemPrice); txtItemQuantity.Text = Convert.ToString(objItem.ItemQuantity); txtItemDiscount.Text = Convert.ToString(objItem.ItemDiscount); //objBLL.UpdateItemDetails(objItem); } lblNewCat.Visible = false; btnCat.Visible = false; txtnewCat.Visible = false; } /*else * { * int itemId = Convert.ToInt32(tx); * }*/ }