private void InitialData() { var cmd = new EmployeeService(); DataSouce = cmd.GetALL(); gridEmployee.DataSource = DataSouce; gridEmployee.DataBind(); DataSouceNewRoleFunction = new List<ZONE_DETAIL>(); }
private void InitialDataPopup() { dllEmp.Items.Clear(); dllRole.Items.Clear(); var emp = new EmployeeService(); foreach (var item in emp.GetALL()) { dllEmp.Items.Add(new ListItem(item.EMPLOYEE_NAME + " " + item.EMPLOYEE_SURNAME, item.EMPLOYEE_ID.ToString())); } var role = new RoleService(); foreach (var item in role.GetALL()) { dllRole.Items.Add(new ListItem(item.ROLE_NAME, item.ROLE_ID.ToString())); } if (ViewState["userId"] != null) { var cmd = new UserService(); _item = cmd.Select(Convert.ToInt32(ViewState["userId"].ToString())); if (_item != null) { popTxtUsername.Text = _item.USER_NAME; popTxtPassword.TextMode = TextBoxMode.SingleLine; popTxtPassword.Text = "*************"; popTxtPassword.Enabled = false; dllEmp.SelectedValue = _item.EMPLOYEE_ID.ToString(); dllRole.SelectedValue = _item.ROLE_ID.ToString(); flag.Text = "Edit"; } } else { popTxtPassword.TextMode = TextBoxMode.Password; popTxtPassword.Enabled = true; } }