Beispiel #1
0
        /// <summary>
        /// 编辑保险行业_show
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Edit(int id)
        {
            Response   _resp = new Response();
            BxIndustry _bxi  = _bxhygl.Find(id);

            if (_bxi == null)
            {
                _resp.Status  = 0;
                _resp.Message = "未找到相关的保险行业记录";
                return(Json(_resp));
            }
            return(View(_bxi));
        }
Beispiel #2
0
        public ActionResult Edit(int id, FormCollection fm)
        {
            Response   _resp = new Response();
            BxIndustry _bxi  = _bxhygl.Find(id);

            if (_bxi == null)
            {
                _resp.Status  = 0;
                _resp.Message = _resp.Message = "未找到相关的保险行业记录";
                return(Json(_resp));
            }

            if (_bxhygl.ExitsName(fm["BxIndustryName"]))
            {
                _resp.Status  = 0;
                _resp.Message = _resp.Message = "错误!存在保险行业重名的录记录";
                return(Json(_resp));
            }

            TryUpdateModel(_bxi, new string[] { "BxIndustryName", "BxRemark" });


            if (!ModelState.IsValid)
            {
                _resp.Status  = 0;
                _resp.Message = General.GetModelErrorString(ModelState);
                return(Json(_resp));
            }

            _resp = _bxhygl.Update(_bxi);
            if (_resp.Status == 1)
            {
                _resp.Message = "恭喜!修改保险行业数据成功";
            }


            return(Json(_resp));
        }
Beispiel #3
0
        public ActionResult Add(BxIndustry bxi)
        {
            Response _resp = new Response();

            if (!ModelState.IsValid)
            {
                _resp.Status  = 0;
                _resp.Message = General.GetModelErrorString(ModelState);
                return(Json(_resp));
            }
            BxIndustry _bxi = new BxIndustry();

            _bxi.BxIndustryName = bxi.BxIndustryName;
            _bxi.BxRemark       = bxi.BxRemark;
            _bxi.CreateTime     = DateTime.Now;
            _resp = _bxhygl.Add(_bxi);
            if (_resp.Status == 1)
            {
                _resp.Message = "恭喜!添加保险行业成功!";
            }

            return(Json(_resp));
        }