コード例 #1
0
        /// <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));
        }
コード例 #2
0
        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();
            }
        }