protected void Page_Load(object sender, EventArgs e) { var proxy = new CustomerServiceClient(); try { CustomersDropDownList.DataSource = proxy.GetCustomers(); CustomersDropDownList.DataBind(); } catch (Exception exp) { ShowAlert("Error fetching customers: " + exp.Message); } }
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_supplier) { Response.Redirect("/status.aspx?error=notcustomer"); } if (!IsPostBack) { CustomersDropDownList.DataSource = AllowedStore.GetCustomers(homeCompany.company_id); CustomersDropDownList.DataBind(); } }