Пример #1
0
        public List <ContinuousBlowingMachineReportModel> GenerateContinuousBlowingMachineReport(DateTime selectedFromDate, DateTime selectedToDate)
        {
            var data = dbConnection.GetDataFromDB(GenerateContinuousBlowingMachineQuery(selectedFromDate, selectedToDate));

            var model = GenerateModelLogic <ContinuousBlowingMachineReportModel> .GenerateReportModel(data,
                                                                                                      ModelDictionaries.ContinuousBlowingMachineDbColumnNameToModelPropertyNameDictionary);

            return(model);
        }
Пример #2
0
        public List <FormDateReportDBModel> GenerateFormReportModel(DateTime selectedFromDate, DateTime selectedToDate)
        {
            var query = string.Format(
                "SELECT * FROM public.forma_blok2 where data_czas > '{0}' and data_czas < '{1}'",
                selectedFromDate, selectedToDate);
            var data = dbConnection.GetDataFromDB(query);
            var dateReportDbModelList = GenerateModelLogic <FormDateReportDBModel> .GenerateReportModel(data, ModelDictionaries.FormDetailedReportDbModelPropertyNameDictionary);

            return(dateReportDbModelList);
        }
Пример #3
0
        public async Task <List <ContinuousBlowingMachineReportModel> > GetContinuousBlowingMachineData(DateTime endDate, int chamber, int pz)
        {
            var query = string.Format(
                "SELECT * FROM public.spieniarka_ciagla_probki where komora = '{0}' and numer_pz = '{1}' and data_czas < '{2}'" +
                "and data_czas > '{3}' order by data_czas limit 10",
                chamber,
                pz,
                new DateTime(endDate.Year, endDate.Month, endDate.Day, endDate.Hour, endDate.Minute, endDate.Second),
                new DateTime(endDate.Year, endDate.Month, endDate.Day, endDate.Hour, endDate.Minute, endDate.Second).AddMonths(-1));

            var data = dbConnection.GetDataFromDB(query);

            return(GenerateModelLogic <ContinuousBlowingMachineReportModel> .GenerateReportModel(data, ModelDictionaries.ContinuousBlowingMachineDbColumnNameToModelPropertyNameDictionary));
        }
Пример #4
0
        public async Task <List <BlowingMachineReportModel> > GetBlowingMachineData(DateTime endDate, int chamber, int pz)
        {
            var query = string.Format(
                "SELECT * FROM public.spieniarka_probki_summary where silos_0 = '{0}' and nr_lot = '{1}' and data_koniec < '{2}' " +
                "and data_koniec > '{3}' order by data_koniec desc limit 1",
                chamber,
                pz,
                new DateTime(endDate.Year, endDate.Month, endDate.Day, endDate.Hour, endDate.Minute, endDate.Second),
                new DateTime(endDate.Year, endDate.Month, endDate.Day, endDate.Hour, endDate.Minute, endDate.Second).AddMonths(-1));

            var data = dbConnection.GetDataFromDB(query);

            return(GenerateModelLogic <BlowingMachineReportModel> .GenerateReportModel(data, ModelDictionaries.BlowingMachineDbColumnNameToModelPropertyNameDictionary));
        }