public void LoadCreatedBy(tbl_Account acc = null) { if (acc != null) { ddlCreatedBy.Items.Clear(); ddlCreatedBy.Items.Insert(0, new ListItem(acc.Username, acc.Username)); } else { var CreateBy = AccountController.GetAllNotSearch().Where(x => x.RoleID == 0 || x.RoleID == 2).ToList(); ddlCreatedBy.Items.Clear(); ddlCreatedBy.Items.Insert(0, new ListItem("Nhân viên tạo đơn", "")); if (CreateBy.Count > 0) { foreach (var p in CreateBy) { ListItem listitem = new ListItem(p.Username, p.Username); ddlCreatedBy.Items.Add(listitem); } ddlCreatedBy.DataBind(); } // Add Customer Bank drop down list var cusBanks = BankController.getDropDownList(); cusBanks[0].Text = "Ngân hàng chuyển"; ddlCustomerBank.Items.Clear(); ddlCustomerBank.Items.AddRange(cusBanks.ToArray()); ddlCustomerBank.DataBind(); // Add Account Bank drop down list var accBanks = BankAccountController.getDropDownList(); accBanks[0].Text = "Ngân hàng nhận"; ddlBankReceive.Items.Clear(); ddlBankReceive.Items.AddRange(accBanks.ToArray()); ddlBankReceive.DataBind(); ddlAccoutBank.Items.Clear(); ddlAccoutBank.Items.AddRange(accBanks.ToArray()); ddlAccoutBank.DataBind(); // Add Order status ddlStatus.Items.Clear(); ddlStatus.Items.Add(new ListItem("Trạng thái giao dịch", "0")); ddlStatus.Items.Add(new ListItem("Đã nhận tiền", "1")); ddlStatus.Items.Add(new ListItem("Chưa nhận tiền", "2")); ddlStatus.SelectedIndex = 0; } }