示例#1
0
        public ActionResult Edit(int Id, MemberContext mem)
        {
            MemberDatabase.Member contact1 = mem.DbSet <Member>().Find(Id);


            return(View(contact1));
        }
示例#2
0
        // GET: Payment
        public ActionResult Index(MemberContext mem)
        {
            string username = User.Identity.Name;


            MemberDatabase.Member myMemberObj = new MemberDatabase.Member(); // unitOfWork.Repository<MemberDatabase.Member>();
            return(View(myMemberObj));
        }
示例#3
0
        public ActionResult Add(MemberDatabase.Member myMember, MemberContext mem)
        {
            mem.Members.Add(myMember);
            mem.SaveChanges();


            List <Member> memList = mem.DbSet <Member>().ToList();

            return(View("Index", memList));
        }
示例#4
0
        public ActionResult Update(MemberDatabase.Member myMember, MemberContext mem)
        {
            //var unitOfWork = new GenericRepository.UnitOfWork(mem);

            mem.DbSet <Member>().Add(myMember);

            //unitOfWork.Repository<MemberDatabase.Member>().Update(myMember);

            //  mem.Entry(myContact).Property(m => m.Username).IsModified = true;
            //            mem.Entry(myMember).Property(m => m.FirstName).IsModified = true;
            //          mem.Entry(myMember).Property(m => m.LastName).IsModified = true;
            //        mem.Entry(myMember).Property(m => m.Email).IsModified = true;

            mem.SaveChanges();


            return(RedirectToAction("Index", "Home"));
        }
示例#5
0
        public ActionResult Update(MemberDatabase.Member myMember, MemberContext mem)
        {
            //    unitOfWork.Repository<MemberDatabase.Member>().Update(myMember);

            //we dont want to expose this, we should handle this in the update method

            //  mem.Entry(myContact).Property(m => m.Username).IsModified = true;
            //       mem.Entry(myMember).Property(m => m.FirstName).IsModified = true;
            ///          mem.Entry(myMember).Property(m => m.LastName).IsModified = true;
//            mem.Entry(myMember).Property(m => m.Email).IsModified = true;

            //   unitOfWork.Save();

            List <Member> memList = mem.DbSet <Member>().ToList();


            return(View("Index", memList));
        }