Ejemplo n.º 1
0
 public ActionResult Add(FeatHotelsSaveModel model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             string jsonStr = JsonConvert.SerializeObject(model.FeatHotels);
             string result  = objAPI.PostRecordtoApI("lchotelconfig", "SaveFeatHotels", jsonStr);
             TempData["ErrMsg"] = result;
             if (result.ToLower().Contains("error"))
             {
                 model.LCHotelDD = objAPI.GetAllRecords <LCHotelDD>("lchotelconfig", "LCHotelDD");
                 return(View(model));
             }
             return(RedirectToAction("index", "feathotels", new { Area = "admin" }));
         }
         model.LCHotelDD = objAPI.GetAllRecords <LCHotelDD>("lchotelconfig", "LCHotelDD");
         return(View(model));
     }
     catch (AuthorizationException)
     {
         TempData["ErrMsg"] = "Your Login Session has expired. Please Login Again";
         return(RedirectToAction("Login", "Account", new { Area = "" }));
     }
 }
Ejemplo n.º 2
0
 public ActionResult Add()
 {
     try
     {
         FeatHotelsSaveModel model = new FeatHotelsSaveModel();
         model.LCHotelDD = objAPI.GetAllRecords <LCHotelDD>("lchotelconfig", "LCHotelDD");
         return(View(model));
     }
     catch (AuthorizationException)
     {
         TempData["ErrMsg"] = "Your Login Session has expired. Please Login Again";
         return(RedirectToAction("Login", "Account", new { Area = "" }));
     }
 }
Ejemplo n.º 3
0
 public ActionResult Edit(long id)
 {
     try
     {
         FeatHotelsSaveModel model = new FeatHotelsSaveModel();
         model.FeatHotels = objAPI.GetObjectByKey <utblLCFeaturedHotel>("lchotelconfig", "FeatHotelsByID", id.ToString(), "id");
         model.LCHotelDD  = objAPI.GetAllRecords <LCHotelDD>("lchotelconfig", "LCHotelDD");
         return(View(model));
     }
     catch (AuthorizationException)
     {
         TempData["ErrMsg"] = "Your Login Session has expired. Please Login Again";
         return(RedirectToAction("Login", "Account", new { Area = "" }));
     }
 }