/// <summary> /// This function returns list of Departments for a specific state, city or village and its locality. /// </summary> /// <param name="stateId"></param> /// <param name="cityId"></param> /// <param name="villageId"></param> /// <param name="localityId"></param> /// <param name="departmentTypeId"></param> /// <returns></returns> public static List <Department> GetAllByLocationAndType(int stateId, int cityId, int villageId, int localityId, int departmentTypeId) { String SQL = null; List <Department> list = null; if (villageId != 0) { SQL = String.Format("select * from Departments where StateId='{0}' and CityId='{1}' and VillageId='{2}' and LocalityId='{3}' and DepartmentTypeId='{4}' ", stateId, cityId, villageId, localityId, departmentTypeId); } else { SQL = String.Format("select * from Departments where StateId='{0}' and CityId='{1}' and LocalityId='{2}' and DepartmentTypeId='{3}' ", stateId, cityId, localityId, departmentTypeId); } list = BaseDataAccess.GetRecordsList <Department>(SQL); foreach (Department info in list) { info.State = StateDA.GetDetails(info.StateId); info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } info.Locality = LocalityDA.GetDetails(info.LocalityId); info.DepartmentType = DepartmentTypeDA.GetDetails(info.DepartmentTypeId); } return(list); }
public static List <Village> GetAll() { List <Village> list = BaseDataAccess.GetRecordsList <Village>(String.Format("select * from villages")); foreach (Village info in list) { info.City = CityDA.GetDetails(info.CityId); } return(list); }
public static List <Village> GetAllForCity(int cityId) { List <Village> list = null; list = BaseDataAccess.GetRecordsList <Village>(String.Format("select * from villages where CityId='{0}' ", cityId)); foreach (Village info in list) { info.City = CityDA.GetDetails(info.CityId); } return(list); }
public static Village GetDetails(int id) { Village info = BaseDataAccess.GetRecords <Village>(String.Format("select * from Villages where id='{0}' ", id)); if (info != null) { info.City = CityDA.GetDetails(info.CityId); return(info); } else { return(info); } }
public static List <Department> GetAll() { List <Department> list = null; list = BaseDataAccess.GetRecordsList <Department>(String.Format("select * from Departments ")); foreach (Department info in list) { info.State = StateDA.GetDetails(info.StateId); info.City = CityDA.GetDetails(info.CityId); info.Village = VillageDA.GetDetails(info.VillageId); info.Locality = LocalityDA.GetDetails(info.LocalityId); info.DepartmentType = DepartmentTypeDA.GetDetails(info.DepartmentTypeId); } return(list); }
public static List <Locality> GetAll() { List <Locality> list = null; list = BaseDataAccess.GetRecordsList <Locality>(String.Format("select * from Localities")); foreach (Locality info in list) { info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } } return(list); }
public static DepartmentXAreaIncharge GetDetails(int id) { DepartmentXAreaIncharge info = null; info = BaseDataAccess.GetRecords <DepartmentXAreaIncharge>(String.Format("select * from DepartmentXAreaIncharges where Id='{0}'", id)); info.Department = DepartmentDA.GetDetails(info.DepartmentId); info.State = StateDA.GetDetails(info.StateId); info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } info.Locality = LocalityDA.GetDetails(info.LocalityId); info.GovernmentOfficial = GovernmentOfficialDA.GetDetails(info.InchargeId); return(info); }
public static DepartmentXAreaOnDuty GetByTime(int departmentId, DateTime timeOfDay) { DepartmentXAreaOnDuty info = null; info = BaseDataAccess.GetRecords <DepartmentXAreaOnDuty>(String.Format("select * from DepartmentXAreaOnDuty where DepartmentId='{0}'", departmentId)); if (info != null) { info.State = StateDA.GetDetails(info.StateId); info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } info.Locality = LocalityDA.GetDetails(info.LocalityId); info.Department = DepartmentDA.GetDetails(info.DepartmentId); info.GovermentOfficial = GovernmentOfficialDA.GetDetails(info.OnDutyPersonId); } return(info); }
public static Locality GetDetails(int id) { Locality info = null; info = BaseDataAccess.GetRecords <Locality>(String.Format("select * from Localities where Id='{0}' ", id)); if (info != null) { info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } return(info); } else { return(info); } }
public static List <Complaint> GetAllByAdhar(string Adhar) { List <Complaint> list = null; list = BaseDataAccess.GetRecordsList <Complaint>(String.Format("select * from Complaints where ReportingPersonAdhaarId='{0}' ", Adhar)); foreach (Complaint info in list) { info.State = StateDA.GetDetails(info.StateId); info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } info.Locality = LocalityDA.GetDetails(info.LocalityId); info.DepartmentType = DepartmentTypeDA.GetDetails(info.DepartmentTypeId); info.ComplaintType = ComplaintTypeDA.GetDetails(info.ComplaintTypeId); info.ComplaintStatus = ComplaintStatusDA.GetDetails(info.CurrentStatusId); } return(list); }
public static List <Complaint> GetAllByDateRange(int departmentId) { List <Complaint> list = null; list = BaseDataAccess.GetRecordsList <Complaint>(String.Format("select * from Complaints where departmentId={0}", departmentId)); foreach (Complaint info in list) { info.State = StateDA.GetDetails(info.StateId); info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } info.Locality = LocalityDA.GetDetails(info.LocalityId); info.DepartmentType = DepartmentTypeDA.GetDetails(info.DepartmentTypeId); info.ComplaintType = ComplaintTypeDA.GetDetails(info.ComplaintTypeId); info.ComplaintStatus = ComplaintStatusDA.GetDetails(info.CurrentStatusId); } return(list); }
public static List <DepartmentXAreaOnDuty> GetAll() { List <DepartmentXAreaOnDuty> list = null; list = BaseDataAccess.GetRecordsList <DepartmentXAreaOnDuty>(String.Format("select * from DepartmentXAreaOnDuty ")); foreach (DepartmentXAreaOnDuty info in list) { info.State = StateDA.GetDetails(info.StateId); info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } info.Locality = LocalityDA.GetDetails(info.LocalityId); info.Department = DepartmentDA.GetDetails(info.DepartmentId); info.GovermentOfficial = GovernmentOfficialDA.GetDetails(info.OnDutyPersonId); } return(list); }
public static List <DepartmentXAreaIncharge> GetAllForDepartment(int departmentId) { List <DepartmentXAreaIncharge> list = null; list = BaseDataAccess.GetRecordsList <DepartmentXAreaIncharge>(String.Format("select * from DepartmentXAreaIncharges where departmentId='{0}' ", departmentId)); foreach (DepartmentXAreaIncharge info in list) { info.Department = DepartmentDA.GetDetails(info.DepartmentId); info.State = StateDA.GetDetails(info.StateId); info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } info.Locality = LocalityDA.GetDetails(info.LocalityId); info.GovernmentOfficial = GovernmentOfficialDA.GetDetails(info.InchargeId); } return(list); }
public static Complaint GetDetails(int id) { Complaint info = null; info = BaseDataAccess.GetRecords <Complaint>(String.Format("select * from Complaints where Id='{0}' ", id)); if (info != null) { info.State = StateDA.GetDetails(info.StateId); info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } info.Locality = LocalityDA.GetDetails(info.LocalityId); info.DepartmentType = DepartmentTypeDA.GetDetails(info.DepartmentTypeId); info.ComplaintType = ComplaintTypeDA.GetDetails(info.ComplaintTypeId); info.ComplaintStatus = ComplaintStatusDA.GetDetails(info.CurrentStatusId); info.Department = DepartmentDA.GetDetails(info.DepartmentId); } return(info); }
public static List <DepartmentXAreaOnDuty> GetAllByLocationAndDepartment(int localityId, int departmentId) { List <DepartmentXAreaOnDuty> list = null; list = BaseDataAccess.GetRecordsList <DepartmentXAreaOnDuty>(String.Format("select * from DepartmentXAreaOnDuty where LocalityId='{0}' and DepartmentId='{1}' ", localityId, departmentId)); foreach (DepartmentXAreaOnDuty info in list) { info.DutyTimeFrom = Convert.ToDateTime(info.DutyTimeFrom.ToString("hh:mm:ss")); info.DutyTimeTo = Convert.ToDateTime(info.DutyTimeTo.ToString("hh:mm:ss")); info.State = StateDA.GetDetails(info.StateId); info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } info.Locality = LocalityDA.GetDetails(info.LocalityId); info.Department = DepartmentDA.GetDetails(info.DepartmentId); info.GovermentOfficial = GovernmentOfficialDA.GetDetails(info.OnDutyPersonId); } return(list); }
public static List <Department> GetAllByCity(int cityId) { String SQL = null; List <Department> list = null; SQL = String.Format("select * from Departments where CityId='{0}' ", cityId); list = BaseDataAccess.GetRecordsList <Department>(SQL); foreach (Department info in list) { info.State = StateDA.GetDetails(info.StateId); info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } info.Locality = LocalityDA.GetDetails(info.LocalityId); info.DepartmentType = DepartmentTypeDA.GetDetails(info.DepartmentTypeId); } return(list); }
public static List <Locality> GetDetails(int CityId, int VillageId) { List <Locality> list = null; if (VillageId != 0) { list = BaseDataAccess.GetRecordsList <Locality>(String.Format("select * from Localities where CityId='{0}' and VillageId='{1}' ", CityId, VillageId)); } else { list = BaseDataAccess.GetRecordsList <Locality>(String.Format("select * from Localities where CityId='{0}' and VillageId is NULL ", CityId)); } foreach (Locality info in list) { info.City = CityDA.GetDetails(info.CityId); if (info.VillageId != 0) { info.Village = VillageDA.GetDetails(info.VillageId); } } return(list); }