Пример #1
0
        public ActionResult Add(FormCollection fc, ICollection <Bxar> bxars)
        {
            Response _resp    = new Response();
            Product  _product = new Product();

            _product.BxCreateCorporateName = Session["BxCorporateName"].ToString();

            if (!TryUpdateModel(_product, new string[] { "BxIndustry", "BxType", "BxRemark", "BxClauses" }))
            {
                _resp.Status  = 0;
                _resp.Message = General.GetModelErrorString(ModelState);
                return(Json(_resp));
            }

            List <Bxar> _bxars = new List <Bxar>();

            if (!TryUpdateModel(_bxars, fc))
            {
                _resp.Status  = 0;
                _resp.Message = General.GetModelErrorString(ModelState);
                return(Json(_resp));
            }



            _resp = _productmanager.add(_product, _bxars, HttpContext.Session);
            if (_resp.Status == 1)
            {
                //添加成功,写入日志
                _productLogManager.AddUnPublicLog(Session["BxCorporateName"].ToString(), "添加保险产品" + ((int)_resp.Data).ToString() + "; 使用的ip" + Request.UserHostAddress.ToString(), Request.Url.ToString());
                _resp.Message = "恭喜!添加产品成功!";
            }
            return(Json(_resp));
        }