示例#1
0
        public object GetActiveTest(int id)
        {
            HepaticTest test = (from q in db.HepaticTest
                                where q.heptest_id == id
                                select q).FirstOrDefault();

            return(test);
        }
示例#2
0
 private void FillBlTest(HepaticTest h)
 {
     if (bilTB.Text.Trim() != "")
     {
         h.heptest_bilir = Convert.ToDouble(bilTB.Text.Replace('.', ','));
     }
     else
     {
         h.heptest_bilir = null;
     }
     if (timTB.Text.Trim() != "")
     {
         h.heptest_timil = Convert.ToInt32(timTB.Text);
     }
     else
     {
         h.heptest_timil = null;
     }
     if (altTB.Text.Trim() != "")
     {
         h.heptest_alt = Convert.ToDouble(altTB.Text.Replace('.', ','));
     }
     else
     {
         h.heptest_alt = null;
     }
     if (astTB.Text.Trim() != "")
     {
         h.heptest_ast = Convert.ToInt32(astTB.Text);
     }
     else
     {
         h.heptest_ast = null;
     }
     if (uraTB.Text.Trim() != "")
     {
         h.heptest_uricasid = Convert.ToInt32(uraTB.Text);
     }
     else
     {
         h.heptest_uricasid = null;
     }
     if (kreatTB.Text.Trim() != "")
     {
         h.heptest_kreat = Convert.ToInt32(kreatTB.Text);
     }
     else
     {
         h.heptest_kreat = null;
     }
 }
示例#3
0
        public void UpdateTest(object o)
        {
            HepaticTest b    = o as HepaticTest;
            HepaticTest oldb = (from q in db.HepaticTest
                                where q.heptest_id == b.heptest_id
                                select q).FirstOrDefault();

            oldb.heptest_bilir    = b.heptest_bilir;
            oldb.heptest_kreat    = b.heptest_kreat;
            oldb.heptest_timil    = b.heptest_timil;
            oldb.heptest_uricasid = b.heptest_uricasid;
            oldb.heptest_alt      = b.heptest_alt;
            oldb.heptest_ast      = b.heptest_ast;
            ChangeStateToClosed(oldb.heptest_id);
            db.SaveChanges();
        }
示例#4
0
        public void PlanNewTest(DateTime date, int pid)
        {
            HepTest___Patient bl = new HepTest___Patient();

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

            db.HepaticTest.Add(test);
            bl.htp_patid  = pid;
            bl.htp_testid = test.heptest_id;
            db.HepTest___Patient.Add(bl);
            db.SaveChanges();
        }
示例#5
0
        public int DeleteTest(int id)
        {
            HepTest___Patient bl = (from q in db.HepTest___Patient
                                    where (q.htp_id == id)
                                    select q).FirstOrDefault();
            int testid = bl.htp_testid;

            db.HepTest___Patient.Remove(bl);
            db.SaveChanges();
            HepaticTest test = (from q in db.HepaticTest
                                where q.heptest_id == testid
                                select q).FirstOrDefault();

            if (test != null)
            {
                db.HepaticTest.Remove(test);
                db.SaveChanges();
            }
            return(testid);
        }
示例#6
0
        public override void Plan(DateTime date)
        {
            try
            {
                HepTest___Patient b    = new HepTest___Patient();
                HepaticTest       test = new HepaticTest();
                ctx.HepaticTest.Add(test);

                b.htp_patid  = pat.p_id;
                b.htp_state  = (from c in ctx.State where (c.state_value == "заплановано") select c.state_id).FirstOrDefault();
                b.htp_date   = date.Date;
                b.htp_testid = test.heptest_id;
                ctx.HepTest___Patient.Add(b);
                ctx.SaveChanges();
                Renew();
            }
            catch
            {
                MessageBox.Show("Помилка при плануванні");
            }
        }
示例#7
0
        public HepatTestForm(int testid, DateTime date, mode _m)
        {
            InitializeComponent();

            ctx  = new TubDataBaseEntities();
            m    = _m;
            test = testid;
            hp   = (from c in ctx.HepaticTest where (c.heptest_id == testid) select c).FirstOrDefault();
            if (m == mode.Redact)
            {
                this.StatusL.Text = "Завершено " + date.ToShortDateString();
                LoadTest(testid);
            }
            else if (m == mode.Create)
            {
                this.StatusL.Text = "Закінчити тест за " + date.ToShortDateString();
            }
            else if (m == mode.Losed)
            {
                this.StatusL.Text = "Пропущений тест за " + date.ToShortDateString();
            }
        }
示例#8
0
 public ActionResult UpdateHepaticTest(HepaticTest hepat)
 {
     HelperSelector.get(model.ViewName).UpdateTest(hepat);
     model.Single = null;
     return(redirect());
 }