public ActionResult Create(long?Id) { var model = new Models.CarBrandModels.CarBrandModel(); if (Id != null) { var cache = new Cache.CarBrandCache().Get(Common.FormsTicket.SystemCode).Where(c => c.Id == Id).FirstOrDefault(); model = new Models.CarBrandModels.CarBrandModel { Id = cache.Id.ToString(), BrandSort = cache.BrandSort, BrandName = cache.BrandName }; } return(View(model)); }
public ActionResult Save(Models.CarBrandModels.CarBrandModel model) { var group = new UCMS.Entitys.CarBrand() { Id = Common.ToolHelper.ConvertToLong(model.Id), BrandSort = model.BrandSort, BrandName = model.BrandName, Initial = Common.SpellHelper.GetSpellCode(model.BrandName.Trim()), IsDelete = (int)Common.EnumModel.EIsDelete.NotDelete, TimeStamp = DateTime.Now, }; var line = provider.Edit(group); if (line > 0) { //删除缓存 new Cache.CarBrandCache().Delete(Common.FormsTicket.SystemCode); } return(Json(new { d = line > 0 ? 1 : 0 })); }