Exemplo n.º 1
0
        public ActionResult Activate(payment_details paymentdetails)
        {
            if (Session["admin_login"] == null)
            {
                return(RedirectToAction("Login", "IPTSELogin"));
            }

            try
            {
                ViewData["success_msg"] = "";
                if (ModelState.IsValid && paymentdetails != null)
                {
                    paymentDb.payment_details.Add(paymentdetails);
                    paymentDb.SaveChanges();
                    ViewData["success_msg"] = "User Successfully Activated";
                }
                else
                {
                    ViewBag.ErrorMessage = "Fill all valid payment details to activate the user";
                }
                return(View("Successfull"));
            }
            catch (Exception ex)
            {
                ViewBag.ErrorMessage = "Some Error has occured. Please contact system administrator! </br>" + ex.InnerException.Message;
                return(View());
            }
        }
Exemplo n.º 2
0
        public ActionResult paymentdetails()
        {
            if (Session["id"] == null)
            {
                return(RedirectToAction("Login", "IPTSELogin"));
            }
            try
            {
                string          url             = HttpContext.Request.Url.AbsoluteUri;
                payment_details payment_Details = new payment_details();
                string[]        ar = url.Split('?');
                payment_Details.Id           = Decimal.Parse(Session["id"].ToString());
                payment_Details.payment_date = DateTime.Now;
                payment_Details.payment_id   = ar[1];
                db.payment_details.Add(payment_Details);
                db.SaveChanges();
                ViewBag.paymentid = ar[1];
                ViewBag.datetime  = DateTime.Now;
                ViewBag.id        = Session["id"];
            }
            catch
            {
            }

            return(View());
        }