public ActionResult Register(RegisterModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var remark = new  StringBuilder();
                    remark.Append(string.Format("公司名称:{0}", model.CompanyName));
                    remark.Append("<br/>");
                    remark.Append(string.Format("公司地址:{0}", model.CompanyAddress));
                    remark.Append("<br/>");
                    remark.Append(string.Format("公司联系人:{0}", model.CompanyLinkman));
                    remark.Append("<br/>");
                    remark.Append(string.Format("公司联系电话:{0}", model.CompanyLinkmanPhone));
                    remark.Append("<br/>");
                    if(string.IsNullOrEmpty(model.ApplicationId))
                    {
                        ModelState.AddModelError("", "申请账户没有应用来源ID,不能申请注册,请联系系统管理员!");

                        return View(model);
                    }
                    var client = _clientManager.GetClientByApplicationId(model.ApplicationId);
                    if(client!=null)
                    {
                        remark.Append("<br/>");
                        remark.Append(string.Format("来自:{0}", client.Name));
                    }
                    else
                    {
                        ModelState.AddModelError("", "申请账户的应用来源有错误,不能申请注册,请联系系统管理员!");
                        return View(model);
                    }

                    _accountRegisterManager.Register(new AccountRegisterInfo
                    {
                        CompanyName = model.CompanyName,
                        Name = model.Name,
                        LoginName = model.LoginName,
                        LoginPassword = model.LoginPassword,
                        Gender = model.Gender,
                        Age = model.Age,
                        Birthday = model.Birthday,
                        MobilePhone = model.MobilePhone,
                        Email = model.Email,
                        Telephone = model.Telephone,
                        CreateDate = DateTime.Now,
                        Remark = remark.ToString(),
                        ApplicationId=model.ApplicationId
                    });
                    var redreict = string.IsNullOrEmpty(model.redirect_uri)?client.Host:model.redirect_uri;
                    return RedirectToAction("RegisterSuccess", new RouteValueDictionary { { "ln", model.Name }, { "redirect_uri", redreict } });
                }
                catch (Exception ex)
                {
                    Logger.Error(ex, "用户申请注册时发生错误。");
                    ModelState.AddModelError("", _translation.T("UserRegisterError"));
                }
            }
            return View(model);
        }
 public ActionResult Register(string redirect_uri,string applicationId)
 {
     var model = new RegisterModel()
                     {ApplicationId = applicationId,
                         redirect_uri = redirect_uri
                     };
     if (string.IsNullOrEmpty(applicationId))
     {
         ModelState.AddModelError("", "申请账户链接没有应用来源ID,不能申请注册,请联系系统管理员!");
         ViewBag.Error = true;
         return View(model);
     }
     var client = _clientManager.GetClientByApplicationId(model.ApplicationId);
     if (client == null)
     {
         ModelState.AddModelError("", "申请账户的应用来源有错误,不能申请注册,请联系系统管理员!");
         ViewBag.Error = true;
         return View(model);
     }
     return View(model);
 }