public bool Add(Location model)
 {
     try
     {
         _dbContext.Add(model);
         _dbContext.SaveChanges();
     }
     catch (System.Exception)
     {
         return(false);
     }
     return(true);
 }
Example #2
0
 public object Add(Machine model)
 {
     try
     {
         _machineDbContext.Add(model);
         _machineDbContext.SaveChanges();
     }
     catch (System.Exception)
     {
         return(new { status = false });
     }
     return(new { status = true, locations = _machineDbContext.location });
 }
 public bool Add(Student model)
 {
     try
     {
         _studentDbContext.Add(model);
         _studentDbContext.SaveChanges();
     }
     catch (System.Exception)
     {
         return(false);
     }
     return(true);
 }