Example #1
0
 public bool UpdateMedWorker(MedWorker MedWorker)
 {
     using (ApplicationContext context = new ApplicationContext())
     {
         try
         {
             context.MedWorkers.Update(MedWorker);
             context.SaveChanges();
             return(true);
         }catch (Exception e)
         {
             Console.WriteLine(e.Message);
             return(false);
         }
     }
 }
Example #2
0
 public int CreateMedWorker(MedWorker MedWorker)
 {
     using (ApplicationContext context = new ApplicationContext())
     {
         try
         {
             context.MedWorkers.Add(MedWorker);
             context.SaveChanges();
             return(MedWorker.Id);
         }catch (Exception e)
         {
             Console.WriteLine(e.Message);
             return(-1);
         }
     }
 }