public void SaveMemberBaseInfo(int MemberID, ProfileModel model) { Member member = FindMemberWithProfile(MemberID); DB_Service.Attach<Member>(member); Member_Profile mp = new Member_Profile(); if (member.Member_Profile != null) { mp = member.Member_Profile; } mp.MemberID = model.MemberID; mp.Borthday = model.Borthday; mp.CityCode = model.CityCode; mp.Description = model.Description; member.NickName = model.NickName; mp.RealName = model.RealName; mp.Sex = model.Sex; member.Member_Profile = mp; DB_Service.Commit(); SetLoginCookie(member); }
public ActionResult BaseInfo(ProfileModel model) { ViewBag.MenuItem = "baseinfo"; ServiceResult result = new ServiceResult(); if (ModelState.IsValid) { try { var memberID = Convert.ToInt32(CookieHelper.UID); memberService.SaveMemberBaseInfo(memberID, model); result.Message = "基本信息保存成功!"; TempData["Service_Result"] = result; } catch (Exception ex) { result.Message = Utilities.GetInnerMostException(ex); result.AddServiceError(result.Message); } } else { result.Message = "表单输入有误!"; result.AddServiceError("表单输入有误!"); } return View(model); }
public ActionResult BaseInfo() { ViewBag.MenuItem = "baseinfo"; var memberID = Convert.ToInt32(CookieHelper.UID); Member member = memberService.FindMemberWithProfile(memberID); if (member.Member_Profile == null) { member.Member_Profile = new Member_Profile(); } ProfileModel pm = new ProfileModel() { 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.CityCode, Sex = member.Member_Profile.Sex }; return View(pm); }
public ActionResult RegOk(ProfileModel model) { if (ModelState.IsValid) { try { var memberID = Convert.ToInt32(CookieHelper.UID); memberService.SaveMemberBaseInfo(memberID, model); member_MoneySerivce.AddMoney(memberID, 2, "0005"); return Redirect(Url.Action("activeemail")); } catch (Exception ex) { return View(model); } } else { return View(model); } }
public ActionResult RegOk() { var memberID = Convert.ToInt32(CookieHelper.UID); Member member = memberService.FindMemberWithProfile(memberID); if (member.Member_Profile == null) { member.Member_Profile = new Member_Profile(); } else { return Redirect(Url.Action("baseinfo", "personal")); } ProfileModel pm = new ProfileModel() { 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.CityCode, Sex = member.Member_Profile.Sex }; return View(pm); }
public ActionResult RegBiz(RegBizModel model) { if (ModelState.IsValid) { #region 注册用户并登录 try { RegisterModel rm = new RegisterModel() { Email = model.Email, NickName = model.NickName, Password = model.Password }; Member mb = memberService.Create(rm); memberService.SetLoginCookie(mb); ProfileModel pm = new ProfileModel() { CityCode = model.CityCode, Borthday = DateTime.Now, NickName = mb.NickName, RealName = model.LinkMan, Sex = model.Sex }; memberService.SaveMemberBaseInfo(mb.MemberID, pm); ContactModel cm = new ContactModel() { Address = model.Address, Email = model.Email, Mobile = model.Mobile, Phone = model.Phone, Position = model.Position }; memberService.SaveMemberContact(mb.MemberID, cm); CompanyReg cr = new CompanyReg() { Address = model.Address, BussinessCode = model.BussinessCode, CityCode = model.CityCode, Description = model.Description, FundCode = model.FundCode, LinkMan = model.LinkMan, Mobile = model.Mobile, Name = model.Name, Phone = model.Phone, Position = model.Position, ScaleCode = model.ScaleCode, Sex = model.Sex }; companyService.SaveBasInfo(mb.MemberID, cr); member_MoneySerivce.AddMoney(mb.MemberID, 4, "0006"); //memberService.SetLoginCookie(mb); return Redirect(Url.Action("regauth")); } catch (Exception ex) { throw ex; } #endregion } else { return View(model); } }