public static OfficialXComplaintsAssigned GetDetails(int id)
        {
            OfficialXComplaintsAssigned info = null;

            info = BaseDataAccess.GetRecords <OfficialXComplaintsAssigned>(String.Format("select * from OfficialXComplaintsAssigned where Id='{0}'", id));
            info.GovernmentOfficial = GovernmentOfficialDA.GetDetails(info.OfficialId);
            info.Complaint          = ComplaintDA.GetDetails(info.ComplaintId);
            return(info);
        }
Example #2
0
        public static DepartmentEscalationLevel GetDetailsByDepartmentId(int id, int LevelNumber)
        {
            DepartmentEscalationLevel info = null;

            info = BaseDataAccess.GetRecords <DepartmentEscalationLevel>(String.Format("select * from DepartmentEscalationLevels where DepartmentId='{0}' and LevelNumber = '{1}'", id, LevelNumber));
            if (info != null)
            {
                info.Department         = DepartmentDA.GetDetails(info.DepartmentId);
                info.GovernmentOfficial = GovernmentOfficialDA.GetDetails(info.DesignatedOfficialId);
            }
            return(info);
        }
        public static DepartmentXOfficial GetDetails(int id)
        {
            DepartmentXOfficial info = null;

            info = BaseDataAccess.GetRecords <DepartmentXOfficial>(String.Format("select * from DepartmentXOfficials where Id='{0}'", id));
            if (info != null)
            {
                info.Department            = DepartmentDA.GetDetails(info.DepartmentId);
                info.GovernmentOfficial    = GovernmentOfficialDA.GetDetails(info.GovernmentOfficialId);
                info.DepartmentDesignation = DepartmentDesignationDA.GetDetails(info.DesignationId);
            }
            return(info);
        }
Example #4
0
        public static List <DepartmentEscalationLevel> GetAllForDepartment(int departmentId)
        {
            List <DepartmentEscalationLevel> list = new List <DepartmentEscalationLevel>();

            list = BaseDataAccess.GetRecordsList <DepartmentEscalationLevel>(String.Format("select * from DepartmentEscalationLevels where DepartmentId='{0}'", departmentId));

            foreach (DepartmentEscalationLevel info in list)
            {
                info.Department         = DepartmentDA.GetDetails(info.DepartmentId);
                info.GovernmentOfficial = GovernmentOfficialDA.GetDetails(info.DesignatedOfficialId);
            }
            return(list);
        }
        public static List <OfficialXComplaintsAssigned> GetAllByOfficialId(int officialId)
        {
            List <OfficialXComplaintsAssigned> list = null;

            list = BaseDataAccess.GetRecordsList <OfficialXComplaintsAssigned>(string.Format("Select * from OfficialXComplaintsAssigned where OfficialId = '{0}'", officialId));
            foreach (OfficialXComplaintsAssigned info in list)
            {
                info.GovernmentOfficial = GovernmentOfficialDA.GetDetails(info.OfficialId);
                info.Complaint          = ComplaintDA.GetDetails(info.ComplaintId);
            }

            return(list);
        }
        public static List <DepartmentXOfficial> GetAllForOfficial(int officialId)
        {
            List <DepartmentXOfficial> list = null;

            list = BaseDataAccess.GetRecordsList <DepartmentXOfficial>(String.Format("select * from DepartmentXOfficials where GovernmentOfficialId='{0}' ", officialId));

            foreach (DepartmentXOfficial info in list)
            {
                info.Department            = DepartmentDA.GetDetails(info.DepartmentId);
                info.GovernmentOfficial    = GovernmentOfficialDA.GetDetails(info.GovernmentOfficialId);
                info.DepartmentDesignation = DepartmentDesignationDA.GetDetails(info.DesignationId);
            }
            return(list);
        }
        public static List <DepartmentXOfficial> GetAllByUsername(string userName)
        {
            List <DepartmentXOfficial> list = null;

            list = BaseDataAccess.GetRecordsList <DepartmentXOfficial>(String.Format("select * from DepartmentXOfficials where ContactNumber='{0}' ", userName));

            foreach (DepartmentXOfficial info in list)
            {
                info.Department            = DepartmentDA.GetDetails(info.DepartmentId);
                info.GovernmentOfficial    = GovernmentOfficialDA.GetDetails(info.GovernmentOfficialId);
                info.DepartmentDesignation = DepartmentDesignationDA.GetDetails(info.DesignationId);
            }
            return(list);
        }
Example #8
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);
        }
Example #9
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);
        }
Example #10
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);
        }
Example #11
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);
        }
Example #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);
        }
        /// <summary>
        /// THis function is to be edited. Once the Logic is done.
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        public static List <Department> GetAllByUseraname(string username)
        {
            List <Department> listDepartment = new List <Department>();

            GovernmentOfficial info = null;

            info = GovernmentOfficialDA.GetDetailsByContactNumber(username);

            List <DepartmentXOfficial> listoff = new List <DepartmentXOfficial>();

            if (info != null)
            {
                listoff = DepartmentXOfficialsDA.GetAllForOfficial(info.Id);
            }

            foreach (DepartmentXOfficial i in listoff)
            {
                Department dept = null;
                dept = GetDetails(i.DepartmentId);

                listDepartment.Add(dept);
            }
            return(listDepartment);
        }