Exemple #1
0
        public Parameters()
        {
            dateFrom          = DateTime.Now;
            dateTo            = DateTime.Now;
            dateFormatPublish = new List <string> {
                "DAY", "MONTH", "YEAR"
            };                                                               //{ "d.m.y", "dd.mm.yy", "dd/mm/yy", "M-yy" };
            entityPublish = new List <string> {
                "ACQ", "MT", "ECOMM"
            };
            PropertyRepo.propertyInitilize(typeof(FD_ACQ_D));
            entitySelected    = typeof(FD_ACQ_D).ToString();
            ParametersPublish = (from s in PropertyRepo.properyList select s.propertyName).ToList(); //new List<string> { "MERCHANT", "PAY_SYS", "TYPE_TRANSACTION", "DT_REG", "ALL", "none" };
            listCount         = QueriesToDbSet.GetList();

            selectedDateFormat = from s in dateFormatPublish select new SelectListItem {
                Text = s.ToString()
            };
            selectedParameters = from s in ParametersPublish select new SelectListItem {
                Text = s.ToString()
            };
            selectedEntity = from s in entityPublish select new SelectListItem {
                Text = s.ToString()
            };
        }
Exemple #2
0
        //Quering agains DB according to user input
        //>>??? Find GP realization of different queries in model  according to user select in view
        private IQueryable <IDates> ConditionalQuering(DWH_REPLICAEntities db, Parameters pm)
        {
            IQueryable <IDates> result = null;

            switch (pm.entitySelected)
            {
            case "ACQ":
                result = QueriesToDbSet.GetByDate(db.FD_ACQ_D, pm.dateFrom, pm.dateTo);
                break;

            case "ECOMM":
                result = QueriesToDbSet.GetByDate(db.FD_ACQ_M, pm.dateFrom, pm.dateTo);
                break;

            case "MT":

                break;
            }

            if (pm.listInclude)
            {
                result = QueriesToDbSet.GetByMerchants(result);
            }

            return(result);
        }
Exemple #3
0
        public void excelExportTest()
        {
            DWH_REPLICAEntities db          = new DWH_REPLICAEntities();
            MainModel           model       = new MainModel();
            Parameters          parameters_ = new Parameters();
            Execution           execution   = new Execution();

            parameters_.entitySelected = "ACQ";

            execution.parameters = parameters_;

            model.entity = QueriesToDbSet.GetByDate(db.FD_ACQ_D, new DateTime(2016, 09, 01, 00, 00, 00), new DateTime(2016, 09, 03, 00, 00, 00));
            string     codeBase = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
            UriBuilder uri      = new UriBuilder(codeBase);
            string     path     = Directory.GetParent(Directory.GetParent(uri.Path).ToString()).ToString();

            path = path + "\\App_Data\\report.xlsx";
            ExcelPackage e = new ExcelPackage(new FileInfo(path));

            execution.ExcelExport(path, model);
        }