private void loadData() { List <Service> listService = SB.GetServices(false); ddlService.Items.Clear(); ddlService.Items.Add("Select service"); foreach (Service item in listService) { ddlService.Items.Add(item.Service_Name); } Department department = DB.GetDepartment("Service", false); List <Employee> listEmployee = EB.GetEmployees(department.Department_Id, false); List <Account> lisAccount = AB.GetAccountsOfEmployees(listEmployee); ddlAccount.Items.Clear(); ddlAccount.Items.Add("Select account"); foreach (Account item in lisAccount) { ddlAccount.Items.Add(item.Account_UserName); } DataTable dataTable = CB.Company_ShowAllDisplay(""); ddlCompanyName.Items.Clear(); ddlCompanyName.Items.Add("Select company"); for (int i = 0; i < dataTable.Rows.Count; i++) { ListItem item = new ListItem(); item.Text = dataTable.Rows[i]["Company_Name"].ToString(); item.Value = dataTable.Rows[i]["Company_Id"].ToString(); ddlCompanyName.Items.Add(item); } CreateOrderMode(); }
protected void Page_Load(object sender, EventArgs e) { pnlRed.Visible = false; pnlGreen.Visible = false; pnlYellow.Visible = false; pnlBlue.Visible = false; OB = new OrderBusiness(); SB = new ServiceBusiness(); GetRouteData(); if (IsPostBack) { String script = WebHelper.Instance.GetJqueryScript("App_Themes/js/jquery/custom_jquery.js"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "MessageWarning", script, true); } else { List <Service> listService = SB.GetServices(); ddlService.Items.Clear(); ListItem item = new ListItem("All", ""); ddlService.Items.Add(item); foreach (Service service in listService) { item = new ListItem(); item.Text = service.Service_Name; item.Value = service.Service_Id.ToString(); ddlService.Items.Add(item); } ddlService.SelectedIndex = 0; ddlStatus.Items.Clear(); ListItem itemStatus = new ListItem("All", ""); ddlStatus.Items.Add(itemStatus); itemStatus = new ListItem("Pending", "0"); ddlStatus.Items.Add(itemStatus); itemStatus = new ListItem("In Progress", "99"); ddlStatus.Items.Add(itemStatus); itemStatus = new ListItem("Resolved", "1"); ddlStatus.Items.Add(itemStatus); ddlStatus.SelectedIndex = 0; } loadData(); Search(); }
private void loadData() { try { List <Service> listService = SB.GetServices(false); ddlService.Items.Clear(); ddlService.Items.Add("Select service"); foreach (Service item in listService) { ddlService.Items.Add(item.Service_Name); } ddlPaymentMethod.Items.Clear(); ddlPaymentMethod.Items.Add("Select method"); ddlPaymentMethod.Items.Add("Cash"); ddlPaymentMethod.Items.Add("Card"); ddlPaymentMethod.Items.Add("Online"); ddlStatus.Items.Clear(); ddlStatus.Items.Add("Pending"); ddlStatus.Items.Add("In Progress"); ddlStatus.Items.Add("Resolved"); if (Session["orderModify"] != null) { Session.Remove("orderModify"); } if (Session["listOrderDetailModify"] != null) { Session.Remove("listOrderDetailModify"); } if (OB.GetOrder(orderId) != null) { CreateOrderMode(); } else { if (Session["return"] == null) { Session.Add("return", "null"); } else { Session["return"] = "null"; } Response.Redirect(WebHelper.Instance.GetURL() + "ManageService/Order/Manage"); } } catch (Exception ex) { if (Session["return"] == null) { Session.Add("return", "null"); } else { Session["return"] = "null"; } Response.Redirect(WebHelper.Instance.GetURL() + "ManageService/Order/Manage"); } }