Ejemplo n.º 1
0
        public string LoadTransactions(EntranceTableData data)
        {
            if (data.Validation())
            {
                return(string.Format("- validation error -"));
            }

            return(JsonObjectHelper.Json(new StatisticManager().LoadTransactions(data)));
        }
Ejemplo n.º 2
0
        public ActionResult QuickReport(EntranceTableData data)
        {
            if (data.Validation())
            {
                return(Content(string.Format("<b class=\"message_error\">Internal error. '{0}'</b>", data.ErrorMessage)));
            }

            //StatisticManager manager = new StatisticManager();
            //QuickReportModel model = new QuickReportModel(manager.LoadQuickReports(data));
            return(View("~/Views/Statistic/QuickReport.cshtml", new QuickReportModel(null)));
        }
Ejemplo n.º 3
0
        // SUMMARY: Get .csv from for specific entrance table data
        public FileContentResult Csv(EntranceTableData data)
        {
            if (data.Validation())
            {
                return(null);
            }

            EntranceTableManager entranceTableManager = new EntranceTableManager();

            entranceTableManager.Query(data);
            return(File(new System.Text.UTF8Encoding().GetBytes(entranceTableManager.ConvertToCvs()), "text/csv", "database.csv"));
        }
Ejemplo n.º 4
0
        public ActionResult LoadNewSubsequental(EntranceTableData data)
        {
            if (data.Validation())
            {
                return(Content(string.Format("<b class=\"message_error\">Internal error. '{0}'</b>", data.ErrorMessage)));
            }

            EntranceTableManager entranceTableManager = new EntranceTableManager();
            DataTableModel       model = new DataTableModel(entranceTableManager);

            return(View("~/Views/Database/_DataNewSequential.cshtml", model));
        }
Ejemplo n.º 5
0
        public ActionResult Cashflow(EntranceTableData data)
        {
            if (data.Validation())
            {
                return(Content(string.Format("<b class=\"message_error\">Internal error. '{0}'</b>", data.ErrorMessage)));
            }

            CashflowLogManager     manager = new CashflowLogManager();
            CashflowStatisticModel model   = new CashflowStatisticModel(manager.Query(data, true));

            return(View("~/Views/Statistic/CashflowReport.cshtml", model));
        }
Ejemplo n.º 6
0
        // SUMMARY: Load entrance table data
        public ActionResult Load(EntranceTableData data)
        {
            if (data.Validation())
            {
                return(Content(string.Format("<b class=\"message_error\">Internal error. '{0}'</b>", data.ErrorMessage)));
            }

            EntranceTableManager entranceTableManager = new EntranceTableManager();

            entranceTableManager.Query(data);

            return(View("~/Views/Database/_Data.cshtml", new DataTableModel(entranceTableManager)));
        }
Ejemplo n.º 7
0
        public ActionResult Timeline(EntranceTableData data)
        {
            if (data.Validation())
            {
                return(Content(string.Format("<b class=\"message_error\">Internal error. '{0}'</b>", data.ErrorMessage)));
            }

            StatisticManager manager = new StatisticManager();
            TimelineModel    model   = new TimelineModel();

            model.Data = manager.LoadTimeline(data);

            return(View("~/Views/Statistic/Timeline.cshtml", model));
        }
Ejemplo n.º 8
0
        public ActionResult GetData()
        {
            AndroidInputModel inputModel = new AndroidInputModel(this.Request);
            EntranceTableData inputData  = inputModel.ToEntranceTableData();

            if (inputData.Validation())
            {
                return(this.Json(new { status = false }, JsonRequestBehavior.AllowGet));
            }

            EntranceTableManager        entranceTableManager = new EntranceTableManager();
            List <EntranceTableAndroid> result = entranceTableManager.QueryNewAndroid(inputData);

            return(this.Json(result, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 9
0
        public ActionResult LoadNew(EntranceTableData data)
        {
            if (data.UseSequentialSearch)
            {
                return(this.LoadNewSubsequental(data));
            }

            if (data.Validation())
            {
                return(Content(string.Format("<b class=\"message_error\">Internal error. '{0}'</b>", data.ErrorMessage)));
            }

            EntranceTableManager entranceTableManager = new EntranceTableManager();

            DataTableModel model = new DataTableModel(entranceTableManager,
                                                      (!data.AndroidClientSession.HasValue ?
                                                       entranceTableManager.QueryNew(data) :
                                                       entranceTableManager.QueryNewAndroidSession(data)));

            return(View(string.Format("~/Views/Database/{0}.cshtml", data.ReturnView), model));
        }