Ejemplo n.º 1
0
 public ActionResult Delete(int id)
 {
     using (MemberManageEntities db = new MemberManageEntities())
     {
         var member = db.Member.Where(p => p.ID == id).First();
         db.DeleteObject(member);
         db.SaveChanges();
     }
     return(RedirectToAction("Show", "Account"));
 }
Ejemplo n.º 2
0
 public ActionResult Edit(MemberForm UpdateMember)
 {
     using (MemberManageEntities db = new MemberManageEntities())
     {
         var member = db.Member.Where(p => p.Account == UpdateMember.Account);
         ((MemberForm)member).ChName   = UpdateMember.ChName;
         ((MemberForm)member).NickName = UpdateMember.NickName;
         ((MemberForm)member).Email    = UpdateMember.Email;
         db.SaveChanges();
     }
     return(RedirectToAction("Show", "Account"));
 }
Ejemplo n.º 3
0
        public ActionResult CreateMember(MemberForm member)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction("Register", "Account"));
            }
            MemberManageEntities db = new MemberManageEntities();

            db.AddToMember(new Member()
            {
                Account    = member.Account,
                Password   = member.Password,
                ChName     = member.ChName,
                NickName   = member.NickName,
                Email      = member.Email,
                CreateTime = DateTime.Now
            });

            db.SaveChanges();

            FormsService.SignIn(member.ChName);

            return(RedirectToAction("Show", "Account"));
        }