Пример #1
0
        public ConsultationForm(int testid, DateTime date, int sel_type, mode _m)
        {
            InitializeComponent();


            ctx = new TubDataBaseEntities();
            m   = _m;
            ctx.ConsultationType.Load();
            consultationTypeBindingSource.DataSource = ctx.ConsultationType.Local.ToBindingList();
            test = testid;
            typeCB.SelectedValue = sel_type;
            typeCB.Enabled       = false;
            con = (from c in ctx.Consultation where (c.cons_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();
            }
        }
Пример #2
0
        private void DeletePatientBut_Click(object sender, EventArgs e)
        {
            ctx.Dispose();
            ctx = new TubDataBaseEntities();
            ctx.Patients.Load();
            DialogResult d = MessageBox.Show("Ви впевнені, що бажаєте видалити цього пацієнта?", "Видалення", MessageBoxButtons.YesNo);

            if (d == DialogResult.Yes)
            {
                var p = (from c in ctx.Patients where (c.p_id == patient.p_id) select c).FirstOrDefault();
                int a = (from c in ctx.BlTest___Patient where (c.bltp_patid == patient.p_id) select c).Count() +
                        (from c in ctx.UrTest__Patient where (c.utp_patid == patient.p_id) select c).Count() +
                        (from c in ctx.HepTest___Patient where (c.htp_patid == patient.p_id) select c).Count() +
                        (from c in ctx.SputumTest___Patient where (c.sptp_patid == patient.p_id) select c).Count() +
                        (from c in ctx.Consult___Patient where (c.cp_patid == patient.p_id) select c).Count();

                if (a == 0)
                {
                    ctx.Patients.Remove(p);
                    ctx.SaveChanges();
                    MessageBox.Show("Пацієнта видалено");
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("До пацієнта прив'язані аналізи, видаляти заборонено");
                }
            }
        }
Пример #3
0
        public AnalysisViewer(DataLibrary.TubDataBaseEntities _ctx, Patients _pat)
        {
            InitializeComponent();

            ctx = _ctx;
            pat = _pat;

            ctx.ConsultationType.Load();
            docCB.DataSource = ctx.ConsultationType.Local.ToBindingList();

            blood   = new Blood(pat, BloodDGV, StateFCB);
            urina   = new Urina(pat, UrinaDGV, StateFCB);
            hepatic = new Hepatic(pat, HepaticDGV, StateFCB);
            sputum  = new Sputum(pat, SputumDGV, StateFCB);
            cons    = new Consultations(pat, ConsDGV, StateFCB, docCB);

            StateFCB.SelectedIndex = 0;

            PlanBloodDT.MinDate = DateTime.Today;
            PlanUrDT.MinDate    = DateTime.Today;
            PlanHepatDT.MinDate = DateTime.Today;
            PlanSputDT.MinDate  = DateTime.Today;
            PlanConsDT.MinDate  = DateTime.Today;

            this.BloodDGV.CellDoubleClick   += new System.Windows.Forms.DataGridViewCellEventHandler(this.BloodDGV_CellContentClick);
            this.UrinaDGV.CellDoubleClick   += new System.Windows.Forms.DataGridViewCellEventHandler(this.UrinaDGV_CellContentClick);
            this.HepaticDGV.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.HepaticDGV_CellContentClick);
            this.SputumDGV.CellDoubleClick  += new System.Windows.Forms.DataGridViewCellEventHandler(this.SputumDGV_CellContentClick);
            this.ConsDGV.CellDoubleClick    += new System.Windows.Forms.DataGridViewCellEventHandler(this.ConsDGV_CellContentClick);

            Renew();
        }
Пример #4
0
        public void ClearFilter()
        {
            foreach (Control c in this.Controls)
            {
                if (c is TextBox)
                {
                    c.Text    = "";
                    c.Enabled = false;
                }
                else if (c is ComboBox)
                {
                    ((ComboBox)c).SelectedIndex = 0;
                    c.Enabled = false;
                }

                else if (c is DateTimePicker)
                {
                    ((DateTimePicker)c).Value = DateTime.Today.Date;
                    c.Enabled = false;
                }
            }
            ctx.Dispose();
            ctx = new TubDataBaseEntities();
            ctx.Patients.Load();

            bind.DataSource = ctx.Patients.Local.ToBindingList();
        }
Пример #5
0
        private void Search()
        {
            ctx.Dispose();

            ctx = new TubDataBaseEntities();
            var query = (from c in ctx.Patients select c);

            if (SurnameTB.Enabled == true)
            {
                query = query.Where(c => c.p_surname.Contains(SurnameTB.Text));
            }
            if (NameTB.Enabled == true)
            {
                query = query.Where(c => c.p_name.Contains(NameTB.Text));
            }
            if (GenderCB.Enabled == true)
            {
                query = query.Where(c => c.p_genderId == (int)GenderCB.SelectedValue);
            }
            if (BirthDT.Enabled == true)
            {
                query = query.Where(c => c.p_birthday == (DateTime)BirthDT.Value.Date);
            }
            if (DiagnosisCB.Enabled == true)
            {
                query = query.Where(c => c.p_diagnosisId == (int)DiagnosisCB.SelectedValue);
            }
            if (TypeCB.Enabled == true)
            {
                query = query.Where(c => c.p_typeId == (int)TypeCB.SelectedValue);
            }
            if (BKCB.Enabled == true)
            {
                query = query.Where(c => c.p_bkID == (int)BKCB.SelectedValue);
            }
            if (DestructionCB.Enabled == true)
            {
                query = query.Where(c => c.p_destructionId == (int)DestructionCB.SelectedValue);
            }
            if (BegDT.Enabled == true)
            {
                query = query.Where(c => c.p_firstVisit == (DateTime)BegDT.Value.Date);
            }
            if (EndDT.Enabled == true)
            {
                query = query.Where(c => c.p_firstVisit == (DateTime)EndDT.Value.Date);
            }
            if (ResultDT.Enabled == true)
            {
                query = query.Where(c => c.p_result == ResultDT.Text);
            }
            query.Load();

            bind.DataSource = ctx.Patients.Local.ToBindingList();
            if (xmlChB.Checked == true)
            {
                FormXml(query.ToList());
            }
        }
Пример #6
0
        public PatientForm(DataLibrary.Patients _patient, DataLibrary.TubDataBaseEntities _ctx)
        {
            InitializeComponent();
            m       = mode.View;
            patient = _patient;

            ctx = _ctx;
        }
Пример #7
0
 public AbstractTest(Patients _pat, DataGridView d, ComboBox c)
 {
     ctx  = new DataLibrary.TubDataBaseEntities();
     pat  = _pat;
     dgv  = d;
     box  = c;
     data = (BindingSource)dgv.DataSource;
 }
Пример #8
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            //settings
            this.PatientsListDGV.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.PatientsListDGV_CellContentClick);

            ctx = new DataLibrary.TubDataBaseEntities();

            ctx.Gender.Load();
            this.genderBindingSource.DataSource = ctx.Gender.Local.ToBindingList();

            filter.Init(PatientsListDGV);
            SetLosed();
        }
Пример #9
0
        private void LoadCtx()
        {
            ctx = new TubDataBaseEntities();
            ctx.Gender.Load();
            this.genderBindingSource.DataSource = ctx.Gender.Local.ToBindingList();

            ctx.Diagnosis.Load();
            this.diagnosisBindingSource.DataSource = ctx.Diagnosis.Local.ToBindingList();

            ctx.Type.Load();
            this.typeBindingSource.DataSource = ctx.Type.Local.ToBindingList();

            ctx.BK.Load();
            this.bKBindingSource.DataSource = ctx.BK.Local.ToBindingList();

            ctx.Destruction.Load();
            this.destructionBindingSource.DataSource = ctx.Destruction.Local.ToBindingList();
        }
Пример #10
0
        public UrinaTestForm(int testid, DateTime date, mode _m)
        {
            InitializeComponent();

            ctx  = new TubDataBaseEntities();
            m    = _m;
            test = testid;
            ur   = (from c in ctx.UrineTest where (c.urtest_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();
            }
        }
Пример #11
0
 public PatientForm(DataLibrary.TubDataBaseEntities _ctx)
 {
     InitializeComponent();
     m   = mode.Create;
     ctx = _ctx;
 }