Ejemplo n.º 1
0
        public PartialViewResult WSHomeAdConfigPop(string remark, string type, string model, string act, string description = "img")
        {
            ViewBag.act = act;
            var data = new AdColumnModel();

            if (!string.IsNullOrWhiteSpace(model))
            {
                data = JsonConvert.DeserializeObject <AdColumnModel>(HttpUtility.HtmlDecode(HttpUtility.UrlDecode(model)));
            }
            ViewBag.type        = type;
            ViewBag.description = description;
            ViewBag.remark      = remark;
            if (String.Compare(remark, "product", true) == 0)
            {
                var products = WebSiteHomeAdManager.SelectAdProductByID(data.ID);
                if (data.Advertises == null || data.Advertises.Count() <= 0)
                {
                    data.Products = products == null ? null : products.Where(p => p.AdvertiseID == 0);
                }
                else
                {
                    data.Products = products == null ? null : products.Where(p => p.AdvertiseID == data.Advertises.FirstOrDefault().PKID);
                }
            }

            return(PartialView(data));
        }
Ejemplo n.º 2
0
        public ActionResult WSHomeAdConfig(string id, string name, string remark, string description = "img")
        {
            if (String.IsNullOrWhiteSpace(id))
            {
                return(HttpNotFound());
            }
            var result = WebSiteHomeAdManager.SelectAdDetailByID(id);

            ViewBag.haveflag = true;
            if (result == null)
            {
                result           = new AdColumnModel();
                result.ID        = id;
                result.ADCName   = name;
                result.Remark    = remark;
                ViewBag.haveflag = false;
            }
            ViewBag.description = description;
            result.Products     = WebSiteHomeAdManager.SelectAdProductByID(id);
            return(View(result));
        }