Esempio n. 1
0
        //[HttpPost]
        public ActionResult BookHanger1()
        {
            ViewBag.L = l1;
            string pid = Request.Form["PlaneID"];

            if (pid == "")
            {
                tblHanger h1 = DBOperations.getHanger(Session["hid"].ToString());
                ViewBag.s = "Please select PlaneId to alloacte Hanger";
                return(View("BookHanger", h1));
            }
            else
            {
                tblPlaneAllocation PlaneAlloc = new tblPlaneAllocation();
                PlaneAlloc.StartDate = DateTime.Parse(Session["sdate"].ToString());
                PlaneAlloc.EndDate   = DateTime.Parse(Session["edate"].ToString());
                PlaneAlloc.HangerID  = Session["hid"].ToString();
                PlaneAlloc.PlaneID   = pid;

                ViewBag.s   = "";
                ViewBag.msg = DBOperations.AllocatePlaneToHanger(PlaneAlloc);
                tblHanger h1 = DBOperations.getHanger(Session["hid"].ToString());
                return(View("BookHanger", h1));
            }
        }
Esempio n. 2
0
 // to book the required hanger for the coresponding duration selected
 public ActionResult BookHanger()
 {
     Session["hid"] = Request.Form["Hanger_Id"];
     if (Session["hid"] == null)
     {
         ViewBag.rs = "Please select a hanger to book";
         return(View("AvailableHangers", Session["avail"]));
     }
     else
     {
         tblHanger h = DBOperations.getHanger(Session["hid"].ToString());
         l1        = DBOperations.getPlaneIds();
         ViewBag.L = l1;
         return(View(h));
     }
 }