Beispiel #1
0
        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);
        }
Beispiel #2
0
        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];
        }
Beispiel #3
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);
        }
Beispiel #4
0
        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);
                }
            }
        }
Beispiel #5
0
        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);
                }
            }
        }