Beispiel #1
0
        //Get data from DB with predefine LINQ by paramteters from MVC POSTED parameters class
        public void GetJSONbyParams(DWH_REPLICAEntities db, DateTime dateFrom, DateTime dateTo, string dateType, bool checkBox, List <string> selectedList, string entityType)
        {
            DateTime fromDate = dateFrom.Date;
            DateTime toDate   = dateTo.Date;

            try
            {
                paramsSelected = selectedList;
            }
            catch (Exception e)
            {
            }

            FD_ACQ = new List <FD_ACQ_DTO>();

            FIELDS_REF.paramsInit();
            FIELDS_REF.paramsCheck(paramsSelected);

            LINQ_QUERIES.db       = db;
            LINQ_QUERIES.fromDate = dateFrom;
            LINQ_QUERIES.toDate   = dateTo;

            Parameters pm = new Parameters();

            pm.dateFrom          = dateFrom;
            pm.dateTo            = dateTo;
            pm.formatSelcted     = dateType;
            pm.listInclude       = checkBox;
            pm.ParametersPublish = selectedList;

            switch (dateType)
            {
            case "DAY":
                this.FD_ACQ = LINQ_QUERIES.func_d.Invoke(db).ToList();
                break;

            case "MONTH":
                this.FD_ACQ = LINQ_QUERIES.func_m.Invoke(db).ToList();
                break;

            case "YEAR":
                this.FD_ACQ = LINQ_QUERIES.func_y.Invoke(db).ToList();
                break;
            }

            int count = FD_ACQ_GROUP.list_group(pm).Count();

            /*
             * this.FD_ACQ_D = a.ToList();
             * this.FD_ACQ_D = compiledQuery_1.Invoke(db, "9290572320").ToList();
             * this.FD_ACQ_D = compiledQuery_m.Invoke(db).ToList();
             *
             * foreach (var b in a)
             * {
             *  this.FD_ACQ_D.Add(new FD_RES { DT_REG = b.DT_REG, TYPE_TRANSACTION = b.TYPE_TRANSACTION, AMT = b.AMT, PAY_SYS = b.PAY_SYS });
             * }
             */
        }
Beispiel #2
0
        //>>!!! remove - not model methods? all rewrote in Execution class
        //Get data from DB with predefine LINQ by paramteters from JS POSTED parameters
        public void GetJSONbyParams(DWH_REPLICAEntities db, DateTime dateFrom, DateTime dateTo, string dateType, bool checkBox, string selectedList)
        {
            DateTime fromDate = dateFrom.Date;
            DateTime toDate   = dateTo.Date;

            try {
                paramsSelected = JsonConvert.DeserializeObject <List <string> >(selectedList);
            }
            catch (Exception e)
            {
            }
            FD_ACQ = new List <FD_ACQ_DTO>();

            FIELDS_REF.paramsInit();
            FIELDS_REF.paramsCheck(paramsSelected);

            LINQ_QUERIES.db       = db;
            LINQ_QUERIES.fromDate = dateFrom;
            LINQ_QUERIES.toDate   = dateTo;

            switch (dateType)
            {
            case "DAY":
                this.FD_ACQ = LINQ_QUERIES.func_d.Invoke(db).ToList();
                break;

            case "MONTH":
                this.FD_ACQ = LINQ_QUERIES.func_m.Invoke(db).ToList();
                break;

            case "YEAR":
                this.FD_ACQ = LINQ_QUERIES.func_y.Invoke(db).ToList();
                break;
            }

            /*
             * this.FD_ACQ_D = a.ToList();
             * this.FD_ACQ_D = compiledQuery_1.Invoke(db, "9290572320").ToList();
             * this.FD_ACQ_D = compiledQuery_m.Invoke(db).ToList();
             *
             * foreach (var b in a)
             * {
             *  this.FD_ACQ_D.Add(new FD_RES { DT_REG = b.DT_REG, TYPE_TRANSACTION = b.TYPE_TRANSACTION, AMT = b.AMT, PAY_SYS = b.PAY_SYS });
             * }
             */
        }