public ActionResult OpenBiz(OpenBizViewModel model) { Member member = MemberService.Find(CookieHelper.MemberID); if (ModelState.IsValid) { try { if (member.Status < (int)MemberStatus.EmailActived) { return Content("<script>alert('您的邮箱还未绑定,请先绑定邮箱再进行企业认证!');window.top.location='" + Url.Action("activeemail") + "';</script>"); } else { if (member.Status >= (int)MemberStatus.CompanyAuth) { return Content("<script>alert('您的企业已经认证通过了!');window.top.location='" + Url.Action("index", "personal") + "';</script>"); } else { var company = CompanyService.Find(member.MemberID); if (company == null) { CompanyRegViewModel reg = new CompanyRegViewModel() { Address = model.Address, CityCode = model.CityCode, Description = model.Description, LinkMan = model.LinkMan, Mobile = member.Mobile, Name = model.Name, //Phone = model.Phone, Position = model.Position, Sex = model.Sex, LinkManImg = model.LinkManImg, CredentialsImg = model.CredentialsImg, LogoImg = model.LogoImg, IdentityCard = model.IdentityCard }; CompanyService.Create(reg); } else { CompanyRegViewModel reg = new CompanyRegViewModel() { Address = model.Address, CityCode = model.CityCode, Description = model.Description, LinkMan = model.LinkMan, Mobile = member.Mobile, Name = model.Name, //Phone = model.Phone, Position = model.Position, Sex = model.Sex, LinkManImg = model.LinkManImg, CredentialsImg = model.CredentialsImg, LogoImg = model.LogoImg, IdentityCard = model.IdentityCard, Fax = company.Fax, MSN = company.MSN, QQ = company.QQ }; CompanyService.Update(reg); } } } return Redirect(Url.Action("bizOk")); } catch (Exception ex) { LogHelper.WriteLog("用户:" + member.MemberID + "开通企业注册失败!", ex); TempData["FormError"] = true; return View(model); } } else { TempData["FormError"] = true; return View(model); } }
public ActionResult OpenBiz() { var member = MemberService.Find(CookieHelper.MemberID); if (member.Status < (int)MemberStatus.EmailActived) { return Content("<script>alert('您的邮箱还未绑定,请先绑定邮箱再进行企业认证!');window.top.location='" + Url.Action("activeemail") + "';</script>"); } else { if (member.Status >= (int)MemberStatus.CompanyAuth) { return Content("<script>alert('您的企业已经认证通过了!');window.top.location='" + Url.Action("index", "personal") + "';</script>"); } else { var company = CompanyService.Find(member.MemberID); if (company == null) { return View(new OpenBizViewModel()); } else { var model = new OpenBizViewModel() { Address = company.Address, CityCode = company.CityCodeValue, Description = company.Description, LinkMan = company.LinkMan, //Mobile = mem.Mobile, Name = company.Name, //Phone = company.Phone, Position = company.Lat + "|" + company.Lng, Sex = company.Sex, CredentialsImg = company.CredentialsImg, IdentityCard = company.IdentityCard, LogoImg = company.LogoImg, LinkManImg = company.LinkManImg }; return View(model); } } } }