Example #1
0
 internal bool Delete(Entity.ProfileStudent model)
 {
     try
     {
         using (var db = new Entity.Entities())
         {
             db.Entry(model).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return(true);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
Example #2
0
 internal bool EditeUser(Entity.User model)
 {
     try
     {
         using (var db = new Entity.Entities())
         {
             db.Entry(model).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
             return(true);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
Example #3
0
 internal bool CreateUser(Entity.User model)
 {
     try
     {
         using (var db = new Entity.Entities())
         {
             model.Usertype        = 3;
             db.Entry(model).State = System.Data.Entity.EntityState.Added;
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Example #4
0
 internal bool Create(Entity.Open_Subjects model, string id)
 {
     try
     {
         string tecger = id;
         using (var db = new Entity.Entities())
         {
             model.Teacher_id      = tecger;
             db.Entry(model).State = System.Data.Entity.EntityState.Added;
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Example #5
0
 internal bool Create(Entity.ProfileStudent model, int id)
 {
     try
     {
         int user = id;
         using (var db = new Entity.Entities())
         {
             model.User_id         = user;
             db.Entry(model).State = System.Data.Entity.EntityState.Added;
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Example #6
0
 internal bool Create(Entity.Register_Subjects model, string Stud)
 {
     try
     {
         using (var db = new Entity.Entities())
         {
             model.Stud_id         = Stud;
             model.Grad            = "I";
             db.Entry(model).State = System.Data.Entity.EntityState.Added;
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }