protected void BindControl() { DropDownList ddl = DdlCategoryID; if (ddl != null) { ddl.DataSource = BusinessLogic.InventoryLogic.CategoryID(); ddl.DataTextField = "CatalogueName"; ddl.DataValueField = "CategoryID"; ddl.DataBind(); } List <SupplierList> sList = PurchasingLogic.ListSuppliers(); DdlSupplier1.DataSource = sList; DdlSupplier1.DataBind(); DdlSupplier1.Items.Insert(0, new ListItem(String.Empty, String.Empty)); DdlSupplier1.SelectedIndex = 0; DdlSupplier2.DataSource = sList; DdlSupplier2.DataBind(); DdlSupplier2.Items.Insert(0, new ListItem(String.Empty, String.Empty)); DdlSupplier2.SelectedIndex = 0; DdlSupplier3.DataSource = sList; DdlSupplier3.DataBind(); DdlSupplier3.Items.Insert(0, new ListItem(String.Empty, String.Empty)); DdlSupplier3.SelectedIndex = 0; }
protected void BindControl(string itemID) { List <SupplierList> sList = PurchasingLogic.ListSuppliers(); DdlSupplier1.DataSource = sList; DdlSupplier1.DataBind(); DdlSupplier1.Items.Insert(0, new ListItem(String.Empty, String.Empty)); DdlSupplier1.SelectedValue = InventoryLogic.GetFirstPrioritySupplierByItemID(itemID); DdlSupplier2.DataSource = sList; DdlSupplier2.DataBind(); DdlSupplier2.Items.Insert(0, new ListItem(String.Empty, String.Empty)); if (InventoryLogic.GetSecondPrioritySupplierByItemID(itemID) != null) { DdlSupplier2.SelectedValue = InventoryLogic.GetSecondPrioritySupplierByItemID(itemID); } else { DdlSupplier2.SelectedIndex = 0; } DdlSupplier3.DataSource = sList; DdlSupplier3.DataBind(); DdlSupplier3.Items.Insert(0, new ListItem(String.Empty, String.Empty)); if (InventoryLogic.GetThirdPrioritySupplierByItemID(itemID) != null) { DdlSupplier3.SelectedValue = InventoryLogic.GetThirdPrioritySupplierByItemID(itemID); } else { DdlSupplier3.SelectedIndex = 0; } TxtPriceS1.Text = InventoryLogic.GetFirstPrioritySupplierPriceByItemID(itemID); TxtPriceS2.Text = InventoryLogic.GetSecondPrioritySupplierPriceByItemID(itemID); TxtPriceS3.Text = InventoryLogic.GetThirdPrioritySupplierPriceByItemID(itemID); TxtItemID.Text = itemID; TxtItemID.ReadOnly = true; TxtDescription.Text = InventoryLogic.GetItemDescription(itemID); TxtDescription.ReadOnly = true; TxtCategory.Text = InventoryLogic.GetCatalogueName(InventoryLogic.GetInventoryItem(itemID).CategoryID); TxtCategory.ReadOnly = true; }