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); }
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 }); }
public static bool UpdateAdvert(AdvertSet model) { return(WebSetDAL.BaseProvider.UpdateAdvert(model.AutoID, model.View, model.Content, model.ImgType, model.ImgUrl, model.LinkUrl)); }
public static bool InsertAdvert(AdvertSet model) { return(WebSetDAL.BaseProvider.InsertAdvert(model.CreateUserID, model.View.ToLower(), model.Content, model.ImgType, model.ImgUrl, model.LinkUrl)); }