Exemplo n.º 1
0
 public ActionResult RegBiz(RegBizViewModel model)
 {
     if (ModelState.IsValid)
     {
         #region 注册用户并登录
         try
         {
             RegViewModel rm = new RegViewModel()
             {
                 Email = model.Email,
                 NickName = model.NickName,
                 Password = model.Password,
                 Mobile = model.Mobile,
                 MemberType = 2
             };
             Member mb = MemberService.Create(rm);
             MemberService.SetLoginCookie(mb);
             ProfileViewModel pm = new ProfileViewModel()
             {
                 CityCode = model.CityCode,
                 Borthday = DateTime.Now,
                 NickName = mb.NickName,
                 RealName = model.LinkMan,
                 Sex = model.Sex
             };
             MemberService.SaveMemberProfile(mb.MemberID, pm);
             ContactViewModel cm = new ContactViewModel()
             {
                 Address = model.Address,
                 Email = model.Email,
                 Mobile = model.Mobile,
                 //Phone = model.Phone,
                 Position = model.Position
             };
             MemberService.SaveMemberContact(mb.MemberID, cm);
             CompanyRegViewModel cr = new CompanyRegViewModel()
             {
                 Address = model.Address,
                 CityCode = model.CityCode,
                 Description = model.Description,
                 LinkMan = model.LinkMan,
                 Mobile = model.Mobile,
                 Name = model.Name,
                 //Phone = model.Phone,
                 Position = model.Position,
                 Sex = model.Sex
             };
             CompanyService.SaveBasInfo(mb.MemberID, cr);
             return Redirect(Url.Action("regauth"));
         }
         catch (Exception ex)
         {
             LogHelper.WriteLog("用户:" + model.Email + "企业注册失败!", ex);
             TempData["FormError"] = true;
             return View(model);
         }
         #endregion
     }
     else
     {
         TempData["FormError"] = true;
         return View(model);
     }
 }
Exemplo n.º 2
0
 public ActionResult Index(RegViewModel model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             Member mb = MemberService.Create(model);
             MemberService.SetLoginCookie(mb);
             //if (mb.MemberType == (int)MemberType.Source)
             //{
             //    return Redirect(Url.Action("openbiz"));
             //}
             return Redirect(Url.Action("regok"));
         }
         catch (Exception ex)
         {
             LogHelper.WriteLog("用户:" + model.Email + "注册失败!", ex);
             TempData["FormError"] = true;
             return View(model);
         }
     }
     else
     {
         TempData["FormError"] = true;
         return View(model);
     }
 }
Exemplo n.º 3
0
        public ActionResult RegAuto(RegViewModel model)
        {
            if (ModelState.IsValid)
            {
                #region 注册用户并登录
                try
                {
                    Member mb = MemberService.Create(model);

                    MemberService.SetLoginCookie(mb);

                    return Redirect(Url.Action("regok"));

                }
                catch (Exception ex)
                {
                    LogHelper.WriteLog("用户:" + model.Email + "注册失败!", ex);
                    TempData["FormError"] = true;
                    return View(model);
                }
                #endregion
            }
            else
            {
                TempData["FormError"] = true;
                return View(model);
            }
        }
Exemplo n.º 4
0
        public ActionResult Index()
        {
            var model = new RegViewModel();

            ViewBag.Data_MemberType = UIHelper.MemberTypeList;

            return View(model);
        }