public ActionResult AdDisplayWithPhoneNumber(int AdId) { HttpCookie UserIdCookie = Request.Cookies["_RRUID"]; HttpCookie PhoneNumberCookie = Request.Cookies["_RRUPn"]; if (UserIdCookie != null && PhoneNumberCookie != null) { AdDetailsModel model = new AdDetailsModel(); InformationServiceWrapper objservice = new InformationServiceWrapper(); model = objservice.SPRRGetAdDisplayDetails(AdId); ViewBag.IntAdId = model.AdID; ViewBag.AdId = model.AdID + ".jpg"; ViewBag.Title = model.txtAddTitle; ViewBag.Description = model.txtAdDescription; ViewBag.Category = model.Category; ViewBag.Price = model.txtPrice; ViewBag.Quantity = model.txtQuantity; ViewBag.Unit = model.SellingUnit; ViewBag.Name = model.Name; ViewBag.MobileNumber = model.MobileNuber.ToString(); ViewBag.Location = model.Location; ViewBag.AdPostedDate = model.PostedDate; if (model.Category == "Fruit" || model.Category == "Handloom" || model.Category == "Equipment" || model.Category == "Vegetable" || model.Category == "Others") { ViewBag.DefinedTitle = model.txtSubCategoryName + " " + model.txtQuantity + " " + model.SellingUnit + " at Price Rs." + model.txtPrice + " Per " + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); } else { ViewBag.DefinedTitle = model.Category + " " + model.txtQuantity + " " + model.SellingUnit + " at Price Rs." + model.txtPrice + " Per " + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); } ViewBag.DefinedUnit = " /" + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); ManagementServiceWrapper ManObj = new ManagementServiceWrapper(); Utility en = new Utility(); AdDetailsModel StatisticsObj = new AdDetailsModel(); StatisticsObj.UserID = Convert.ToInt32(en.Decrypt(UserIdCookie["_RRUID"])); StatisticsObj.MobileNuber = Convert.ToInt64(en.Decrypt(PhoneNumberCookie["_RRUPn"])); StatisticsObj.AdID = model.AdID;; ManObj.SPInsertAdViewsStatistics(StatisticsObj); return(View("AdDisplay")); } else { return(RedirectToAction("Login", "User")); } }
public ActionResult AdDisplay(int AdId) { HttpCookie nameCookie = Request.Cookies["_RRAUN"]; if (nameCookie != null) { AdDetailsModel model = new AdDetailsModel(); InformationServiceWrapper objservice = new InformationServiceWrapper(); model = objservice.SPRRGetAdDisplayDetails(AdId); ViewBag.IntAdId = model.AdID; ViewBag.AdId = model.AdID + ".jpg"; ViewBag.Title = model.txtAddTitle; ViewBag.Description = model.txtAdDescription; ViewBag.Category = model.Category; ViewBag.Price = model.txtPrice; ViewBag.Quantity = model.txtQuantity; ViewBag.Unit = model.SellingUnit; ViewBag.Name = model.Name; ViewBag.MobileNumber = model.MobileNuber.ToString(); ViewBag.Location = model.Location; ViewBag.AdPostedDate = model.PostedDate; ViewBag.DefinedTitle = model.Category + " " + model.txtQuantity + " " + model.SellingUnit + " at Price Rs." + model.txtPrice + " Per " + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); ViewBag.DefinedUnit = " /" + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); //searchingData //ViewBag.SearchOption = "CATEGORY"; //ViewBag.PageNumber = PageNumber; //ViewBag.CategoryID = CategoryID; return(View("/Views/AddPost/AdDisplay.cshtml")); } else { return(RedirectToAction("Login", "Admin")); } }
public ActionResult AdDisplay(int AdId) { AdDetailsModel model = new AdDetailsModel(); InformationServiceWrapper objservice = new InformationServiceWrapper(); model = objservice.SPRRGetAdDisplayDetails(AdId); ViewBag.IntAdId = model.AdID; ViewBag.AdId = model.AdID + ".jpg"; ViewBag.Title = model.txtAddTitle; ViewBag.Description = model.txtAdDescription; ViewBag.Category = model.Category; ViewBag.SubCategoryName = model.txtSubCategoryName; ViewBag.Price = model.txtPrice; ViewBag.Quantity = model.txtQuantity; ViewBag.Unit = model.SellingUnit; ViewBag.Name = model.Name; ViewBag.MobileNumber = model.MobileNuber.ToString().Substring(0, 3) + "XXXXXX"; ViewBag.Location = model.Location; ViewBag.AdPostedDate = model.PostedDate.ToString(); if (model.Category == "Fruit" || model.Category == "Handloom" || model.Category == "Equipment" || model.Category == "Vegetable" || model.Category == "Others") { ViewBag.DefinedTitle = model.txtSubCategoryName + " " + model.txtQuantity + " " + model.SellingUnit + " at Price Rs." + model.txtPrice + " Per " + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); } else { ViewBag.DefinedTitle = model.Category + " " + model.txtQuantity + " " + model.SellingUnit + " at Price Rs." + model.txtPrice + " Per " + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); } ViewBag.DefinedUnit = " /" + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); //searchingData //ViewBag.SearchOption = "CATEGORY"; //ViewBag.PageNumber = PageNumber; //ViewBag.CategoryID = CategoryID; return(View("AdDisplay")); }