Пример #1
0
        private void Form_Control_Activated(object sender, EventArgs e)
        {   //Auth
            if (userState == "Admin")
            {
                bunifuThinButton211.Enabled = true;
                button4.Enabled             = true;
            }
            else
            {
                bunifuThinButton211.Enabled = false;
                button4.Enabled             = false;
            }
            //  3ilajat
            ClassTreatments t = new ClassTreatments();

            DataGrid_Traitement.DataSource = t.readTreatments();
            //marid
            ClassPatients p = new ClassPatients();

            dataGridView1.DataSource = p.readPatient();
            //user
            ClassUser u = new ClassUser();

            dataGridView2.DataSource = u.readUsers();
        }
Пример #2
0
 private void bunifuThinButton210_Click(object sender, EventArgs e)
 {
     try
     {
         ClassPatients p = new ClassPatients();
         p.deletePatient(int.Parse(dataGridView1.CurrentRow.Cells[0].Value.ToString()));
         MessageBox.Show("delete good");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void bunifuThinButton24_Click(object sender, EventArgs e)
        {
            ClassPatients p           = new ClassPatients();
            var           dt          = p.readPatient();
            int           lastRow     = dt.Rows.Count;
            int           idP         = int.Parse(dt.Rows[lastRow - 1][0].ToString());
            string        name        = dt.Rows[lastRow - 1][1].ToString();
            int           age         = int.Parse(dt.Rows[lastRow - 1][2].ToString());
            string        patientType = dt.Rows[lastRow - 1][3].ToString();
            Form_Print    print       = new Form_Print();

            print.Lb_Print_NamePatient.Text = name;
            print.bunifuCustomLabel9.Text   = patientType;
            print.bunifuCustomLabel7.Text   = age.ToString();
            print.Show();
            P_Patient.BringToFront();
        }
 private void bunifuThinButton23_Click(object sender, EventArgs e)
 {
     if (bunifuMaterialTextbox3.Text == "" || bunifuMaterialTextbox1.Text == "" || comboBox2.Text == "")
     {
         txt_Message.Text = "All Fileds Requered !";
         bunifuTransition1.ShowSync(P_Message);
     }
     else
     {
         ClassPatients p = new ClassPatients();
         p.insertPatient(bunifuMaterialTextbox3.Text, int.Parse(bunifuMaterialTextbox1.Text), comboBox2.Text);
         txt_Message.ForeColor = Color.SeaGreen;
         txt_Message.Text      = "Save Succefull";
         bunifuTransition1.ShowSync(P_Message);
         P_Trait_Info.BringToFront();
     }
 }
        private void bunifuThinButton22_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || bunifuMaterialTextbox5.Text == "" || comboBox1.Text == "" || comboBox3.Text == "")
            {
                bunifuCustomLabel13.Text = "All Fileds Requered !";
                bunifuTransition1.ShowSync(panel2);
            }
            else
            {
                ClassTreatments_Patients p = new ClassTreatments_Patients();
                //bach njib id marid l howa akhir str drto ana f db
                ClassPatients pt      = new ClassPatients();
                var           dt      = pt.readPatient();
                int           lastRow = dt.Rows.Count;
                int           idP     = int.Parse(dt.Rows[lastRow - 1][0].ToString());

                p.insertTreatments_Patients(idP, textBox1.Text, comboBox1.Text, bunifuMaterialTextbox5.Text, comboBox3.Text);
                txt_Message.ForeColor    = Color.SeaGreen;
                bunifuCustomLabel13.Text = "Save Succefull";
                bunifuTransition1.ShowSync(panel2);
            }
        }