Example #1
0
 public Member Create(DetailsModel model)
 {
     Member member = new Member();
     member.Email = model.Email;
     member.NickName = model.NickName;
     member.AvtarUrl = model.AvtarUrl;
     member.GroupID = model.GroupID;
     member.Password = CheckHelper.StrToMd5(model.Password);
     member.Status = 1;//注册未激活,0为禁用
     member.AddTime = DateTime.Now;
     member.LastTime = DateTime.Now;
     member.AddIP = HttpHelper.IP;
     member.LastIP = HttpHelper.IP;
     member.Member_Profile = new Member_Profile();
     member.Member_Profile.Borthday = model.Borthday;
     member.Member_Profile.CityCode = model.CityCode;
     member.Member_Profile.Description = model.Description;
     member.Member_Profile.Sex = model.Sex;
     DB_Service.Add<Member>(member);
     DB_Service.Commit();
     return member;
 }
Example #2
0
        public ActionResult Create(DetailsModel model)
        {
            var groups = GetForeignData();
            ViewBag.Data_GroupID = groups;

            if (ModelState.IsValid)
            {
                try
                {
                    memberService.Create(model);
                    return RedirectToAction("index");
                }
                catch (Exception ex)
                {
                    ViewBag.Message = ex.Message;
                    return View(model);
                }
            }
            else
            {
                return View(model);
            }
        }