예제 #1
0
 public bool Delete(Info info)
 {
     try
     {
         Info change = context.Infoes.Where(c => c.Name == info.Name).ToList().FirstOrDefault();
         if (change != null)
             context.Infoes.Remove(info);
         context.SaveChanges();
         return false;
     }
     catch (Exception)
     {
         return false;
     }
 }
예제 #2
0
        public bool Create(Info info)
        {
            try
            {
                context = new StudentDBEntities();
                context.Infoes.Add(info);
                context.SaveChanges();
                return true;
            }
            catch (Exception)
            {

                return false;
            }
        }
예제 #3
0
 public bool Update(Info info)
 {
     context = new StudentDBEntities();
     try
     {
         Info change = context.Infoes.Where(c => c.Name == info.Name).ToList().FirstOrDefault();
         if (change != null)
             change = info;
         context.SaveChanges();
         return true;
     }
     catch (Exception)
     {
         return false;       
     }
 }
 public bool Delete(Info info)
 {
     throw new NotImplementedException();
 }