コード例 #1
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     if (id != 0)
     {
         BlackListMember BlackListMembers = _entities.BlackListMembers.Single(a => a.ID == id);
         _entities.DeleteObject(BlackListMembers);
         _entities.SaveChanges();
     }
     return(View("Deleted"));
 }
コード例 #2
0
        public ActionResult Create(FormCollection collection, BlackListMember BlackListMember)
        {
            try
            {
                //BlackListMember.MemberD = Guid.Parse(collection.GetValues("BlackListMember.MemberID")[0]);
                _entities.AddToBlackListMembers(BlackListMember);
                _entities.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }