/// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public JsonResult SaveBreedAreaData(BreedAreaModel model)
        {
            var result = new ResultJson();
            var msg    = new MessageModel();

            try
            {
                if (model.AreaID == 0)
                {
                    msg = _areaService.InsertSingleBreedArea(model);
                }
                else
                {
                    msg = _areaService.UpdateSingleBreedArea(model);
                }

                if (msg.Status == MessageStatus.Success)
                {
                    result.IsSuccess = true;
                }
            }
            catch (Exception)
            {
            }

            return(Json(result));
        }
Esempio n. 2
0
        public void Save()
        {
            if (Mode == EditMode.CREATE)
            {
                var result = iBreedAreaService.InsertSingleBreedArea(Model);
            }
            else if (Mode == EditMode.UPDATE)
            {
                iBreedAreaService.UpdateSingleBreedArea(Model);
            }

            var win = GetView() as System.Windows.Window;

            if (win != null)
            {
                win.DialogResult = true;
                win.Close();
            }
        }