示例#1
0
 public ActionResult SaveDefaultSetting(Setting setting)
 {
     if (setting.Id == null || setting.Id == Guid.Empty)
     {
         var newItem = settingService.Add(setting);
         return Json(new JsonData() { Data = newItem, Success = true }, JsonRequestBehavior.AllowGet);
     }
     else
     {
         var update = settingService.Update(setting);
         return Json(new JsonData() { Data = update, Success = true }, JsonRequestBehavior.AllowGet);
     }
 }
示例#2
0
 public Setting Update(Setting packageItem)
 {
     var updateItem = settingRepository.Update(packageItem);
     return updateItem;
 }
示例#3
0
 public Setting Add(Setting packageItem)
 {
     packageItem.Id = Guid.NewGuid();
     var newItem = settingRepository.Add(packageItem);
     return newItem;
 }