private void loadData() { try { Account account = AB.GetAccount(accountId); List <String> listRole = RB.GetRoleNames(); ddlRole.Items.Add("Select role"); foreach (String item in listRole) { ddlRole.Items.Add(item); } ddlRole.Text = account.Role_Name; lblName.Text = account.Account_UserName; if (account.Account_IsLocked) { lblStatus.Text = "Locked"; lnkStatus.Text = "Unlock"; } else { lblStatus.Text = "Unlocked"; lnkStatus.Text = "Lock"; } } catch (Exception ex) { if (Session["return"] == null) { Session.Add("return", "null"); } else { Session["return"] = "null"; } Response.Redirect(WebHelper.Instance.GetURL() + "ManageSystem/Employee/Manage"); } }
private void loadData() { List <Employee> list = EB.GetEmployeesNotRegistered(); ddlEmployeeEmail.Items.Clear(); ddlEmployeeEmail.Items.Add("Select email"); foreach (Employee emp in list) { ListItem item = new ListItem(); item.Text = emp.Employee_Email; item.Value = emp.Employee_Id.ToString(); ddlEmployeeEmail.Items.Add(item); } List <String> listRole = RB.GetRoleNames(); ddlRole.Items.Clear(); ddlRole.Items.Add("Select role"); foreach (String item in listRole) { ddlRole.Items.Add(item); } }