예제 #1
0
 public ActionResult Create(Bids.Models.Member member)
 {
     if (ModelState.IsValid)
     {
         //db.Members.Add(member);
         //db.SaveChanges();
         unitOfWork.MemberRepository.Insert(member);
         unitOfWork.Save();
         return(RedirectToAction("Index"));
     }
     return(View(member));
 }
예제 #2
0
 public ActionResult Edit(Member member)
 {
     if (ModelState.IsValid)
     {
         //db.Entry(member).State = System.Data.EntityState.Modified;
         //db.SaveChanges();
         //memberRepository.UpdateMember(member);
         //memberRepository.Save();
         unitOfWork.MemberRepository.Update(member);
         unitOfWork.Save();
         return RedirectToAction("Index");
     }
     return View(member);
 }
예제 #3
0
 void IMemberRepository.UpdateMember(Member member)
 {
     context.Entry(member).State = System.Data.EntityState.Modified;
 }
예제 #4
0
 void IMemberRepository.InsertMember(Member member)
 {
     context.Members.Add(member);
 }