public void GetAllSuppliers() { SuppliersDropDownList.DataSource = _PurchaseRepository.GetAllSupplliers(); SuppliersDropDownList.DataTextField = "Name"; SuppliersDropDownList.DataValueField = "Id"; SuppliersDropDownList.DataBind(); SuppliersDropDownList.Items.Insert(0, new ListItem("Chose Supplier", "0")); }
protected void Page_Load(object sender, EventArgs e) { loggedInAdmin = Helpers.GetLoggedInAdmin(); homeCompany = Helpers.GetCurrentCompany(); if (!(Helpers.IsAuthorizedAdmin(loggedInAdmin, homeCompany))) { Response.Redirect("/status.aspx?error=notadmin"); } else if (!homeCompany.is_customer) { Response.Redirect("/status.aspx?error=notcustomer"); } if (!IsPostBack) { SuppliersDropDownList.DataSource = AllowedStore.GetSuppliers(homeCompany.company_id); SuppliersDropDownList.DataBind(); } }