public int AddBanner(etblBannerM prop) { try { if (prop.sDescription != null) { prop.sDescription = prop.sDescription.Replace("\t", ""); } prop.iActionBy = ((OneFineRateBLL.BL_Login.UserDetails)(Session["UserDetails"])).iUserId; prop.dtActionDate = DateTime.Now; if (!string.IsNullOrEmpty(prop.sLinkController) && !string.IsNullOrEmpty(prop.sLinkAction)) { if (prop.sLinkController != "Select" && prop.sLinkAction != "Select") { prop.sLinkId = "../" + prop.sLinkController + "/" + prop.sLinkAction; } } prop.cstatus = "A"; int result = BL_tblBannerM.AddRecord(prop); return(result); } catch (Exception) { throw; } }
//[OutputCache(Duration = 10, VaryByParam = "*", VaryByCustom = "User")] public ActionResult Index() { //throw new System.ArgumentException("Parameter cannot be null", "original"); //TO DO TEST MAIL //FutureSoft.Util.MailComponent.SendEmail("*****@*****.**", "", null, "OneFineRate-New Booking! Confirmation No:", "", null, null, true); //***************LIVE************** //ViewBag.banners = new object(); //etblVideoUrlM vidobj = new etblVideoUrlM(); //ViewBag.url = vidobj.sVideoUrl + "?rel=0&autoplay=1"; //ViewBag.urlImg = "http://ofrblobstorage.blob.core.windows.net" + vidobj.sImgUrl; //ViewBag.PromotionalHotels = new object(); //ViewBag.TopBannerData = new object(); //TempData["VideoUrl"] = BL_tblVideoUrlM.GetParameters().sVideoUrl; //return View("ComingSoon"); //*******************UAT************ etblVideoUrlM vidobj = new etblVideoUrlM(); ViewBag.banners = BL_tblBannerM.GetAllBannersRecords(); vidobj = BL_tblVideoUrlM.GetParameters(); ViewBag.url = string.IsNullOrEmpty(vidobj.sVideoUrl) ? "" : vidobj.sVideoUrl.Replace("watch?v=", "embed/") + "?rel=0&autoplay=1"; ViewBag.urlImg = string.IsNullOrEmpty(vidobj.sImgUrl) ? "" : System.Configuration.ConfigurationManager.AppSettings["BlobUrl"].ToString() + (vidobj.sImgUrl.IndexOf("/") == 0 ? vidobj.sImgUrl.Substring(1) : vidobj.sImgUrl); ViewBag.PromotionalHotels = BL_WebsiteHomePage.GetAllPromotionalHotels(Convert.ToString(Session["CurrencyCode"])); ViewBag.TopBannerData = OneFineRateAppUtil.clsUtils.ConvertToJson(((List <OneFineRateBLL.Entities.etblBannerM>)ViewBag.banners).Where(item => item.sBannerType == "Page Top")); return(View()); }
public ActionResult Edit(int Id) { etblBannerM obj = new etblBannerM(); obj = BL_tblBannerM.GetBannerDetailsByID(Id); //if (obj.sLinkId != null) //{ // string[] arr = obj.sLinkId.Split('/'); // obj.sLinkController = arr[1].ToString(); // obj.sLinkAction = arr[2].ToString(); //} obj.Mode = "Edit"; obj.heading = "Edit Banner"; return(PartialView("pvBanner", obj)); }
public ActionResult Delete(int Id) { string strReturn = string.Empty; try { etblBannerM prop = new etblBannerM(); prop = BL_tblBannerM.GetBannerDetailsByID(Id); if (prop.cstatus == "A") { prop.cstatus = "I"; } else if (prop.cstatus == "I") { prop.cstatus = "A"; } prop.iActionBy = ((OneFineRateBLL.BL_Login.UserDetails)(Session["UserDetails"])).iUserId; prop.dtActionDate = DateTime.Now; int val = BL_tblBannerM.DeleteRecord(prop); if (val == 1) { if (prop.cstatus == "I") { TempData["msg"] = "Disabled successfully"; // return Json(new { st = 0, msg = "Disabled successfully" }, JsonRequestBehavior.AllowGet); } else { TempData["msg"] = "Enabled successfully"; // return Json(new { st = 0, msg = "Enabled successfully" }, JsonRequestBehavior.AllowGet); } } else { TempData["msg"] = "Kindly try after some time"; //return Json(new { st = 0, msg = "Kindly try after some time" }, JsonRequestBehavior.AllowGet); } } catch (Exception) { } return(RedirectToAction("Index")); }
public int EditBanner(etblBannerM prop) { try { prop.sDescription = prop.sDescription.Replace("\t", ""); prop.iActionBy = ((OneFineRateBLL.BL_Login.UserDetails)(Session["UserDetails"])).iUserId; prop.dtActionDate = DateTime.Now; //if (prop.sLinkController != "Select" && prop.sLinkAction != "Select") //{ // prop.sLinkId = "../" + prop.sLinkController + "/" + prop.sLinkAction; //} int result = BL_tblBannerM.UpdateRecord(prop); return(result); } catch (Exception) { throw; } }