public Laborant LogIn(string login, string password) { Laborant l = null; List <Laborant> listLaborant = getLaborants(); if (listLaborant != null) { l = listLaborant.FirstOrDefault(w => w.login == login && w.password == password); } return(l); }
public AnalysisResult(Analysis an, Patient pat, Laborant lab, string res) { Analis = an; Pat = pat; Labt = lab; result = res; //кодируем ИД результата Random rnd = new Random(); resID = "" + rnd.Next(1000, 10000) + an.name.ToArray()[0] + pat.IIN.ToArray()[0] + lab.id.ToString().ToArray()[0]; }
public Laborant LogOn(string Login, string Password) { Laborant lb = null; List <Laborant> lbs = GetWorkers(); if (lbs != null) { lb = lbs.FirstOrDefault(w => w.LogIn == Login && w.Password == Password); } return(lb); }
public void CreateLabWorkers(Laborant lb) { List <Laborant> lbs = GetWorkers(); if (lbs == null) { lbs = new List <Laborant>(); } lbs.Add(lb); XmlSerializer formatter = new XmlSerializer(typeof(Laborant[])); using (FileStream fs = new FileStream(WorkersUrl + @"\Labworkers.xml", FileMode.OpenOrCreate)) { try { formatter.Serialize(fs, lbs.ToArray()); } catch (Exception ex) { Console.WriteLine(ex.Message); } } }
public void createLaborant(Laborant l) { List <Laborant> listLaborants = getLaborants(); if (listLaborants == null) { listLaborants = new List <Laborant>(); } listLaborants.Add(l); XmlSerializer formatter = new XmlSerializer(typeof(Laborant[])); using (FileStream fs = new FileStream(pathToLaborants, FileMode.OpenOrCreate)) { try { formatter.Serialize(fs, listLaborants.ToArray()); } catch (Exception ex) { Console.WriteLine(ex.Message); } } }