Пример #1
0
        public static List <AdvertSet> GetAdvertSetList(string imgType = "", string view = "")
        {
            List <AdvertSet> list = new List <AdvertSet>();
            DataTable        dt   = WebSetDAL.BaseProvider.GetAdvertSetList(imgType, view);

            foreach (DataRow dr in dt.Rows)
            {
                AdvertSet model = new AdvertSet();
                model.FillData(dr);
                list.Add(model);
            }
            return(list);
        }
Пример #2
0
        public JsonResult SaveAdvert(string entity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            AdvertSet            model      = serializer.Deserialize <AdvertSet>(entity);
            var result = false;

            if (model.AutoID == -1)
            {
                model.CreateUserID = CurrentUser.UserID;
                result             = WebSetBusiness.InsertAdvert(model);
            }
            else
            {
                result = WebSetBusiness.UpdateAdvert(model);
            }
            JsonDictionary.Add("result", result);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Пример #3
0
 public static bool UpdateAdvert(AdvertSet model)
 {
     return(WebSetDAL.BaseProvider.UpdateAdvert(model.AutoID, model.View, model.Content, model.ImgType,
                                                model.ImgUrl, model.LinkUrl));
 }
Пример #4
0
 public static bool InsertAdvert(AdvertSet model)
 {
     return(WebSetDAL.BaseProvider.InsertAdvert(model.CreateUserID, model.View.ToLower(), model.Content, model.ImgType, model.ImgUrl, model.LinkUrl));
 }