public List <Client> getClients() { List <Client> list = new List <Client>(); using (var db = new MedicModel()) { list = db.Clients.ToList(); } return(list); }
public List <Laborant> getLaborants() { List <Laborant> list = new List <Laborant>(); using (var db = new MedicModel()) { list = db.Laborants.ToList(); } return(list); }
private async Task getChars() { await Task.Run(() => { using (var db = new MedicModel()) { list = db.BarcodeChars.ToList(); } } ); }
public void AddClient(Client client) { using (var db = new MedicModel()) { try { db.Clients.Add(client); db.SaveChanges(); } finally { db.Dispose(); } } }
public void AddLaborant(Laborant Laborant) { using (var db = new MedicModel()) { try { db.Laborants.Add(Laborant); db.SaveChanges(); } finally { db.Dispose(); } } }
public void AddAnalizeBlood(AnalizeBlood AnalizeBlood) { using (var db = new MedicModel()) { try { db.AnalizeBloods.Add(AnalizeBlood); db.SaveChanges(); } finally { db.Dispose(); } } }
public void AddAnalizeShit(AnalizeShit AnalizeShit) { using (var db = new MedicModel()) { try { db.AnalizeShits.Add(AnalizeShit); db.SaveChanges(); } finally { db.Dispose(); } } }
public void AddAnalizeMocha(AnalizeMocha AnalizeMocha) { using (var db = new MedicModel()) { try { db.AnalizeMochas.Add(AnalizeMocha); db.SaveChanges(); } finally { db.Dispose(); } } }
public void DeleteClient(Client client) { using (var db = new MedicModel()) { try { db.Entry(client.User).State = EntityState.Deleted; db.Entry(client).State = EntityState.Deleted; db.SaveChanges(); } finally { db.Dispose(); } } }
public void UpdateLaborant(Laborant Laborant) { using (var db = new MedicModel()) { try { db.Entry(Laborant.User).State = EntityState.Modified; db.Entry(Laborant).State = EntityState.Modified; db.SaveChanges(); } finally { db.Dispose(); } } }
public void DeleteAnalizeBlood(AnalizeBlood AnalizeBlood) { using (var db = new MedicModel()) { try { db.Entry(AnalizeBlood.Analizi).State = EntityState.Deleted; db.Entry(AnalizeBlood).State = EntityState.Deleted; db.SaveChanges(); } finally { db.Dispose(); } } }
public void UpdateAnalizeShit(AnalizeShit AnalizeShit) { using (var db = new MedicModel()) { try { db.Entry(AnalizeShit.Analizi).State = EntityState.Modified; db.Entry(AnalizeShit).State = EntityState.Modified; db.SaveChanges(); } finally { db.Dispose(); } } }
public List <Client> GetClients() { var list = new List <Client>(); MedicModel db = null; using (db = new MedicModel()) { try { list = db.Clients.Include(e => e.User).ToList(); } finally { db.Dispose(); }; } return(list); }
public List <Laboratory> GetLaboratories() { var list = new List <Laboratory>(); MedicModel db = null; using (db = new MedicModel()) { try { list = db.Laboratories.ToList(); } finally { db.Dispose(); }; } return(list); }
public List <AnalizeBlood> GetAnalizeBloods() { var list = new List <AnalizeBlood>(); MedicModel db = null; using (db = new MedicModel()) { try { list = db.AnalizeBloods.Include(e => e.Analizi.Client).Include(e => e.Analizi.Laborant).ToList(); } finally { db.Dispose(); }; } return(list); }
/// <summary> /// Метод для входа /// </summary> /// <param name="login"></param> /// <param name="password"></param> /// <returns>Id Роли аккаунта (-1 - Пользователь не найден)</returns> public int Auth(string login, string password) { int id = -1; using (var db = new MedicModel()) { var task = db.Users.FirstOrDefault(e => e.Login == login && e.Password == password); var user = task; if (user != null) { id = user.IdType; } } if (id == -1) { throw new Exception("Неверный логин или пароль"); } return(id); }