Пример #1
0
        public ActionResult AdDetails(int AdId)
        {
            HttpCookie nameCookie = Request.Cookies["_RRAUN"];

            if (nameCookie != null)
            {
                AdDetailsModel            model      = new AdDetailsModel();
                InformationServiceWrapper objservice = new InformationServiceWrapper();

                model        = objservice.FetchAdDetails(AdId);
                ViewBag.AdId = model.AdID;
                //ViewBag.Title = model.txtAddTitle;
                ViewBag.Description     = model.txtAdDescription;
                ViewBag.SubCategoryName = model.txtSubCategoryName;
                ViewBag.Category        = model.Category;
                ViewBag.Price           = model.txtPrice;
                ViewBag.Quantity        = model.txtQuantity;
                ViewBag.Unit            = model.SellingUnit;
                return(View());
            }
            else
            {
                return(RedirectToAction("Login", "Admin"));
            }
        }
Пример #2
0
        public ActionResult AdDetails(int AdId)
        {
            HttpCookie UserIdCookie = Request.Cookies["_RRUID"];
            HttpCookie KeyCookie    = Request.Cookies["_RRPS"];

            Utility en = new Utility();

            if (UserIdCookie != null)
            {
                AdDetailsModel            model      = new AdDetailsModel();
                InformationServiceWrapper objservice = new InformationServiceWrapper();
                Int32 Userid = Convert.ToInt32(en.Decrypt(UserIdCookie["_RRUID"]));

                List <Int32> UserAdList = new List <int>();
                UserAdList = objservice.getAdIdsWithUserid(Userid);

                if (UserAdList.Contains(AdId))
                {
                    model        = objservice.FetchAdDetails(AdId);
                    ViewBag.AdId = model.AdID;
                    //ViewBag.Title = model.txtAddTitle;
                    ViewBag.Description     = model.txtAdDescription;
                    ViewBag.SubCategoryName = model.txtSubCategoryName;
                    ViewBag.Category        = model.Category;
                    ViewBag.Price           = model.txtPrice;
                    ViewBag.Quantity        = model.txtQuantity;
                    ViewBag.Unit            = model.SellingUnit;
                    return(View());
                }
                else
                {
                    return(RedirectToAction("UserAccount", "User"));
                }
            }
            else
            {
                return(RedirectToAction("Login", "User"));
            }
        }