public bool Add(Location model)
 {
     try
     {
         _dbContext.Add(model);
         _dbContext.SaveChanges();
     }
     catch (System.Exception)
     {
         return(false);
     }
     return(true);
 }
示例#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 });
 }
示例#3
0
 public bool Add(Student model)
 {
     try
     {
         _studentDbContext.Add(model);
         _studentDbContext.SaveChanges();
     }
     catch (System.Exception)
     {
         return(false);
     }
     return(true);
 }