コード例 #1
0
 public static bool setNumberUsed(PrescriptionNumber prescriptionNumber)
 {
     try
     {
         Model1 model = new Model1();
         prescriptionNumber.Used = true;
         model.Entry(prescriptionNumber).State = EntityState.Modified;
         model.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         Diagnostics.insertToDb(new Diagnostics("PrescriptionNumber.setNumberUsed()", e.ToString()));
         return(false);
     }
 }
コード例 #2
0
 public bool edit(Patient patient)
 {
     try
     {
         Model1 model = new Model1();
         Name     = patient.Name;
         Lastname = patient.Lastname;
         PESEL    = patient.PESEL;
         model.Entry(patient).State = EntityState.Modified;
         model.SaveChanges();
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(false);
     }
     return(true);
 }