示例#1
0
        public ActionResult AddTrader(Traders obj)
        {
            string msg = "";

            if (!UserService.CheckUserByCode(obj.Assigner, obj.AssignerUID, ref msg))
            {
                return(new OpActionResult(Utility.OpResult.Fail(msg)));
            }
            if (TraderService.ExistsTitle(obj.Title, obj.FullTitle))
            {
                return(new OpActionResult(Utility.OpResult.Fail("客户简称或全称已存在!")));
            }
            obj.TraderTypeId    = "";
            obj.Pay             = Request["Pay"];
            obj.BusinessScopeId = Request["BusinessScopeId"];
            var citys = obj.Cities;

            if (!citys.IsNullOrEmpty())
            {
                var cs = citys.Split(',').Select(o => short.Parse(o)).ToList();
                if (cs.Count == 3)
                {
                    obj.CurrentProvinceId = cs[0];
                    obj.CurrentCityId     = cs[1];
                    obj.CurrentCounty     = cs[2];
                }
            }
            Session["traders"] = obj;
            return(new OpActionResult(Utility.OpResult.Success()));
        }