public void BindWarehouse() { cboWarehouse.DataSource = WarehouseBLL.GetAllActiveWarehouse(); cboWarehouse.DataTextField = "WarehouseName"; cboWarehouse.DataValueField = "WarehouseId"; cboWarehouse.DataBind(); }
private void LoadControls() { // Loading Warehoouse. List <WarehouseBLL> listWarehouse = new List <WarehouseBLL>(); try { listWarehouse = WarehouseBLL.GetAllActiveWarehouse(); } catch (Exception ex) { this.lblmsg.Text = ex.Message; return; } this.cboWarehouse.Items.Add(new ListItem("Please Select warehouse", "")); if (listWarehouse.Count > 0) { this.cboWarehouse.AppendDataBoundItems = true; foreach (WarehouseBLL ow in listWarehouse) { this.cboWarehouse.Items.Add(new ListItem(ow.WarehouseName.ToString(), ow.WarehouseId.ToString())); } this.cboWarehouse.AppendDataBoundItems = false; } }
private void FillWareHouse() { drpWarehouse.Items.Clear(); drpWarehouse.Items.AddRange( (from warehouse in WarehouseBLL.GetAllActiveWarehouse() select new ListItem() { Text = warehouse.WarehouseName, Value = warehouse.WarehouseId.ToString() }).ToArray()); drpWarehouse.Items.Insert(0, new ListItem("Select", string.Empty)); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack != true) { Page.DataBind(); try { this.cboCommodity.Items.Add(new ListItem("Please Select Commodity", "")); this.cboCommodity.AppendDataBoundItems = true; ECXLookUp.ECXLookup objEcxLookUp = new WarehouseApplication.ECXLookUp.ECXLookup(); ECXLookUp.CCommodity[] objCommodity = objEcxLookUp.GetActiveCommodities(Utility.GetWorkinglanguage()); this.cboCommodity.DataSource = objCommodity; this.cboCommodity.DataTextField = "Name"; this.cboCommodity.DataValueField = "UniqueIdentifier"; this.cboCommodity.DataBind(); } catch (Exception ex) { throw ex; } try { // get the type of the current warehoouse. this.cboWarehouse.Items.Add(new ListItem("Please Select Warehouse", "")); this.cboWarehouse.AppendDataBoundItems = true; List <WarehouseBLL> listWarehouse = WarehouseBLL.GetAllActiveWarehouse(); foreach (WarehouseBLL owarehouse in listWarehouse) { this.cboWarehouse.Items.Add(new ListItem(owarehouse.WarehouseName, owarehouse.WarehouseId.ToString())); } this.cboWarehouse.SelectedValue = UserBLL.GetCurrentWarehouse().ToString(); } catch (Exception ex) { throw ex; } int currYear; currYear = int.Parse(ConfigurationSettings.AppSettings["CurrentEthiopianYear"]); this.cboProductionYear.Items.Add(new ListItem("Please Select Production Year.", "")); this.cboProductionYear.AppendDataBoundItems = true; for (int i = currYear - 2; i <= currYear; i++) { this.cboProductionYear.Items.Add(new ListItem(i.ToString(), i.ToString())); } } else { } }
protected void Page_Load(object sender, EventArgs e) { UserBLL.Expire(UserBLL.CurrentUser.UserId); if (!IsPostBack) { ddlWarehouse.Items.Clear(); ddlWarehouse.Items.AddRange( (from warehouse in WarehouseBLL.GetAllActiveWarehouse() select new ListItem() { Text = warehouse.WarehouseName, Value = warehouse.WarehouseId.ToString() }).ToArray()); this.Page.Title = "ECX Warehouse Application"; } }
private void LoadControls() { // Loading Warehoouse. List <WarehouseBLL> listWarehouse = new List <WarehouseBLL>(); try { listWarehouse = WarehouseBLL.GetAllActiveWarehouse(); } catch (Exception ex) { this.lblmsg.Text = ex.Message; return; } //this.cboWarehouse.Items.Add( new ListItem("Please Select warehouse","")); if (listWarehouse.Count > 0) { this.cboWarehouse.AppendDataBoundItems = true; foreach (WarehouseBLL ow in listWarehouse) { if (ow.WarehouseId == UserBLL.GetCurrentWarehouse()) { this.cboWarehouse.Items.Add(new ListItem(ow.WarehouseName.ToString(), ow.WarehouseId.ToString())); this.cboWarehouse.SelectedValue = ow.WarehouseId.ToString(); } } this.cboWarehouse.AppendDataBoundItems = false; WarehouseChanged(); } //productionyearStack int currYear; currYear = int.Parse(ConfigurationSettings.AppSettings["CurrentEthiopianYear"]); this.cboProductionYear.Items.Clear(); this.cboProductionYear.Items.Add(new ListItem("Please Select Production Year.", "")); this.cboProductionYear.AppendDataBoundItems = true; for (int i = currYear - 2; i <= currYear; i++) { this.cboProductionYear.Items.Add(new ListItem(i.ToString(), i.ToString())); } }