protected void InitializeModalDropDownDepartment(string value = "") { Department department = new Department(); var departmentList = department.GetDepartmentList(); if (departmentList.Count > 0) { if (departmentList[0].Description == "All") departmentList.RemoveAt(0); } modalDropDownDepartment.DataSource = departmentList; modalDropDownDepartment.DataTextField = "Description"; modalDropDownDepartment.DataValueField = "Id"; modalDropDownDepartment.DataBind(); if (value != null && value.Trim() != "") { foreach (ListItem i in modalDropDownDepartment.Items) { if (value.Trim() == i.Value.ToString().Trim()) { i.Selected = true; break; } } } }
public List<JobType> GetAvailableJobTypeForJobFlow() { TimeTrackerEntities db = new TimeTrackerEntities(); Department dept = new Department(); var deptlist = dept.GetDepartmentList(); int deptCount = deptlist.Count; var data = (from j in db.T_JobType where j.M_JobTypeFlows.Count < deptCount orderby j.Position select new JobType() { Id = j.Id, Description = j.Description, CreatedBy = j.CreatedBy, LastUpdatedBy = j.LastUpdatedBy, CreateDate = j.CreateDate, LastUpdateDate = j.LastUpdateDate, RequiredJobId = j.RequiredJobId, ComputeTime = j.ComputeTime, Position = j.Position, ShowInJobOverview = j.ShowInJobOverview, Acronym = j.Acronym, IsDefaultBreak = j.IsDefaultBreak }).ToList(); db.Dispose(); return data; }
protected void InitializeDropDownDepartment() { Department department = new Department(); var departmentList = department.GetDepartmentList(); if (departmentList.Count > 1) { department.Description = "All"; department.Id = 0; departmentList.Insert(0, department); } dropDownListDepartment.DataSource = departmentList; dropDownListDepartment.DataTextField = "Description"; dropDownListDepartment.DataValueField = "Id"; dropDownListDepartment.DataBind(); }
protected void InitializeGridViewDepartment() { GetMyAccessRights(); if (myAccessRights.CanAdd == true) linkBtnAdd.Visible = true; else linkBtnAdd.Visible = false; Department department = new Department(); List<Department> deptlist = new List<Department>(); deptlist = department.GetDepartmentList(); if (deptlist.Count > 0) { if (deptlist[0].Description == "All") deptlist.RemoveAt(0); } gridViewDepartment.DataSource = deptlist; gridViewDepartment.DataBind(); }
private void InitializeModalGridViewDepartment(int jobtypeid = 0) { Department department = new Department(); var departmentList = department.GetDepartmentList(); modalGridViewDepartment.DataSource = departmentList; modalGridViewDepartment.DataBind(); if (jobtypeid > 0) { InitializeModalDepartmentCheckBox(jobtypeid); if (modalGridViewDepartment.Rows.Count > 1) modalChkboxAll.Visible = true; else modalChkboxAll.Visible = false; } }
private void InitializeModalDepartment() { modalBtnAdd.Visible = true; Department department = new Department(); List<Department> deptlist = new List<Department>(); int selectedjobTypeId = Convert.ToInt32(modalDropDownJobType.SelectedValue); deptlist = department.GetDepartmentList(); if (deptlist.Count > 0) { department.Id = 0; department.Description = "All"; department.Position = 0; department.Acronym = "All"; deptlist.Insert(0, department); } for (int i = 0; i < gridViewModal.Rows.Count; i++) { Label labelJobTypeId = (Label)gridViewModal.Rows[i].FindControl("modalLabelJobTypeId"); Label labelDeptId = (Label)gridViewModal.Rows[i].FindControl("modalLabelDepartmentId"); int deptId = labelDeptId.Text.Trim() == "" ? 0 : Convert.ToInt32(labelDeptId.Text); int jobtypeId = labelJobTypeId.Text.Trim() == "" ? 0 : Convert.ToInt32(labelJobTypeId.Text); for (int j = 0; j < deptlist.Count; j++) { if (deptlist[j].Id == deptId && selectedjobTypeId == jobtypeId) { deptlist.RemoveAt(j); break; } } } if (deptlist.Count == 0) { modalBtnAdd.Visible = false; } modalDropDownDepartment.DataSource = deptlist; modalDropDownDepartment.DataTextField = "Description"; modalDropDownDepartment.DataValueField = "Id"; modalDropDownDepartment.DataBind(); }
protected void InitializeModalDropDownDepartment(string departmentId = "") { Department department = new Department(); var departmentList = department.GetDepartmentList(); modalDropDownDepartment.DataSource = departmentList; modalDropDownDepartment.DataTextField = "Description"; modalDropDownDepartment.DataValueField = "Id"; modalDropDownDepartment.DataBind(); if (departmentId != null && departmentId.Trim() != "") { foreach (ListItem i in modalDropDownDepartment.Items) { if (departmentId.Trim() == i.Value.Trim()) { i.Selected = true; break; } } } }
private void InitializeModalGridViewDepartment(int roleid = 0) { Department department = new Department(); var departmentList = department.GetDepartmentList(); modalGridViewDepartment.DataSource = departmentList; modalGridViewDepartment.DataBind(); if (roleid > 0) { InitializeModalDepartmentCheckBox(roleid); if (modalGridViewDepartment.Rows.Count > 1) modalChkboxAll.Visible = true; else modalChkboxAll.Visible = false; } else { for (int i = 0; i < modalGridViewDepartment.Rows.Count; i++) { CheckBox cb = (CheckBox)modalGridViewDepartment.Rows[i].FindControl("modalChkBoxSelect"); cb.Checked = false; } } }