예제 #1
0
        public ActionResult RegAuth(BizAuthViewModel model)
        {
            Member member = MemberService.Find(CookieHelper.MemberID);
            if (member.Status >= (int)MemberStatus.CompanyAuth)
            {
                return Content("<script>alert('您的企业已经认证通过了!');window.top.location='" + Url.Action("index", "personal") + "';</script>");
            }
            else
            {
                if (member.Status >= (int)MemberStatus.EmailActived)
                {
                    return Redirect(Url.Action("OpenBiz"));
                }
                Company cpy = CompanyService.Find(CookieHelper.MemberID);
                if (cpy == null)
                {
                    return Content("<script>alert('请先填写企业基本信息然后再填写认证信息!');window.top.location='" + Url.Action("openbiz") + "';</script>");
                }
                else
                {
                    ServiceResult result = new ServiceResult();

                    if (ModelState.IsValid)
                    {
                        try
                        {
                            CompanyService.UpdateAuthInfo(CookieHelper.MemberID, model);
                            return Redirect(Url.Action("BizActiveEmail"));
                        }
                        catch (Exception ex)
                        {
                            LogHelper.WriteLog("用户:" + member.MemberID + "填写认证信息失败!", ex);
                            TempData["FormError"] = true;
                            return View(model);
                        }
                    }
                    else
                    {
                        TempData["FormError"] = true;
                        return View(model);
                    }
                }
            }
        }
예제 #2
0
 public void UpdateAuthInfo(int MemberID, BizAuthViewModel model)
 {
     var company = Find(MemberID);
     db.Attach<Company>(company);
     company.LogoImg = model.LogoImg;
     company.LinkManImg = model.LinkManImg;
     company.CredentialsImg = model.CredentialsImg;
     company.IdentityCard = model.IdentityCard;
     company.Status = (int)CompanyStatus.CompanyApply;
     db.Commit();
 }