/// <summary> /// 保存数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public JsonResult SaveData(CultivationBaseModel model) { var result = new ResultJson(); try { var msg = new MessageModel(); if (model.CultivationID == 0) { msg = _cultivationBaseService.InsertSingleCultivationBase(model); } else { msg = _cultivationBaseService.UpdateSingleCultivationBase(model); } if (msg.Status == MessageStatus.Success) { result.IsSuccess = true; } } catch (Exception) { } return(Json(result)); }
public void Save() { if (Mode == EditMode.CREATE) { var result = iCultivationBaseService.InsertSingleCultivationBase(Model); } else if (Mode == EditMode.UPDATE) { iCultivationBaseService.UpdateSingleCultivationBase(Model); } var win = GetView() as System.Windows.Window; if (win != null) { win.DialogResult = true; win.Close(); } }