Ejemplo n.º 1
0
        public void PlanNewTest(DateTime date, int pid)
        {
            BlTest___Patient bl = new BlTest___Patient();

            bl.bltp_state = (from q in db.State where q.state_value == "заплановано" select q.state_id).FirstOrDefault();
            bl.bltp_date  = date;
            BloodTest test = new BloodTest();

            db.BloodTest.Add(test);
            bl.bltp_patid  = pid;
            bl.bltp_testid = test.bltest_id;
            db.BlTest___Patient.Add(bl);
            db.SaveChanges();
        }
Ejemplo n.º 2
0
        public ActionResult AddPatient(Patients p)
        {
            if (ModelState.IsValid)
            {
                db.Patients.Add(p);
                db.SaveChanges();

                return(RedirectToAction("PatientsTable"));
            }
            else
            {
                return(View(p));
            }
        }
Ejemplo n.º 3
0
        public static void RefreshTests()
        {
            TubDataBaseEntities     db    = new TubDataBaseEntities();
            List <BlTest___Patient> blood = (from q in db.BlTest___Patient
                                             where q.State.state_value == "заплановано"
                                             select q).ToList();

            foreach (BlTest___Patient b in blood)
            {
                if (b.bltp_date.Date < DateTime.Now.Date)
                {
                    b.bltp_state = (from q in db.State where q.state_value == "пропущено" select q.state_id).FirstOrDefault();
                }
            }
            List <UrTest__Patient> urina = (from q in db.UrTest__Patient
                                            where q.State.state_value == "заплановано"
                                            select q).ToList();

            foreach (UrTest__Patient u in urina)
            {
                if (u.utp_date.Date < DateTime.Now.Date)
                {
                    u.utp_state = (from q in db.State where q.state_value == "пропущено" select q.state_id).FirstOrDefault();
                }
            }
            List <HepTest___Patient> hepat = (from q in db.HepTest___Patient
                                              where q.State.state_value == "заплановано"
                                              select q).ToList();

            foreach (HepTest___Patient h in hepat)
            {
                if (h.htp_date.Date < DateTime.Now.Date)
                {
                    h.htp_state = (from q in db.State where q.state_value == "пропущено" select q.state_id).FirstOrDefault();
                }
            }
            List <SputumTest___Patient> sputum = (from q in db.SputumTest___Patient
                                                  where q.State.state_value == "заплановано"
                                                  select q).ToList();

            foreach (SputumTest___Patient s in sputum)
            {
                if (s.sptp_date.Date < DateTime.Now.Date)
                {
                    s.sptp_state = (from q in db.State where q.state_value == "пропущено" select q.state_id).FirstOrDefault();
                }
            }
            List <Consult___Patient> consult = (from q in db.Consult___Patient
                                                where q.State.state_value == "заплановано"
                                                select q).ToList();

            foreach (Consult___Patient c in consult)
            {
                if (c.cp_date.Date < DateTime.Now.Date)
                {
                    c.cp_state = (from q in db.State where q.state_value == "пропущено" select q.state_id).FirstOrDefault();
                }
            }
            db.SaveChanges();
        }
Ejemplo n.º 4
0
        public void PlanNewTest(DateTime date, int pid)
        {
            UrTest__Patient ur = new UrTest__Patient();

            ur.utp_state = (from q in db.State
                            where q.state_value == "заплановано"
                            select q.state_id).FirstOrDefault();
            ur.utp_date = date;
            UrineTest test = new UrineTest();

            db.UrineTest.Add(test);
            ur.utp_patid  = pid;
            ur.utp_testid = test.urtest_id;
            db.UrTest__Patient.Add(ur);
            db.SaveChanges();
        }
Ejemplo n.º 5
0
        public override void Delete()
        {
            ctx = new TubDataBaseEntities();
            ctx.BlTest___Patient.Load();
            var b = (from c in ctx.BlTest___Patient where (c.bltp_id == ((BlTest___Patient)data.Current).bltp_id) select c).FirstOrDefault();

            ctx.BlTest___Patient.Remove(b);
            ctx.SaveChanges();
            Renew();
        }
Ejemplo n.º 6
0
        public void PlanNewTest(DateTime date, int pid)
        {
            Consult___Patient bl = new Consult___Patient();

            bl.cp_state = (from q in db.State
                           where q.state_value == "заплановано"
                           select q.state_id).FirstOrDefault();
            bl.cp_date = date;
            Consultation test = new Consultation();

            db.Consultation.Add(test);
            bl.cp_patid  = pid;
            bl.cp_consid = test.cons_id;
            db.Consult___Patient.Add(bl);
            db.SaveChanges();
        }