Example #1
0
        /// <summary>
        /// 修改数据
        /// </summary>
        public AjaxResult Update(TbEarlyWarningSetUp model)
        {
            if (model == null)
            {
                return(AjaxResult.Warning("参数错误"));
            }
            try
            {
                //修改信息
                Repository <TbEarlyWarningSetUp> .Update(model, p => p.ID == model.ID);

                return(AjaxResult.Success());
            }
            catch (Exception ex)
            {
                return(AjaxResult.Error(ex.ToString()));
            }
        }
Example #2
0
        /// <summary>
        /// 新增数据
        /// </summary>
        public AjaxResult Insert(TbEarlyWarningSetUp model)
        {
            if (model == null)
            {
                return(AjaxResult.Warning("参数错误"));
            }
            try
            {
                //添加信息
                Repository <TbEarlyWarningSetUp> .Insert(model);

                return(AjaxResult.Success());
            }
            catch (Exception ex)
            {
                return(AjaxResult.Error());
            }
        }