//if want to get primary staff than pass true and not primary than pass false.but if want all than pass "null" public static void BindStaff(DropDownList ddlStaff, Guid SchoolId, Guid SchoolYearId) { try { DayCareBAL.StaffService proxyStaff = new DayCareBAL.StaffService(); List <DayCarePL.StaffProperties> lstStaff = proxyStaff.LoadStaff(SchoolId, SchoolYearId); if (lstStaff != null && lstStaff.Count > 0) { lstStaff = lstStaff.FindAll(s => s.Active.Equals(true) && !s.StaffCategoryName.Equals(DayCarePL.Common.SCHOOL_ADMINISTRATOR) && !s.UserGroupTitle.Equals(DayCarePL.Common.SCHOOL_ADMINISTRATOR)); ddlStaff.DataSource = lstStaff; ddlStaff.DataTextField = "FullName"; ddlStaff.DataValueField = "Id"; ddlStaff.DataBind(); } ddlStaff.Items.Insert(0, new ListItem("--Select--", DayCarePL.Common.GUID_DEFAULT)); } catch { } }
public void GetStaff(bool Active) { DayCareBAL.StaffService proxyRole = new DayCareBAL.StaffService(); Guid SchoolId = new Guid(); if (Session["SchoolId"] != null) { SchoolId = new Guid(Session["SchoolId"].ToString()); } Guid CurrentSchoolYearId = new Guid(); if (Session["CurrentSchoolYearId"] != null) { CurrentSchoolYearId = new Guid(Session["CurrentSchoolYearId"].ToString()); } List <DayCarePL.StaffProperties> lstStaff = proxyRole.LoadStaff(SchoolId, CurrentSchoolYearId); if (lstStaff != null) { //rgStaffList.DataSource = lstStaff.FindAll(name => !name.StaffCategoryName.Equals(DayCarePL.Common.SCHOOL_ADMINISTRATOR) && !name.UserGroupTitle.Equals(DayCarePL.Common.SCHOOL_ADMINISTRATOR) && name.Active == Active); rgStaffList.DataSource = lstStaff.FindAll(name => !name.StaffCategoryName.Equals(DayCarePL.Common.SCHOOL_ADMINISTRATOR) && !name.UserGroupTitle.Equals(DayCarePL.Common.SCHOOL_ADMINISTRATOR)); } }