Esempio n. 1
0
 public ActionResult booking1(tblBooking b1)       //values of booking are bought through b1 object
 {
     if (ModelState.IsValid)
     {
         tblLogin z = (tblLogin)Session["customerid"];
         string   n = z.UserId;
         if (n == b1.Customer_ID)
         {
             string s = Dbclass.Hotelbooking(b1);                             //validations and billamount is returned through this s
             if (s.StartsWith("N") || s.StartsWith("a") || s.StartsWith("H")) //if validations are not satisfied it goes to booking view and generate which validation is missing
             {
                 ViewBag.msg = s;
                 return(View("booking"));
             }
             else
             {
                 ViewBag.msg     = s;
                 Session["bill"] = s;
                 Session["var"]  = b1;                      //here we are storing object of tblbooking by using sessions so that we can use this value after payment
                 slist           = Dbclass.getstate();      //this slist consists values of bankdetails we will use it to populate dropdown values in payment view
                 ViewBag.bankid  = slist;
                 return(View("payment"));
             }
         }
         else
         {
             ViewBag.msg = "Please Enter Your CustomerId";
             return(View("booking"));
         }
     }
     return(View("booking"));
 }
Esempio n. 2
0
        public ActionResult payment1(tblPayment p)
        {
            if (ModelState.IsValid)                             //if validations are satisfied then it goes into model
            {
                tblBooking z = (tblBooking)Session["var"];      //here we are retrieving tblbooking object values that are stored in session variable


                bool s = Dbclass.getpayment(p);
                if (s == true)                                 //if payment is done successfully then it goes to insertion of booking
                {
                    string x = Dbclass.getbooking(z);          //for inserting into booking
                    ViewBag.g = x;
                }
                return(View());
            }
            else
            {
                ViewBag.msg    = Session["bill"].ToString();
                slist          = Dbclass.getstate();
                ViewBag.bankid = slist;
                return(View("payment"));                       //it will show where the validation is missing
            }
        }