Ejemplo n.º 1
0
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public JsonResult SaveData(BreedHomeModel model)
        {
            var result = new ResultJson();

            try
            {
                var msg = new MessageModel();
                if (model.HomeID == 0)
                {
                    msg = _homeService.InsertSingleBreedHome(model);
                }
                else
                {
                    msg = _homeService.UpdateSingleBreedHome(model);
                }

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

            return(Json(result));
        }
        public void Save()
        {
            if (Mode == EditMode.CREATE)
            {
                var result = iBreedHomeService.InsertSingleBreedHome(Model);
            }
            else if (Mode == EditMode.UPDATE)
            {
                iBreedHomeService.UpdateSingleBreedHome(Model);
            }
            var win = GetView() as System.Windows.Window;

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