Ejemplo n.º 1
0
        public IHttpActionResult Get()
        {
            var m    = Request.GetQueryString("m");
            var p    = Request.GetQueryString("p");
            var uuid = Request.GetQueryString("u");
            var code = Request.GetQueryString("c");

            // 先检查验证码是否正确
            var service = new VerificationCodeService();
            var r       = service.AuthCode(m, uuid, code);

            if (r.HasError)
            {
                return(Ok(r));
            }

            // 创建经纪人
            var service2 = new BrokerAccountService();
            var r2       = service2.Create(m, p);

            if (r2.HasError)
            {
                return(Ok(r2));
            }

            return(Ok(r2, n => new { n.No }));
        }
Ejemplo n.º 2
0
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                var model = new Broker();
                TryUpdateModel(model, collection);
                model.CreatedAt = DateTime.Now;
                model.CreatedBy = "SYSTEM";
                if (!ModelState.IsValid)
                {
                    FlashError("数据验证未通过,请检查是否存在为空的必填项");
                    return(View(model));
                }
                model.CreatedAt = DateTime.Now;
                model.CreatedBy = "SYSTEM";
                var service = new BrokerAccountService();
                var r       = service.Create(model.Mobile, string.Concat(model.Mobile, "##"), model.CityNo, model.Name, model.FirmNo);

                if (r.HasError)
                {
                    FlashMessage(r);
                    return(View(model));
                }
                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                return(View());
            }
        }