protected IList <ChildPlacements> GetChildPlacements(IGenericRepository2nd rpGeneric2nd)
        {
            List <ChildPlacements> listResult          = new List <ChildPlacements>();
            List <ChildPlacements> listchildplacements = rpGeneric2nd.FindAll <ChildPlacements>().ToList();

            return(listchildplacements);
        }
        protected List <SummaryDHdata> GetSummaryData(IGenericRepository2nd rpGeneric2nd, string seedcode)
        {
            List <SummaryDHdata> listResult = new List <SummaryDHdata>();
            List <DataSetDate>   dataset    = GetListDataSetDate().ToList();
            var listtemp = rpGeneric2nd.FindByNativeSQL("select * from datahub_summary where TRIM(SeedCode) like '" + seedcode + "'");

            foreach (var itemrow in listtemp)
            {
                SummaryDHdata temp = new SummaryDHdata();
                if (itemrow != null)
                {
                    temp.year     = Convert.ToInt16(itemrow[0].ToString());
                    temp.month    = Convert.ToInt16(itemrow[1].ToString());
                    temp.seedcode = itemrow[2].ToString();
                    temp.listdata = new List <GenericData>();
                    temp.listdata.Add(new GenericData("Participating Destination", NumberFormatHelper.ConvertObjectToFloat(itemrow[4])));
                    temp.listdata.Add(new GenericData("Non-Participating Destination", NumberFormatHelper.ConvertObjectToFloat(itemrow[5])));
                    temp.listdata.Add(new GenericData("Unknown Destination", NumberFormatHelper.ConvertObjectToFloat(itemrow[6])));
                    temp.sdataset = dataset.Where(x => x.month.Equals(temp.month.ToString()) && x.year.Equals(temp.year.ToString())).FirstOrDefault();
                    listResult.Add(temp);
                }
            }

            return(listResult.OrderBy(x => x.year).ThenBy(x => x.month).ToList());
        }
        protected IList <ChildAgreements> GetChildAgreement(IGenericRepository2nd rpGeneric2nd)
        {
            List <ChildAgreements> listResult = new List <ChildAgreements>();
//            List<ChildAgreements> listChildAgreements = rpGeneric2nd.FindAll<ChildAgreements>().ToList();
            List <ChildAgreements> listChildAgreements = rpGeneric2nd.Find <ChildAgreements>(" from ChildAgreements where authorisation_status = :author_status ", new string[] { "author_status" }, new object[] { 1 }).ToList();

            double numberofdays = 0.0;

            foreach (var item in listChildAgreements)
            {
                //calculate number of days - (EndDate - StartDate).TotalDays
                if (item.agreement_ended.Equals(DateTime.MinValue))
                {
                    item.agreement_ended = DateTime.Today;
                    item.payattension    = "**";
                }
                else
                {
                    item.payattension = "";
                }
                numberofdays = (item.agreement_ended - item.agreement_started).TotalDays;

                item.numberofdays = Convert.ToInt32(numberofdays);
                item.actual_cost  = (item.active_weeks_cost / 7) * numberofdays;
                listResult.Add(item);
            }
            return(listResult);
        }
 public IndexSchoolProfilesController(IGenericRepository2nd rpGeneric2nd)
 {
     this.rpGeneric2nd = rpGeneric2nd; //connect to accdatastore database in MySQL
     this.vmIndexPrimarySchoolProfilesModel   = new IndexPrimarySchoolProfilesViewModel();
     this.vmIndexSecondarySchoolProfilesModel = new IndexSecondarySchoolProfilesViewModel();
     this.vmIndexSpecialSchoolProfilesModel   = new IndexSecondarySchoolProfilesViewModel();
 }
        protected IList <ChildPlacements> GetListChildId(IGenericRepository2nd rpGeneric2nd)
        {
            List <ChildPlacements> listResult  = new List <ChildPlacements>();
            List <ChildPlacements> listchildID = rpGeneric2nd.FindAll <ChildPlacements>().ToList();
            var TempList = listchildID.GroupBy(x => x.client_id).Select(y => y.First());

            foreach (var item in TempList)
            {
                listResult.Add(item);
            }
            return(listResult);
        }
        protected List <PupilsDataHubObj> Getlistpupil(IGenericRepository2nd rpGeneric2nd, string sYear)
        {
            //List<PupilsDataHubObj> listdata = rpGeneric2nd.FindAll<PupilsDataHubObj>().Where(x => x.Data_Date.Equals(sYear)).ToList<PupilsDataHubObj>();
            List <PupilsDataHubObj> listdata = GetdatafromDB(rpGeneric2nd, sYear);

            //List<PupilsDataHubObj> pupilsmoveoutScotland = listdata.Where(x => x.Current_Status.ToLower().Equals("moved outwith scotland")).ToList();

            List <PupilsDataHubObj> pupilsAge15 = listdata.Where(x => x.Age == 15).ToList();

            List <PupilsDataHubObj> listResult = listdata.Except(pupilsAge15).ToList();


            return(listResult);
        }
        protected List <PupilsDataHubObj> GetDatahubdatabyNeighbourhoods(IGenericRepository2nd rpGeneric2nd, string neighbourhood_RefNO, string sYear)
        {
            //var listpupilsdata = this.rpGeneric.FindAll<ACCDataStore.Entity.DatahubProfile.DatahubDataObj>();
            List <PupilsDataHubObj> listpupilsdata = Getlistpupil(rpGeneric2nd, sYear);

            var listneighbourhooddata = rpGeneric2nd.FindAll <ACCDataStore.Entity.DatahubProfile.NeighbourhoodObj>();
            var listdata = new List <PupilsDataHubObj>();

            if (neighbourhood_RefNO != null)
            {
                listdata = (from a in listpupilsdata join b in listneighbourhooddata on a.CSS_Postcode equals b.CSS_Postcode where b.Ref_No.Contains(neighbourhood_RefNO) select a).ToList();
            }
            return(listdata);
        }
        protected IList <DatahubCentre> GetListNeighbourhoodsname(IGenericRepository2nd rpGeneric2nd)
        {
            List <DatahubCentre> temp = new List <DatahubCentre>();
            var listneighbourhoods    = rpGeneric2nd.FindByNativeSQL("Select distinct Ref_No, Neighbourhood from Neighbourhood_Postcodes1");

            if (listneighbourhoods != null)
            {
                foreach (var item in listneighbourhoods)
                {
                    if (item != null)
                    {
                        temp.Add(new DatahubCentre(item[0].ToString(), item[1].ToString(), "2"));
                    }
                }
            }
            return(temp.OrderBy(x => x.name).ToList());
        }
        //Get SchoolRoll data
        private new SPSchoolRollForecast GetSchoolRollForecastData(IGenericRepository2nd rpGeneric2nd, School school)
        {
            SPSchoolRollForecast     SchoolRollForecast   = new SPSchoolRollForecast();
            List <GenericSchoolData> tempdataActualnumber = new List <GenericSchoolData>();

            //get actual number
            var listResult = rpGeneric2nd.FindByNativeSQL("Select * from summary_schoolroll where seedcode = " + school.seedcode);

            if (listResult != null)
            {
                foreach (var itemRow in listResult)
                {
                    if (itemRow != null)
                    {
                        tempdataActualnumber.Add(new GenericSchoolData(new Year(itemRow[0].ToString()).academicyear, NumberFormatHelper.ConvertObjectToFloat(itemRow[4])));
                    }
                }
            }

            SchoolRollForecast.ListActualSchoolRoll = tempdataActualnumber;

            return(SchoolRollForecast);
        }
        protected IList <ChildPlacements> GetChildPlacementByClientID(IGenericRepository2nd rpGeneric2nd, string ClientID)
        {
            List <ChildPlacements> listResult         = new List <ChildPlacements>();
            List <ChildPlacements> listChildPlacement = rpGeneric2nd.FindAll <ChildPlacements>().ToList();
            //List<Placements> listPlacements = rpGeneric2nd.FindAll<Placements>().ToList();
            var TempList = listChildPlacement.Where(x => x.client_id.Equals(ClientID)).ToList();

            //var TempList = TempListALL.GroupBy(i => i.placement_id).Select(group => group.First()).ToList(); //Get data y unique agreement_id

            foreach (var item in TempList)
            {
                if (item.placement_ended.Equals(DateTime.MinValue))
                {
                    item.placement_ended = DateTime.Today;
                    item.payattension    = "**";
                }
                else
                {
                    item.payattension = "";
                }
                listResult.Add(item);
            }
            return(listResult);
        }
 public SpecialSchoolProfileController(IGenericRepository2nd rpGeneric2nd)
 {
     this.rpGeneric2nd = rpGeneric2nd;
 }
Esempio n. 12
0
 public MapController(IGenericRepository2nd rpGeneric2nd)
 {
     this.rpGeneric2nd = rpGeneric2nd;
 }
Esempio n. 13
0
 public IndexAberdeenProfileController(IGenericRepository2nd rpGeneric2nd)
 {
     this.rpGeneric2nd = rpGeneric2nd; //connect to accdatastore database in MySQL
     this.vmIndexAberdeenCityProfilesModel = new IndexAberdeenProfileViewModel();
 }
Esempio n. 14
0
 public CityWideCSSFController(IGenericRepository2nd rpGeneric2nd)
 {
     this.rpGeneric2nd = rpGeneric2nd;
 }
        protected virtual List <PupilsDataHubObj> GetdatafromDB(IGenericRepository2nd rpGeneric2nd, string datasetDate)
        {
            List <PupilsDataHubObj> listResult = new List <PupilsDataHubObj>();
            string query = "";

            switch (datasetDate)
            {
            case "102016":
                query = "Select Cohort, Forename, Surname, Age, Gender, CSS_Address, CSS_Postcode, Telephone_Number, SEED_Code, Current_Status, status_code, SDS_Client_Ref  from datahub_octorber";
                break;

            case "112016":
                query = "Select Cohort, Forename, Surname, Age, Gender, CSS_Address, CSS_Postcode, Telephone_Number, SEED_Code, Current_Status, status_code, SDS_Client_Ref  from datahub_november where data_date = 112016";
                break;

            case "122016":
                query = "Select Cohort, Forename, Surname, Age, Gender, CSS_Address, CSS_Postcode, Telephone_Number, SEED_Code, Current_Status, status_code, SDS_Client_Ref  from datahub_december";
                break;

            case "12017":
                query = "Select Cohort, Forename, Surname, Age, Gender, CSS_Address, CSS_Postcode, Telephone_Number, SEED_Code, Current_Status, status_code, SDS_Client_Ref  from datahub_january where data_date = 12017";
                break;

            case "12018":
                query = "Select Cohort, Forename, Surname, Age, Gender, CSS_Address, CSS_Postcode, Telephone_Number, SEED_Code, Current_Status, status_code, SDS_Client_Ref  from datahub_january where data_date = 12018";
                break;

            case "22017":
                //to calculate IEP CSP
                query = "Select Cohort, Forename, Surname, Age, Gender, CSS_Address, CSS_Postcode, Telephone_Number, SEED_Code, Current_Status, status_code, SDS_Client_Ref  from datahub_february";
                break;

            case "22018":
                //to calculate IEP CSP
                query = "Select Cohort, Forename, Surname, Age, Gender, CSS_Address, CSS_Postcode, Telephone_Number, SEED_Code, Current_Status, status_code, SDS_Client_Ref  from datahub_february where data_date = 22018";
                break;

            case "32018":
                //to calculate IEP CSP
                query = "Select Cohort, Forename, Surname, Age, Gender, CSS_Address, CSS_Postcode, Telephone_Number, SEED_Code, Current_Status, status_code, SDS_Client_Ref  from datahub_march where data_date = 32018";
                break;

            case "42018":
                //to calculate IEP CSP
                query = "Select Cohort, Forename, Surname, Age, Gender, CSS_Address, CSS_Postcode, Telephone_Number, SEED_Code, Current_Status, status_code, SDS_Client_Ref  from datahub_april where data_date = 42018";
                break;

            case "5":
                //to calculate IEP CSP
                query = "Select * from datahub_may";
                break;

            case "6":
                //to calculate IEP CSP
                query = "Select * from datahub_june";
                break;

            case "7":
                //to calculate IEP CSP
                query = "Select * from datahub_july";
                break;

            case "8":
                //to calculate IEP CSP
                query = "Select * from datahub_august";
                break;

            case "9":
                //to calculate IEP CSP
                query = "Select Cohort, Forename, Surname, Age, Gender, CSS_Address, CSS_Postcode, Telephone_Number, SEED_Code, Current_Status, status_code, SDS_Client_Ref   from datahub_september";
                break;

            case "112017":
                query = "Select Cohort, Forename, Surname, Age, Gender, CSS_Address, CSS_Postcode, Telephone_Number, SEED_Code, Current_Status, status_code, SDS_Client_Ref  from datahub_november where data_date = 112017 ";
                break;

            case "122017":
                query = "Select Cohort, Forename, Surname, Age, Gender, CSS_Address, CSS_Postcode, Telephone_Number, SEED_Code, Current_Status, status_code, SDS_Client_Ref  from datahub_december where data_date = 122017 ";
                break;
            }

            var listtemp = rpGeneric2nd.FindByNativeSQL(query);

            foreach (var itemrow in listtemp)
            {
                if (itemrow != null)
                {
                    PupilsDataHubObj temp = new PupilsDataHubObj();
                    temp.Cohort           = itemrow[0] == null? "n/a" : itemrow[0].ToString();
                    temp.Forename         = itemrow[1] == null ? "n/a" : itemrow[1].ToString();
                    temp.Surname          = itemrow[2] == null ? "n/a" : itemrow[2].ToString();
                    temp.Age              = itemrow[3] == null ? 0 : Convert.ToInt16(itemrow[3].ToString());
                    temp.Gender           = itemrow[4] == null ? "n/a": itemrow[4].ToString();
                    temp.CSS_Address      = itemrow[5] == null ? "n/a" : itemrow[5].ToString();
                    temp.CSS_Postcode     = itemrow[6] == null ? "n/a" : itemrow[6].ToString();
                    temp.Telephone_Number = itemrow[7] == null ? "n/a" : itemrow[7].ToString();
                    temp.SEED_Code        = itemrow[8] == null ? "n/a" : itemrow[8].ToString();
                    temp.Current_Status   = itemrow[9] == null ? "n/a" : itemrow[9].ToString();
                    temp.status_code      = itemrow[10] == null ? "n/a" : itemrow[10].ToString();
                    temp.SDS_Client_Ref   = itemrow[11] == null ? "n/a" : itemrow[11].ToString();
                    listResult.Add(temp);
                }
            }


            return(listResult);
        }
Esempio n. 16
0
 /// <summary>
 /// Class instantiator
 /// </summary>
 /// <param name="repository">NHibernate repository object used to query the database</param>
 public CouncilHelper(IGenericRepository2nd repository)
 {
     this.repository = repository;
 }
 public IndexCSSFController(IGenericRepository2nd rpGeneric2nd)
 {
     this.rpGeneric2nd = rpGeneric2nd;
 }
Esempio n. 18
0
 public SummaryDataHelper(IGenericRepository2nd rpGeneric2nd)
 {
     this.rpGeneric2nd = rpGeneric2nd;
 }
 public IndexAuthorisationController(IGenericRepository2nd rpGeneric2nd)
 {
     this.rpGeneric2nd = rpGeneric2nd;
 }
Esempio n. 20
0
 public CityProfileController(IGenericRepository2nd rpGeneric2nd)
     : base(rpGeneric2nd)
 {
     this.rpGeneric2nd = rpGeneric2nd;
 }
 public AdminPanelController(IGenericRepository2nd rpGeneric2nd)
 {
     this.rpGeneric2nd = rpGeneric2nd;
 }
Esempio n. 22
0
 public DataHubController(IGenericRepository2nd rpGeneric2nd)
 {
     this.rpGeneric2nd = rpGeneric2nd;
 }