Пример #1
0
        public ActionResult ProductBack(string submitButton, TrProductBackViewModel vmodel)
        {
            try
            {
                TrPaymentMenuViewModel vm = new TrPaymentMenuViewModel
                {
                    NumTransaction = vmodel.NumTransaction,
                    DateT          = vmodel.DateT,
                    GlobalTotal    = "0"
                };
                switch (submitButton.ToLower())
                {
                case "end":
                    return(EndTransac(vm));

                case "cancel":
                    return(CancelTransac(vm));

                default:
                    vmodel.Languages = LanguageBL.FindLanguageList();
                    return(View(vmodel));
                }
            }
            catch (Exception ex)
            {
                //to do insert to log file
                var e1 = ex.GetBaseException(); // --> log
                var e4 = ex.Message;            // --> log
                var e5 = ex.Source;             // --> log
                var e8 = ex.GetType();          // --> log
                var e9 = ex.GetType().Name;     // --> log

                return(View("Error"));
            }
        }
Пример #2
0
        //[Authorize(Roles = "admin")]
        //[Authorize(Roles = "manager")]
        //[Authorize(Roles = "vendor")]
        public ActionResult ProductBack(string nTransac)
        {
            TrProductBackViewModel vm = new TrProductBackViewModel();

            if (Session["Language"] == null)
            {
                Session["Language"] = ConfigurationManager.AppSettings["Language"];
            }
            string language = Session["Language"].ToString();
            //to do --> change init isChange..
            bool isChange = false;

            vm.Ticket         = TicketBL.FillTicket(nTransac, language, isChange);
            vm.Language       = language;
            vm.Languages      = LanguageBL.FindLanguageList();
            vm.NumTransaction = nTransac;
            vm.DateT          = vm.Ticket.DateTicket;
            ViewBag.DateTi    = vm.Ticket.DateTicket;
            return(View(vm));
        }