Ejemplo n.º 1
0
        public ActionResult BaseInfo()
        {
            ViewBag.MenuItem = "baseinfo";

            Member member = MemberService.GetALL().Single(x => x.MemberID == CookieHelper.MemberID);

            if (member.Member_Profile == null)
            {
                member.Member_Profile = new Member_Profile();
            }
            ProfileViewModel pm = new ProfileViewModel()
            {
                MemberID = member.MemberID,
                Borthday = member.Member_Profile.Borthday,
                Description = member.Member_Profile.Description,
                NickName = member.NickName,
                RealName = member.Member_Profile.RealName,
                CityCode = member.Member_Profile.CityCodeValue,
                Sex = member.Member_Profile.Sex
            };
            return View(pm);
        }
Ejemplo n.º 2
0
 public ActionResult BaseInfo(ProfileViewModel model)
 {
     ViewBag.MenuItem = "baseinfo";
     ServiceResult result = new ServiceResult();
     TempData["Service_Result"] = result;
     if (ModelState.IsValid)
     {
         try
         {
             MemberService.SaveMemberProfile(CookieHelper.MemberID, model);
             result.Message = "基本信息保存成功!";
         }
         catch (Exception ex)
         {
             result.Message = "基本信息保存失败!";
             result.AddServiceError(Utilities.GetInnerMostException(ex));
             LogHelper.WriteLog("用户:" + model.MemberID + "基本信息保存失败!", ex);
             return View(model);
         }
     }
     else
     {
         result.Message = "表单输入有误,请仔细填写表单!";
         result.AddServiceError("表单输入有误,请仔细填写表单!");
     }
     return View(model);
 }
Ejemplo n.º 3
0
        public ActionResult RegOk()
        {
            var memberID = CookieHelper.MemberID;

            Member member = MemberService.GetALL().Include(x => x.Member_Profile).Single(x => x.MemberID == memberID);

            if (member.Member_Profile == null)
            {
                member.Member_Profile = new Member_Profile();
            }
            else
            {
                return Redirect(Url.Action("baseinfo", "personal"));
            }
            ProfileViewModel pm = new ProfileViewModel()
            {
                MemberID = member.MemberID,
                Borthday = member.Member_Profile.Borthday,
                Description = member.Member_Profile.Description,
                NickName = member.NickName,
                RealName = member.Member_Profile.RealName,
                CityCode = member.Member_Profile.CityCodeValue,
                Sex = member.Member_Profile.Sex
            };
            return View(pm);
        }
Ejemplo n.º 4
0
 public ActionResult RegOk(ProfileViewModel model)
 {
     var memberID = CookieHelper.MemberID;
     if (ModelState.IsValid)
     {
         try
         {
             MemberService.SaveMemberProfile(memberID, model);
             return Redirect(Url.Action("activeemail"));
         }
         catch (Exception ex)
         {
             LogHelper.WriteLog("用户:" + memberID + "填写详细信息失败!", ex);
             TempData["FormError"] = true;
             return View(model);
         }
     }
     else
     {
         TempData["FormError"] = true;
         return View(model);
     }
 }
Ejemplo n.º 5
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);
     }
 }