public virtual ActionResult Modify(CatalogModel model) { if (model == null) { return(null); } var entity = model.CreateEntity(SaveType.Modify); var result = new Dictionary <string, object>(); var rev = this.SaveEntity(entity); var mess = rev ? "" : entity.Errors?.FirstOrDefault()?.Message; result.Add("Status", rev); result.Add("Message", mess); return(this.Jsonp(result)); }
public virtual ActionResult Add(CatalogModel model) { if (model == null) { return(null); } var entity = model.CreateEntity(SaveType.Add); var result = new Dictionary <string, object>(); entity.Site = new SiteEntity { Id = SiteId }; entity.Sequence = GetSequence(); var rev = this.SaveEntity(entity); var mess = rev ? "" : entity.Errors?.FirstOrDefault()?.Message; result.Add("Status", rev); result.Add("Id", entity.Id); result.Add("Message", mess); return(this.Jsonp(result)); }