Ejemplo n.º 1
0
        //[ValidateAntiForgeryToken]
        public ActionResult GetTransactionsServerSide()
        {
            //Server Side Parameter
            CultureInfo culture        = new CultureInfo("en-US");
            int         start          = Convert.ToInt32(Request["start"], culture);
            int         length         = Convert.ToInt32(Request["length"], culture);
            string      searchValue    = Request["search[value]"];
            string      sortColumnName = Request["columns[" + Request["order[0][column]"] + "][name]"];
            string      sortDirection  = Request["order[0][dir]"];

            int totalCount = 0;

            int totalrowsafterfiltering = 0;

            List <TellerTransaction> tellerTransactionsDev = null;

            var    ipAddress  = UserFunctions.GetIPAddress();
            string sourceId   = Session["SourceID"].ToString();
            string sourceName = Session["SourceName"].ToString();
            string branch     = Session["Branch"].ToString();

            string requestBody = string.Empty;

            DateTime?startDate = null;

            DateTime?endDate = null;

            int logID = UserFunctions.InsertLog(ipAddress, "GetTransactionsServerSide", sourceId, sourceName, sourceId);

            if (UserFunctions.GetTellerTransactions(logID, sourceId, branch, startDate, endDate, out List <TellerTransaction> tellerTransactions, out decimal totalTransactionValue, out int totalTransactionVolume))
            {
                UserFunctions.TellerTransaction(0, tellerTransactions, searchValue, sortColumnName, sortDirection, start, length, out totalCount, out totalrowsafterfiltering, out tellerTransactionsDev);

                tellerTransactionsDev.ForEach(x => x.PrintAction = "<a class='fa fa-print' href='" + this.Url.Action("GenerateReceipt", "Home", new { x.Id }) + "' target = '_blank'>Print Receipt</a>");

                var response = new { data = tellerTransactionsDev, draw = Request["draw"], recordsTotal = totalCount, recordsFiltered = totalrowsafterfiltering };

                UserFunctions.UpdateLogs(logID, StaticVariables.SUCCESSSTATUS, JsonConvert.SerializeObject(response));

                ViewBag.TotalTransactionValue = totalTransactionValue;

                ViewBag.TotalTransactionVolume = totalTransactionVolume;

                return(Json(response, JsonRequestBehavior.AllowGet));
            }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            var ipAddress = UserFunctions.GetIPAddress();

            string sourceId   = Session["SourceID"].ToString();
            string sourceName = Session["SourceName"].ToString();
            string branch     = Session["Branch"].ToString();

            string requestBody = string.Empty;

            DateTime?startDate = null;

            DateTime?endDate = null;

            int logID = UserFunctions.InsertLog(ipAddress, "Home/Index", sourceId, sourceName, requestBody);

            UserFunctions.GetTellerTransactions(logID, sourceId, branch, startDate, endDate, out List <TellerTransaction> tellerTransactions, out decimal totalTransactionValue, out int totalTransactionVolume);

            ViewBag.TotalTransactionValue = totalTransactionValue;

            ViewBag.TotalTransactionVolume = totalTransactionVolume;

            UserFunctions.UpdateLogs(logID, StaticVariables.FAILSTATUS, JsonConvert.SerializeObject(tellerTransactions));

            ExportRequest exportRequest = new ExportRequest
            {
                StartDate = DateTime.Now.Date.ToString("dd/MM/yyy"),
                EndDate   = DateTime.Now.Date.AddDays(1).ToString("dd/MM/yyy")
            };

            ViewBag.fromDate = exportRequest.StartDate;

            ViewBag.toDate = exportRequest.EndDate;

            return(View(exportRequest));
        }