public bool delete_techno(int id)
 {
     using (english_projectEntities db = new english_projectEntities())
     {
         technos t = db.technos.Find(id);
         try
         {
             db.technos.Remove(t);
             db.SaveChanges();
         }
         catch
         {
             return(false);
         }
         return(true);
     }
 }
Exemple #2
0
 public bool delete_word(int id)
 {
     using (english_projectEntities db = new english_projectEntities())
     {
         words w = db.words.Find(id);
         try
         {
             db.words.Remove(w);
             db.SaveChanges();
         }
         catch
         {
             return(false);
         }
         return(true);
     }
 }
 public bool add_techno(string techno_name, bool techno_status, int users_id)
 {
     using (english_projectEntities db = new english_projectEntities())
     {
         technos x = db.technos.Add(new technos {
             techno_name = techno_name, techno_status = techno_status, users_id = users_id
         });
         try
         {
             db.SaveChanges();
         }
         catch
         {
             return(false);
         }
         return(true);
     }
 }
Exemple #4
0
 public bool add_word(int users_id, int technos_id, string word, string translation)
 {
     using (english_projectEntities db = new english_projectEntities())
     {
         db.words.Add(new words {
             users_id = users_id, technos_id = technos_id, word = word, translation = translation
         });
         try
         {
             db.SaveChanges();
         }
         catch
         {
             return(false);
         }
         return(true);
     }
 }
Exemple #5
0
 public bool add_test(int users_id, int correct, int total)
 {
     using (english_projectEntities db = new english_projectEntities())
     {
         tests x = db.tests.Add(new tests {
             users_id = users_id, correct = correct, total = total, created_datetime = DateTime.Now
         });
         try
         {
             db.SaveChanges();
         }
         catch
         {
             return(false);
         }
         return(true);
     }
 }
 public bool add_user(string username, string email, string pass)
 {
     using (english_projectEntities db = new english_projectEntities())
     {
         users x = db.users.Add(new users {
             username = username, email = email, pass = pass
         });
         try
         {
             db.SaveChanges();
         }
         catch
         {
             return(false);
         }
         return(true);
     }
 }
 public bool update_techno(int id, string techno_name, bool techno_status, int users_id)
 {
     using (english_projectEntities db = new english_projectEntities())
     {
         technos t = db.technos.Find(id);
         t.techno_name   = techno_name;
         t.techno_status = techno_status;
         t.users_id      = users_id;
         try
         {
             db.SaveChanges();
         }
         catch
         {
             return(false);
         }
         return(true);
     }
 }
Exemple #8
0
 public bool update_word(int id, int technos_id, string word, string translation)
 {
     using (english_projectEntities db = new english_projectEntities())
     {
         words w = db.words.Find(id);
         w.technos_id  = technos_id;
         w.word        = word;
         w.translation = translation;
         try
         {
             db.SaveChanges();
         }
         catch
         {
             return(false);
         }
         return(true);
     }
 }