コード例 #1
0
 // GET: Payment
 public ActionResult Index()
 {
     try
     {
         using (DataService db = new DataService())
         {
             var cookie = HttpContext.Request.Cookies[FormsAuthentication.FormsCookieName];
             var ticket = FormsAuthentication.Decrypt(cookie.Value);
             var gCode  = Guid.Parse(ticket.UserData);
             var user   = db.Context.Membership_User.FirstOrDefault(x => x.UserCode == gCode);
             var role   = user.Membership_Role.Count;
             int approve;
             if (db.Context.Membership_User.Any(x => x.UserCode == gCode && (x.Membership_Role.Any(y => y.Application_Action.Any(z => z.Name == "IndexDetail" && z.Application_Controller.Name == "Payment")) || x.Application_Action.Any(z => z.Name == "IndexDetail" && z.Application_Controller.Name == "Payment"))))
             {
                 approve = 1;
             }
             else
             {
                 approve = 0;
             }
             var pageModel = new PaymentPageModel
             {
                 PageRequesterID = approve,
                 Employees       = db.Context.EmployeeDetails.Where(x => x.RowStatusID != 3).ToList()
             };
             return(View(pageModel));
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
コード例 #2
0
        public ActionResult GetPaymentPage(int id)
        {
            dbEntities       db      = new dbEntities();
            PaymentPageModel payment = new PaymentPageModel {
                Job = db.Jobs.Where(o => o.Id == id).Single()
            };

            //PaymentPageModel payment = new PaymentPageModel { Review = "fine" };
            return(View("~/Views/PaymentPage/PaymentPageView.cshtml", payment));
        }
コード例 #3
0
        public IActionResult Pay(PaymentPageModel model)
        {
            var result = _page.Process(model);

            if (result.Type == StoreFront.Model.Enum.Response.DataResponseType.SUCCESS)
            {
                return(RedirectToAction("Index", "Confirmation", new { id = result.Details }));
            }

            return(View("Index", _page.Load(model)));
        }
コード例 #4
0
        public ActionResult MakePayment(int id, int rating, string review)
        {
            dbEntities db  = new dbEntities();
            var        job = db.Jobs.Where(o => o.Id == id).Single();

            job.Status = "payed";
            Review r = new Review {
                Rating = rating, JobId = id, Review1 = review
            };
            PaymentPageModel payment = new PaymentPageModel {
                Job = job, Rating = rating, Review = review
            };

            db.Reviews.Add(r);
            db.SaveChanges();
            return(View("~/Views/PaymentPage/PaymentConfirmation.cshtml", payment));
        }
コード例 #5
0
 public PaymentPageViewModel(PaymentPageModel currentPage) : base(currentPage)
 {
     _currentPage = currentPage;
 }