/// <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 <City> GetAllByState(int stateId)
        {
            List <City> list = null;

            list = BaseDataAccess.GetRecordsList <City>(String.Format("select * from Cities where StateId='{0}' ", stateId));

            foreach (City info in list)
            {
                info.State = StateDA.GetDetails(info.StateId);
            }
            return(list);
        }
        public static City GetDetails(int id)
        {
            City obj = null;

            obj = BaseDataAccess.GetRecords <City>(String.Format("select * from Cities where Id='{0}' ", id));

            if (obj != null)
            {
                obj.State = StateDA.GetDetails(obj.StateId);
                return(obj);
            }
            else
            {
                return(null);
            }
        }
        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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
        }
Exemple #7
0
        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);
        }
Exemple #8
0
        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);
        }
Exemple #9
0
        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);
        }
Exemple #10
0
        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);
        }
Exemple #11
0
        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);
        }
Exemple #12
0
        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);
        }