public ImportantNewsModel ToModel(ImportantNewsInfo info) { this.Id = info.Id; this.Title = info.Title; this.Content = info.Content; this.ReleaseTime = info.ReleaseTime; this.NewsType = info.NewsType; return(this); }
public ActionResult Create(ImportantNewsModel model) { if (ModelState.IsValid) { ImportantNewsInfo info = new ImportantNewsInfo(); info.Id = Guid.NewGuid(); info.Title = model.Title; info.Content = model.Content; info.NewsType = model.NewsType; info.ReleaseTime = model.ReleaseTime; service.Add(info); return(Json(new AjaxResult() { Result = Result.Success })); } return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model)); }
public void Delete(ImportantNewsInfo info) { repository.Delete(info); }
public void Update(ImportantNewsInfo info) { var query = repository.Table; repository.Update(info); }
public void Add(ImportantNewsInfo info) { var query = repository.Table; repository.Insert(info); }