Exemplo n.º 1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            patient     = new Card_Patients();
            sick_leave  = new Sick_leaves();
            ref_analyze = new Ref_Analyzes();
            SearchForm f = new SearchForm(patient, sick_leave, ref_analyze);

            f.ShowDialog();
        }
Exemplo n.º 2
0
 //Registration_patientsEntities bd = null;
 public SearchForm(Card_Patients p, Sick_leaves s, Ref_Analyzes a)
 {
     InitializeComponent();
     this.patient    = p;
     this.sick_leave = s;
     this.analyze    = a;
     bd = new Registration_patientsEntities2();
     comboBoxSurname.DataSource  = null;
     comboBoxAdress.DataSource   = null;
     comboBoxCard_num.DataSource = null;
     comboBoxAnalyz.DataSource   = null;
 }
        //Registration_patientsEntities bd = null;
        public Sick_LeavesForm(Sick_leaves s)
        {
            InitializeComponent();
            this.sick_leave = s;
            bd = new Registration_patientsEntities2();
            //bd = new Registration_patientsEntities();
            comboBoxPatient.DataSource = null;
            bd.Card_Patients.Load();
            comboBoxPatient.DataSource    = bd.Card_Patients.Local.ToList();
            comboBoxPatient.DisplayMember = "Surname";
            comboBoxPatient.ValueMember   = "Id";

            textBoxPlace.Text   = sick_leave.PlaceOfWork;
            textBoxDiagnos.Text = sick_leave.Diagnosis;
            bd.Therapists.Load();
            comboBoxTherapist.DataSource    = bd.Therapists.Local.ToList();
            comboBoxTherapist.DisplayMember = "Surname";
            comboBoxTherapist.ValueMember   = "Id";

            dateTimePickerOpen.Value = DateTime.Now.Date;
        }
Exemplo n.º 4
0
 private void удалитьБольничныйToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (dataGridViewMain.SelectedRows.Count == 1)
     {
         int  index     = dataGridViewMain.SelectedRows[0].Index;
         int  Id        = 0;
         bool converted = Int32.TryParse(dataGridViewMain[0, index].Value.ToString(), out Id);
         if (converted == false)
         {
             return;
         }
         sick_leave = bd.Sick_leaves.Find(Id);
         bd.Sick_leaves.Remove(sick_leave);
         bd.SaveChanges();
         dataGridViewMain.Update();
         dataGridViewMain.Refresh();
         MessageBox.Show("Обьект удален!");
     }
     else
     {
         MessageBox.Show("Не удалось удалить данные!");
     }
 }
Exemplo n.º 5
0
        private void добавитьБольничныйToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bd.Sick_leaves.Load();
            sick_leave = new Sick_leaves();
            Sick_LeavesForm l = new Sick_LeavesForm(sick_leave);

            if (l.ShowDialog() == DialogResult.OK)
            {
                Sick_leaves tmp = bd.Sick_leaves.Local.Where(x => x.Id_Patient == sick_leave.Id_Patient && x.PlaceOfWork == sick_leave.PlaceOfWork &&
                                                             x.Diagnosis == sick_leave.Diagnosis && x.IsAmbulatory == sick_leave.IsAmbulatory && x.IsStationary == sick_leave.IsStationary &&
                                                             x.Id_Therapist == sick_leave.Id_Therapist && x.Opening_date == sick_leave.Opening_date && x.Closing_date == sick_leave.Closing_date).FirstOrDefault();
                if (tmp == null)
                {
                    bd.Sick_leaves.Add(sick_leave);
                    bd.SaveChanges();
                    MessageBox.Show("Больничный успешно добавлен!");
                }
                else
                {
                    MessageBox.Show("Не удалось добавить больничный!");
                }
            }
        }