Beispiel #1
0
 public ActionResult Add(LCHotelImageManageModel model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             model.LCHotelImage.PhotoNormalPath = model.ImageStrs.PhotoNormal;
             model.LCHotelImage.PhotoThumbPath  = model.ImageStrs.PhotoThumb;
             string jsonStr = JsonConvert.SerializeObject(model.LCHotelImage);
             string result  = objAPI.PostRecordtoApI("lchotelconfig", "SaveLCHotelImages", jsonStr);
             TempData["ErrMsg"] = result;
             if (result.ToLower().Contains("error"))
             {
                 model.HotelList      = objAPI.GetAllRecords <LCHotelDD>("lchotelconfig", "LCHotelDD");
                 model.HotelPremiseDD = objAPI.GetAllRecords <utblLCMstHotelPremise>("lchotelconfig", "HotelPremisesDD");
                 model.RoomTypeDD     = objAPI.GetRecordsByID <RoomsTypeDD>("lchotelconfig", "RoomTypeDD", model.LCHotelImage.HotelID);
                 return(View(model));
             }
             return(RedirectToAction("index", "LCHotelImg", new { Area = "admin", id = model.LCHotelImage.HotelID }));
         }
         model.HotelList      = objAPI.GetAllRecords <LCHotelDD>("lchotelconfig", "LCHotelDD");
         model.HotelPremiseDD = objAPI.GetAllRecords <utblLCMstHotelPremise>("lchotelconfig", "HotelPremisesDD");
         model.RoomTypeDD     = objAPI.GetRecordsByID <RoomsTypeDD>("lchotelconfig", "RoomTypeDD", model.LCHotelImage.HotelID);
         return(View(model));
     }
     catch (AuthorizationException)
     {
         TempData["ErrMsg"] = "Your Login Session has expired. Please Login Again";
         return(RedirectToAction("Login", "Account", new { Area = "" }));
     }
 }
Beispiel #2
0
 public ActionResult Edit(long hotelid, long hotelimageid)
 {
     try
     {
         LCHotelImageManageModel model   = new LCHotelImageManageModel();
         utblLCHotelImage        lchotel = objAPI.GetObjectByKey <utblLCHotelImage>("lchotelconfig", "LCHotelImagesByID", hotelimageid.ToString(), "id");
         model.HotelPremiseDD = objAPI.GetAllRecords <utblLCMstHotelPremise>("lchotelconfig", "HotelPremisesDD");
         model.RoomTypeDD     = objAPI.GetRecordsByID <RoomsTypeDD>("lchotelconfig", "RoomTypeDD", hotelid);
         model.LCHotelImage   = new LCHotelImageSaveModel()
         {
             HotelImageID    = lchotel.HotelImageID,
             HotelID         = lchotel.HotelID,
             HotelPremID     = lchotel.HotelPremID,
             RoomID          = lchotel.RoomID,
             IsRoomCover     = lchotel.IsRoomCover,
             IsHotelCover    = lchotel.IsHotelCover,
             PhotoNormalPath = lchotel.PhotoNormalPath,
             PhotoThumbPath  = lchotel.PhotoThumbPath,
             PhotoCaption    = lchotel.PhotoCaption
         };
         model.HotelList = 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 = "" }));
     }
 }
Beispiel #3
0
 public ActionResult Add(long id)
 {
     try
     {
         LCHotelImageManageModel model = new LCHotelImageManageModel();
         model.HotelDetails   = objAPI.GetObjectByKey <utblLCHotel>("lchotelconfig", "lchotelbyid", id.ToString(), "id");
         model.HotelPremiseDD = objAPI.GetAllRecords <utblLCMstHotelPremise>("lchotelconfig", "HotelPremisesDD");
         model.RoomTypeDD     = objAPI.GetRecordsByID <RoomsTypeDD>("lchotelconfig", "RoomTypeDD", id);
         model.LCHotelImage   = new LCHotelImageSaveModel()
         {
             HotelID = id
         };
         return(View(model));
     }
     catch (AuthorizationException)
     {
         TempData["ErrMsg"] = "Your Login Session has expired. Please Login Again";
         return(RedirectToAction("Login", "Account", new { Area = "" }));
     }
 }