private static void InsertMedical(DSModel db, KeyBinder key, DriverMedicalModel model) { DriversMedical poco = new DriversMedical(); model.Map(poco); db.Add(poco); key.AddKey(poco, model, model.GetName(p => p.DriverMedicalID)); db.FlushChanges(); SaveReminders(db, key, model, poco); }
private static void UpdateMedical(DSModel db, KeyBinder key, DriverMedicalModel model) { var poco = db.DriversMedicals .Where(m => m.DriverMedicalID == model.DriverMedicalID) .FirstOrDefault(); model.Map(poco); db.FlushChanges(); SaveReminders(db, key, model, poco); }