/// <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);
        }
Exemple #2
0
        public static List <ComplaintType> GetAllForDepartment(int departmentTypeId)
        {
            List <ComplaintType> list = BaseDataAccess.GetRecordsList <ComplaintType>(String.Format("select * from ComplaintTypes where DepartmentTypeId='{0}' ", departmentTypeId));

            foreach (ComplaintType info in list)
            {
                info.DepartmentType = DepartmentTypeDA.GetDetails(info.DepartmentTypeId);
            }
            return(list);
        }
        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 #4
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 #5
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 #6
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);
        }
        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);
        }