Beispiel #1
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(BarclaysPayment).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BarclaysPaymentExists(BarclaysPayment.BarclaysPaymentID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            Note.UpdatedDate = DateTime.Now;
            Note.UpdatedBy   = User.Identity.Name;

            _context.Attach(Note).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!NoteExists(Note.NoteID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Beispiel #3
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync(
            string ORDERID,
            string PAYID,
            string PAYMENT_REFERENCE,
            string TRXDATE,
            int STATUS,
            string NCERROR,
            string AAVADDRESS,
            string ACCEPTANCE,
            decimal AMOUNT,
            string BRAND,
            string CARDNO,
            string CN,
            string COMPLUS,
            string CURRENCY,
            string ED,
            string IP,
            string PM
            )
        {
            BarclaysResponse.ORDERID           = ORDERID;
            BarclaysResponse.PAYID             = PAYID;
            BarclaysResponse.PAYMENT_REFERENCE = PAYMENT_REFERENCE;
            BarclaysResponse.TRXDATE           = TRXDATE;
            BarclaysResponse.STATUS            = STATUS;
            BarclaysResponse.NCERROR           = NCERROR;
            BarclaysResponse.AAVADDRESS        = AAVADDRESS;
            BarclaysResponse.ACCEPTANCE        = ACCEPTANCE;
            BarclaysResponse.AMOUNT            = AMOUNT;
            BarclaysResponse.BRAND             = BRAND;
            BarclaysResponse.CARDNO            = CARDNO;
            BarclaysResponse.CN          = CN;
            BarclaysResponse.COMPLUS     = COMPLUS;
            BarclaysResponse.CURRENCY    = CURRENCY;
            BarclaysResponse.ED          = ED;
            BarclaysResponse.IP          = IP;
            BarclaysResponse.PM          = PM;
            BarclaysResponse.IpAddress   = Request.HttpContext.Connection.RemoteIpAddress.ToString();
            BarclaysResponse.HostName    = Dns.GetHostEntry(Request.HttpContext.Connection.RemoteIpAddress).HostName;
            BarclaysResponse.CreatedBy   = "EPDQ";
            BarclaysResponse.CreatedDate = DateTime.Now;

            //if (!ModelState.IsValid)
            //{
            //    return Page();
            //}

            _context.BarclaysResponse.Add(BarclaysResponse);
            await _context.SaveChangesAsync();

            //return RedirectToPage("./Index");

            //Used by Barclays EPDQ to redirect user and overrides anything set elsewhere according to Support
            //May want to consider redirecting differently if the payment fails etc.
            //return RedirectToPage("https://www.wlc.ac.uk");

            return(Page());
        }
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.IELTSOrder.Add(IELTSOrder);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync(int?id, int?OrderStatus, bool?PracticeTestBooked, bool?PracticeMaterialsSent)
        {
            if (id != null)
            {
                IELTSOrder = await _context.IELTSOrder
                             .FirstOrDefaultAsync(m => m.BarclaysPaymentID == id);
            }

            if (OrderStatus != null)
            {
                IELTSOrder.OrderStatusID = OrderStatus;
            }

            if (PracticeTestBooked != null)
            {
                IELTSOrder.PracticeTestBooked = (bool)PracticeTestBooked;
            }

            if (PracticeMaterialsSent != null)
            {
                IELTSOrder.PracticeMaterialsSent = (bool)PracticeMaterialsSent;
            }

            ModelState.Remove("IELTSOrder.IELTSTestDate");

            //if (!ModelState.IsValid)
            //{
            //    return Page();
            //}

            _context.Attach(IELTSOrder).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!IELTSOrderExists(IELTSOrder.IELTSOrderID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Beispiel #6
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            Note.CreatedDate = DateTime.Now;
            Note.CreatedBy   = User.Identity.Name;

            _context.Note.Add(Note);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
            //return Page();
        }
Beispiel #7
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            IELTSOrder = await _context.IELTSOrder.FindAsync(id);

            if (IELTSOrder != null)
            {
                _context.IELTSOrder.Remove(IELTSOrder);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Note = await _context.Note.FindAsync(id);

            if (Note != null)
            {
                _context.Note.Remove(Note);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Beispiel #9
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            BarclaysPayment = await _context.BarclaysPayment.FindAsync(id);

            if (BarclaysPayment != null)
            {
                _context.BarclaysPayment.Remove(BarclaysPayment);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Beispiel #10
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync(BarclaysPayment model)
        {
            FormSubmitted = true;
            FormSaved     = true;

            //if (!ModelState.IsValid)
            //{
            //    FormSaved = false;
            //    FormErrors = string.Join("; ", ModelState.Values
            //                            .SelectMany(x => x.Errors)
            //                            .Select(x => x.ErrorMessage));
            //}

            BarclaysPayment.UniquePaymentRef = Guid.NewGuid();
            BarclaysPayment.PSPID            = _configuration.GetSection("SystemSettings")["PSPID"];
            BarclaysPayment.CURRENCY         = _configuration.GetSection("SystemSettings")["Currency"];
            BarclaysPayment.LANGUAGE         = "en_GB";
            BarclaysPayment.TITLE            = _configuration.GetSection("SystemSettings")["BarclaysTitle"];
            BarclaysPayment.BGCOLOR          = "";
            BarclaysPayment.TXTCOLOR         = "";
            BarclaysPayment.TBLBGCOLOR       = "";
            BarclaysPayment.TBLTXTCOLOR      = "";
            BarclaysPayment.BUTTONBGCOLOR    = "";
            BarclaysPayment.BUTTONTXTCOLOR   = "";
            BarclaysPayment.LOGO             = "https://apps.wlc.ac.uk/BarclaysPayments/images/CollegeLogo.png";
            BarclaysPayment.FONTTYPE         = "";
            BarclaysPayment.ACCEPTURL        = "https://www.wlc.ac.uk";
            BarclaysPayment.DECLINEURL       = "https://www.wlc.ac.uk";
            BarclaysPayment.EXCEPTIONURL     = "https://www.wlc.ac.uk";
            BarclaysPayment.CANCELURL        = "https://www.wlc.ac.uk";
            BarclaysPayment.CreatedDate      = DateTime.Now;
            BarclaysPayment.CreatedBy        = User.Identity.Name.Split('\\').Last();

            _context.BarclaysPayment.Add(BarclaysPayment);
            await _context.SaveChangesAsync();

            UniquePaymentRef = BarclaysPayment.UniquePaymentRef;

            return(Page());
        }
        public async Task <IActionResult> OnGetAsync(
            string ielts,
            string TestType,
            string reffname,
            string refsname,
            string ref1,
            string ref2,
            string confirmref1,
            string confirmref2,
            string email,
            string email2,
            decimal tpymt,
            DateTime TestDate,
            string dep,
            bool mockexam1,
            bool refbooks,
            bool DuplicateCertificate,
            bool TransferFees,
            bool EnquiryOnResult,
            int formId,
            string oid
            )
        {
            FormSubmitted = false;

            SHAPassphrase = _configuration.GetSection("SystemSettings")["SHAPassphrase"];
            string paymentSystem = _configuration.GetSection("SystemSettings")["PaymentSystem"];

            string paymentURL = null;

            if (paymentSystem == "LIVE")
            {
                FormDestinationID = _configuration.GetSection("SystemSettings")["PaymentURLLive"];
            }
            else
            {
                FormDestinationID = _configuration.GetSection("SystemSettings")["PaymentURLTest"];
            }

            string userID = "IELTS";

            if (User.Identity.Name != null)
            {
                userID = User.Identity.Name.Split('\\').Last();
            }

            BarclaysPayment = new BarclaysPayment
            {
                UniquePaymentRef = Guid.NewGuid(),
                PaymentURL       = paymentURL,
                PSPID            = _configuration.GetSection("SystemSettings")["PSPID"],
                ORDERID          = oid,
                PaymentReasonID  = "IELTS",
                AMOUNT           = tpymt,
                CURRENCY         = _configuration.GetSection("SystemSettings")["Currency"],
                LANGUAGE         = "en_GB",
                CN    = reffname + " " + refsname,
                EMAIL = email,
                //OWNERZIP = "W14 9BL",
                //OWNERADDRESS = "West London College",
                //OWNERCTY = "Hammersmith",
                //OWNERTOWN = "London",
                //OWNERTELNO = "07712345678",
                SHASIGN        = "",
                TITLE          = _configuration.GetSection("SystemSettings")["BarclaysTitle"],
                BGCOLOR        = "",
                TXTCOLOR       = "",
                TBLBGCOLOR     = "",
                TBLTXTCOLOR    = "",
                BUTTONBGCOLOR  = "",
                BUTTONTXTCOLOR = "",
                LOGO           = "https://apps.wlc.ac.uk/BarclaysPayments/images/CollegeLogo.png",
                FONTTYPE       = "",
                ACCEPTURL      = "https://www.wlc.ac.uk",
                DECLINEURL     = "https://www.wlc.ac.uk",
                EXCEPTIONURL   = "https://www.wlc.ac.uk",
                CANCELURL      = "https://www.wlc.ac.uk",
                CreatedDate    = DateTime.Now,
                CreatedBy      = userID
            };

            _context.BarclaysPayment.Add(BarclaysPayment);
            await _context.SaveChangesAsync();

            IELTSOrder = new IELTSOrder
            {
                BarclaysPaymentID = BarclaysPayment.BarclaysPaymentID,
                IELTSTestDate     = TestDate,
                TestType          = TestType,
                OrderStatusID     = 1 //To-Do
            };

            if (ielts == "ieltsexam")
            {
                IELTSTestAmount = await _context.IELTSPrice
                                  .Where(p => p.Code == "ieltsexam")
                                  .FirstOrDefaultAsync();

                IELTSOrder.IELTSTestAmount = IELTSTestAmount.Price;
                IELTSTestAmountValue       = IELTSTestAmount.Price;
            }
            else if (ielts == "ieltsexam2")
            {
                IELTSTestAmount = await _context.IELTSPrice
                                  .Where(p => p.Code == "ieltsexam2")
                                  .FirstOrDefaultAsync();

                IELTSOrder.IELTSTestAmount = IELTSTestAmount.Price;
                IELTSTestAmountValue       = IELTSTestAmount.Price;
            }
            else if (ielts == "ieltsexam3")
            {
                IELTSTestAmount = await _context.IELTSPrice
                                  .Where(p => p.Code == "ieltsexam3")
                                  .FirstOrDefaultAsync();

                IELTSOrder.IELTSTestAmount = IELTSTestAmount.Price;
                IELTSTestAmountValue       = IELTSTestAmount.Price;
            }
            else if (ielts == "ieltsexamTFL")
            {
                IELTSTestAmount = await _context.IELTSPrice
                                  .Where(p => p.Code == "ieltsexamTFL")
                                  .FirstOrDefaultAsync();

                IELTSOrder.IELTSTestAmount = IELTSTestAmount.Price;
                IELTSTestAmountValue       = IELTSTestAmount.Price;
            }

            if (mockexam1 == true)
            {
                PracticeTestAmount = await _context.IELTSPrice
                                     .Where(p => p.Code == "mockexam1")
                                     .FirstOrDefaultAsync();

                IELTSOrder.PracticeTestAmount = PracticeTestAmount.Price;
                PracticeTestAmountValue       = PracticeTestAmount.Price;
            }

            if (mockexam1 == true)
            {
                PracticeMaterialsAmount = await _context.IELTSPrice
                                          .Where(p => p.Code == "refbooks")
                                          .FirstOrDefaultAsync();

                IELTSOrder.PracticeMaterialsAmount = PracticeMaterialsAmount.Price;
                PracticeMaterialsAmountValue       = PracticeMaterialsAmount.Price;
            }

            _context.IELTSOrder.Add(IELTSOrder);
            await _context.SaveChangesAsync();

            PracticeTestDate = TestDate;

            UniquePaymentRef = BarclaysPayment.UniquePaymentRef;

            //Update Payment Reference
            BarclaysPayment.ORDERID = IELTSOrder.IELTSOrderID + "-" + IELTSOrder.TestType + "-" + BarclaysPayment.ORDERID;
            await _context.SaveChangesAsync();

            return(Page());
        }