Exemple #1
0
        private void button6_Click(object sender, EventArgs e)
        {
            try
            {
                con.OpenConection();

                dr = con.DataReader("MedicalSheet_BodyComponentPhoto_select_Muscular");

                dt.Clear();
                dt.Load(dr);
                count             = 0;
                textBox1.Text     = dt.Rows[count][0].ToString();
                pictureBox1.Image = Image.FromFile((string)dt.Rows[count][1]);
                richTextBox1.Text = (string)dt.Rows[count][2];



                con.CloseConnection();
            }
            catch (Exception ex)
            {
                MessageBox.Show("لاتوجد صور");
            }
        }
Exemple #2
0
 private void TRAINING_FRM_JOBS_Load(object sender, EventArgs e)
 {
     connect.OpenConection();
 }
Exemple #3
0
        private void حفظToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // op = new OpenFileDialog();

            if (listBox1.SelectedIndex < 0)
            {
                MessageBox.Show("الرجاء اختيار اسم العضو");
            }

            else if (op.FileName.ToString() == "")
            {
                MessageBox.Show("الرجاء ادخال الصوره");
            }
            else
            {
                listitem = listBox1.SelectedItem.ToString();

                if (listitem == "عضل")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }

                else if (listitem == "وعاء لنفاوى")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_lymphatic_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }



                if (listitem == "العين")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_eye_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }



                if (listitem == "الاذن")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_ear_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }



                if (listitem == "هضمى ")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_digestive_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }



                if (listitem == "وعائى")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_cardiovascular_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }

                if (listitem == "الفم")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_mouth_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }

                if (listitem == "بولى")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_urinary_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }



                if (listitem == "هيكلى")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_skeletal_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }



                if (listitem == "جهاز التنفس")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_respiratory_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }



                if (listitem == "تناسلى")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_reproductive_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }


                if (listitem == "اعصاب")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_nervous_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }



                if (listitem == "الرأس والرقبة")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_neck_and_head_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
                if (listitem == "Rhinology")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_rhinology_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }



                if (listitem == "otology")
                {
                    try
                    {
                        con.OpenConection();
                        string[]    pramname  = new string[2];
                        string[]    pramvalue = new string[2];
                        SqlDbType[] pramtype  = new SqlDbType[2];
                        pramname[0] = "@x";
                        pramname[1] = "@y";

                        pramvalue[0] = op.FileName;
                        pramvalue[1] = richTextBox1.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;

                        object x = new object();
                        con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentphoto_otology_insert", pramname, pramvalue, pramtype);
                        MessageBox.Show("تم ادخال البيانات بنجاح");

                        con.CloseConnection();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
        }
Exemple #4
0
        private void monthCalendar1_DateSelected_1(object sender, DateRangeEventArgs e)
        {
            int c = 0;

            for (int j = 0; j < tableLayoutPanel1.RowCount; j++)
            {
                for (int i = 0; i < tableLayoutPanel1.ColumnCount; i++)
                {
                    tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(i, j));
                    tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(i, j));
                    tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(i, j));
                    tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(i, j));
                }
            }

            date = monthCalendar1.SelectionRange.Start.ToShortDateString();

            DateTime dtm = Convert.ToDateTime(date);

            d = dtm.Year.ToString() + '-' + dtm.Month.ToString() + '-' + dtm.Day.ToString();
            try
            {
                /*
                 * create procedure setescope_select_dat(@x nvarchar(50),@end_name nvarchar(50))
                 *
                 *  as
                 *  begin
                 *   select  o.Datee,o.start_time,o.end_time,o.flag
                 *   from setescope_operation o,Endoscope_settings_data e
                 *    where o.Datee = @x and e.EndoscopeCode=o.EndoscopeCode and e.EndoscopeName=@end_name;
                 *
                 *   select p.id,p.name from
                 *   patient_endo p ,setescope_operation s,Endoscope_settings_data e
                 *   where p.id=s.patient_id and  s.Datee = @x and e.EndoscopeCode=s.EndoscopeCode and e.EndoscopeName=@end_name;
                 *
                 *    select e.EndoscopeName from Endoscope_settings_data e,setescope_operation s
                 *     where e.EndoscopeCode=s.EndoscopeCode and e.EndoscopeName=@end_name;
                 *
                 *   select d.name
                 *   from doctors d,doctor_operation o,setescope_operation s,Endoscope_settings_data e
                 *   where o.Do_id=d.Do_id and o.id_op=s.id and s.Datee = @x and e.EndoscopeCode=s.EndoscopeCode and e.EndoscopeName=@end_name and d.jop='surgeon' ;
                 *     end
                 *
                 */
                con1.OpenConection();

                types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar };
                name_input = new string[] { "@x", "@end_name", "@s" };
                values     = new string[] { d, endo, p1.Controls[0].Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("setescope_select_dat", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count != 0)
                {
                    c++;
                }
                for (int i = 0; i < dt.Rows.Count; i += 4)
                {
                    this.tableLayoutPanel1.AutoSize = true;
                    temp = tableLayoutPanel1.RowStyles[0];
                    this.tableLayoutPanel1.RowStyles.Add(new RowStyle(temp.SizeType, temp.Height));
                    tableLayoutPanel1.RowCount++;
                }
                if (c != 0)
                {
                    tableLayoutPanel1.RowCount--;
                }
                int n = 0;
                for (int j = 0; j < tableLayoutPanel1.RowCount; j++)
                {
                    int i = 0;
                    for (i = 0; i < tableLayoutPanel1.ColumnCount; i++)
                    {
                        if (i + n < dt.Rows.Count)
                        {
                            p             = new Panel();
                            p.Click      += p_Click;
                            p.Size        = new System.Drawing.Size(149, 101);
                            p.Location    = new Point(250, 9);
                            p.BorderStyle = BorderStyle.FixedSingle;
                            p.BackColor   = Color.AliceBlue;
                            p.Visible     = true;
                            this.tableLayoutPanel1.Controls.Add(p, i, j);

                            l1          = new Label();
                            l1.Text     = dt.Rows[i + n][1].ToString();
                            l1.AutoSize = false;
                            l1.Left     = 45;
                            l1.Top      = 3;
                            p.Controls.Add(l1);

                            l2          = new Label();
                            l2.Text     = dt.Rows[i + n][2].ToString();
                            l2.AutoSize = false;
                            l2.Left     = -50;
                            l2.Top      = 3;
                            p.Controls.Add(l2);

                            l3          = new Label();
                            l3.Text     = dt.Rows[i][0].ToString();
                            l3.AutoSize = false;
                            l3.Left     = -20;
                            l3.Top      = l1.Height;
                            p.Controls.Add(l3);
                            l4          = new Label();
                            l4.Text     = dt.Rows[i][1].ToString();
                            l4.AutoSize = false;
                            l4.Left     = -10;
                            l4.Top      = l3.Height + 20;
                            p.Controls.Add(l4);

                            l5          = new Label();
                            l5.Text     = dt.Rows[i][0].ToString();
                            l5.AutoSize = false;
                            l5.Left     = 15;
                            l5.Top      = l4.Height + 40;
                            p.Controls.Add(l5);

                            l6          = new Label();
                            l6.Text     = dt.Rows[i][0].ToString();
                            l6.AutoSize = false;
                            l6.Left     = -5;
                            l6.Top      = l5.Height + 60;
                            doc         = l6.Text;


                            //create procedure setescope_do_id(@x nvarchar(50))
                            //    as

                            //    select doc_ssn from doctors where name=@x

                            //cmd = new SqlCommand("setescope_do_id ", con);

                            //cmd.CommandType = CommandType.StoredProcedure;
                            //cmd.Parameters.AddWithValue("@x", l6.Text);
                            types      = new SqlDbType[] { SqlDbType.NVarChar };
                            name_input = new string[] { "@x" };
                            values     = new string[] { l6.Text };
                            SqlDataReader dhr;
                            dhr = con1.ShowDataInGridViewUsingStoredProcDR("setescope_do_id", name_input, values, types);

                            dhr.Read();
                            doc_id = int.Parse(dhr[0].ToString());
                            dhr.Close();
                            p.Controls.Add(l6);

                            flag            = dt.Rows[i + n][3].ToString();
                            lshape          = new Label();
                            lshape.Text     = "";
                            lshape.AutoSize = false;
                            lshape.Size     = new System.Drawing.Size(20, 20);
                            if (flag == "7agz")
                            {
                                lshape.BackColor = Color.Yellow;
                            }
                            else if (flag == "taked")
                            {
                                lshape.BackColor = Color.Green;
                            }
                            else if (flag == "start")
                            {
                                lshape.BackColor = Color.Cyan;
                            }
                            else if (flag == "finish")
                            {
                                lshape.BackColor = Color.Blue;
                            }
                            lshape.BorderStyle = BorderStyle.FixedSingle;
                            lshape.Left        = 110;
                            lshape.Top         = l1.Height;
                            p.Controls.Add(lshape);
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (i == dt.Rows.Count)
                    {
                        break;
                    }
                    else
                    {
                        n += 4;
                    }
                }
                for (int i = dt.Rows.Count - 1; i >= 0; i--)
                {
                    dt.Rows.RemoveAt(i);
                }
                for (int i = dt.Rows.Count - 1; i >= 0; i--)
                {
                    dt.Rows.RemoveAt(i);
                }
                for (int i = dt.Rows.Count - 1; i >= 0; i--)
                {
                    dt.Rows.RemoveAt(i);
                }
                for (int i = dt.Rows.Count - 1; i >= 0; i--)
                {
                    dt.Rows.RemoveAt(i);
                }
            }
            catch (Exception v) { MessageBox.Show(v.Message); }
            finally
            {
                con1.CloseConnection();
            }
        }
Exemple #5
0
 private void تخصصات_Load(object sender, EventArgs e)
 {
     con.OpenConection();
     dataGridView1.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("spec");
     con.CloseConnection();
 }
Exemple #6
0
 private void اذونات_تأخير_Load(object sender, EventArgs e)
 {
     con.OpenConection();
 }
Exemple #7
0
 private void فئة_المريض_Load(object sender, EventArgs e)
 {
     con.OpenConection();
 }
        private void fill_data()
        {
            if (VISIT_ID == "" || VISIT_ID == null)
            {
                return;
            }
            try
            {
                dataGridView2.Rows.Clear();
                conn.OpenConection();
                query = @"SELECT  Registeration_patientRegisteration.patient_name, entranceoffice_visit.type_of_visit, entranceoffice_visit.entrance_date
                        FROM entranceoffice_visit INNER JOIN
                        Registeration_patientRegisteration ON entranceoffice_visit.pat_id = Registeration_patientRegisteration.patient_id
                        WHERE entranceoffice_visit.visit_id=" + VISIT_ID + "";

                dr = conn.DataReader(query);
                if (dr.Read())
                {
                    label6.Text  = VISIT_ID;
                    label7.Text  = dr[0].ToString();
                    label12.Text = dr[1].ToString();
                    label14.Text = dr[2].ToString();
                }
                dr.Close();
                dataGridView2.Rows.Clear();

                query = @"SELECT Visit_Residence_Temp.ID, Visit_Residence_Temp.number_of_room, tb_Accommodation_Degrees.AD_Aname, Visit_Residence_Temp.price_before_discount,Visit_Residence_Temp.start_date, 
                        Visit_Residence_Temp.end_date,Visit_Residence_Temp.number_of_days,Visit_Residence_Temp.type,employee.name
                        FROM   Users INNER JOIN
                        employee ON Users.emp_id = employee.emp_id INNER JOIN
                        Visit_Residence_Temp ON Users.User_Code = Visit_Residence_Temp.User_code INNER JOIN
                        tb_Accommodation_Degrees INNER JOIN
                        rooms ON tb_Accommodation_Degrees.AD_id = rooms.Service_level ON Visit_Residence_Temp.number_of_room = rooms.Room_code 
                        WHERE Visit_Residence_Temp.visit_ID=" + VISIT_ID + "";

                dr = conn.DataReader(query);
                string type = "";
                while (dr.Read())
                {
                    if (dr[7].ToString() == "0")
                    {
                        type = "مريض";
                    }
                    if (dr[7].ToString() == "1")
                    {
                        type = "مرافق على كرسى";
                    }
                    if (dr[7].ToString() == "2")
                    {
                        type = "مرافق على سرير";
                    }
                    dataGridView2.Rows.Add(dr[0], dr[1], dr[2], dr[3], dr[4], dr[5], dr[6], type, dr[8], "حذف");
                }
                dr.Close();
                get_percentage();
                calculate();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                conn.CloseConnection();
            }
        }
Exemple #9
0
 public financial_rep()
 {
     this.WindowState = FormWindowState.Maximized;
     con.OpenConection();
     InitializeComponent();
 }
Exemple #10
0
 public totalsalary()
 {
     InitializeComponent();
     this.WindowState = FormWindowState.Maximized;
     con.OpenConection();
 }
        private void fill_data()
        {
            if (VISIT_ID == "" || VISIT_ID == null)
            {
                return;
            }
            try
            {
                dataGridView3.Rows.Clear();
                conn.OpenConection();
                query = @"SELECT Registeration_patientRegisteration.patient_name, entranceoffice_visit.entrance_date, entranceoffice_visit.type_of_visit, tb_Entities_Category.EC_id, tb_Entities_Branches.EB_id, tb_Contracting_Entities.CE_Id
                        FROM  tb_Entities_Branches INNER JOIN
                        tb_Contracting_Entities ON tb_Entities_Branches.EB_CE_id = tb_Contracting_Entities.CE_Id INNER JOIN
                        tb_Entities_Category ON tb_Entities_Branches.EB_id = tb_Entities_Category.EC_EB_id INNER JOIN
                        entranceoffice_visit INNER JOIN
                        Registeration_patientRegisteration ON entranceoffice_visit.pat_id = Registeration_patientRegisteration.patient_id ON tb_Entities_Category.EC_id = entranceoffice_visit.EC_id 
                        AND entranceoffice_visit.visit_id=" + VISIT_ID + "";
                dr    = conn.DataReader(query);
                if (dr.Read())
                {
                    label7.Text  = dr[0].ToString();
                    label12.Text = dr[2].ToString();
                    label14.Text = dr[1].ToString();

                    EntityID       = dr[5].ToString(); //كود الجهة
                    BranchEntityID = dr[4].ToString(); //كود الجهة الفرعية
                    GroupID        = dr[3].ToString(); //كود الفئة
                }
                dr.Close();

                query = "SELECT  CE_RP_id FROM tb_Contracting_Entities WHERE CE_Id='" + EntityID + "'";
                dr    = conn.DataReader(query);
                if (dr.Read())
                {
                    RegulationID = dr[0].ToString();
                }
                dr.Close();

                query = @"SELECT  EC_Service_Contribution,  EC_Drugs_Contribution, EC_Accomodation_Contribution, EC_Service_Disprecent, EC_Drugs_Disprecent, EC_Accomodation_Disprecent
                      FROM tb_Entities_Category WHERE EC_Id='" + GroupID + "'";
                dr    = conn.DataReader(query);
                if (dr.Read())
                {
                    Patient_service_percentage   = Convert.ToInt32(dr[0]);
                    Patient_medicine_percentage  = Convert.ToInt32(dr[1]);
                    Patient_residence_percentage = Convert.ToInt32(dr[2]);

                    Entity_service_percentage   = Convert.ToInt32(dr[3]);
                    Entity_medicine_percentage  = Convert.ToInt32(dr[4]);
                    Entity_residence_percentage = Convert.ToInt32(dr[5]);
                }
                dr.Close();
                dataGridView3.Rows.Clear();

                query = @"SELECT  Visit_Medicine_Temp.ID, med_medicine.medicine_name, Visit_Medicine_Temp.item_quantity, (" + Entity_medicine_percentage + @" * med_medicine.price / 100),Visit_Medicine_Temp.date, employee.name
                        FROM  Visit_Medicine_Temp,med_medicine,employee,Users WHERE 
                        Visit_Medicine_Temp.visit_ID=" + VISIT_ID + @" AND
                        Visit_Medicine_Temp.item_ID = med_medicine.med_id AND
                        Users.emp_id = employee.emp_id AND
                        Visit_Medicine_Temp.User_code=Users.User_Code";


                dr = conn.DataReader(query);
                while (dr.Read())
                {
                    dataGridView3.Rows.Add(dr[0], dr[1], dr[2], dr[3], dr[4], dr[5], "حذف");
                }
                dr.Close();
                calculate();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                conn.CloseConnection();
            }
        }
Exemple #12
0
 private void فرررريق_العمل_Load(object sender, EventArgs e)
 {
     con.OpenConection();
     dataGridView1.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("team_work");
     con.CloseConnection();
 }
Exemple #13
0
        private void حفظToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //try
            //{

            con1.OpenConection();

            //cmd.CommandText = "select EndoscopeCode from Endoscope_settings_data";
            //dr = cmd.ExecuteReader();
            dr = con1.DataReader("select EndoscopeCode from Endoscope_settings_data");
            if (textBox1.Text != "")
            {
                while (dr.Read())
                {
                    //MessageBox.Show(textBox1.Text);
                    if (int.Parse(dr[0].ToString()) == int.Parse(textBox1.Text))
                    {
                        Code    = int.Parse(dr[0].ToString());
                        isequal = 1;
                        dr.Close();
                        //MessageBox.Show(isequal.ToString());
                        break;
                    }
                }
            }
            //MessageBox.Show(isequal.ToString());

            if (isequal == 1)
            {
                //cmd.CommandText = "update Endoscope_settings_data set EndoscopeName  = '" + textBox4.Text + "' , DescriptionLatino  = '" + textBox5.Text + "' , Bill = '" + comboBox2.SelectedItem +"'   where  EndoscopeCode  = " + Code;
                //cmd.ExecuteNonQuery();
                con1.ExecuteQueries("update Endoscope_settings_data set EndoscopeName  = '" + textBox4.Text + "' , DescriptionLatino  = '" + textBox5.Text + "' , Bill = '" + comboBox2.SelectedItem + "'   where  EndoscopeCode  = " + Code);
                if (checkBox1.Checked)
                {
                    //cmd.CommandText = " update Endoscope_settings_data set do_in_hospital = 1  where  EndoscopeCode  = " + Code;
                    //cmd.ExecuteNonQuery();
                    con1.ExecuteQueries(" update Endoscope_settings_data set do_in_hospital = 1  where  EndoscopeCode  = " + Code);
                }
                else
                {
                    //cmd.CommandText = " update Endoscope_settings_data set do_in_hospital = 0  where  EndoscopeCode  = " + Code;
                    //cmd.ExecuteNonQuery();
                    con1.ExecuteQueries(" update Endoscope_settings_data set do_in_hospital = 0  where  EndoscopeCode  = " + Code);
                }

                if (radioButton1.Checked)
                {
                    //cmd.CommandText = " update Endoscope_settings_data set doctor_fees  = 1  where  EndoscopeCode  = " + Code;
                    //cmd.ExecuteNonQuery();
                    con1.ExecuteQueries(" update Endoscope_settings_data set doctor_fees  = 1  where  EndoscopeCode  = " + Code);
                }
                else if (radioButton2.Checked)
                {
                    //cmd.CommandText = " update Endoscope_settings_data set doctor_fees  = 0  where  EndoscopeCode  = " + Code;
                    //cmd.ExecuteNonQuery();
                    con1.ExecuteQueries(" update Endoscope_settings_data set doctor_fees  = 0  where  EndoscopeCode  = " + Code);
                }
            }
            else
            {
                dr.Close();

                if (checkBox1.Checked)
                {
                    do_in_hospital = 1;
                }
                else
                {
                    do_in_hospital = 0;
                }

                if (radioButton1.Checked)
                {
                    doctor_feed = 1;
                }
                else if (radioButton2.Checked)
                {
                    doctor_feed = 0;
                }
                // cmd.CommandText = "insert into Endoscope_settings_data (EndoscopeName, DescriptionLatino, do_in_hospital, doctor_fees, Bill)  values ( '" + textBox4.Text + "' , '" + textBox5.Text + "' , " + do_in_hospital + "," + doctor_feed + ",'" + comboBox2.SelectedItem + "')";
                //cmd.ExecuteNonQuery();
                con1.ExecuteQueries("insert into Endoscope_settings_data (EndoscopeName, DescriptionLatino, do_in_hospital, doctor_fees, Bill)  values ( '" + textBox4.Text + "' , '" + textBox5.Text + "' , " + do_in_hospital + "," + doctor_feed + ",'" + comboBox2.SelectedItem);
            }

            //MessageBox.Show(اعدادات_المناظير.set_name);
            con1.CloseConnection();
        }
        private void تقرير_قائمة_طبقا_للجنس_Load(object sender, EventArgs e)
        {
            //  con = new MySqlConnection("server=localhost;uid=root;pwd=root;database=hospital");

            con.OpenConection();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            con.OpenConection();
            string[]    pramname  = new string[1];
            string[]    pramvalue = new string[1];
            SqlDbType[] pramtype  = new SqlDbType[1];
            pramname[0]  = "@id";
            pramvalue[0] = textBox2.Text;
            pramtype[0]  = SqlDbType.VarChar;
            if (textBox2.Text == "")
            {
                MessageBox.Show("من فضلك كود امر التوريد");
            }
            else
            {
                dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("t1", pramname, pramvalue, pramtype);

                con.CloseConnection();
            }
            //int a;
            //if (textBox1.Text == "" && textBox2.Text == "")
            //{
            //    MessageBox.Show("Please Enter values");
            //}
            //else if (int.Parse(textBox2.Text) < 0)
            //{
            //    MessageBox.Show("Invalid Value");
            //}
            //else
            //    if (int.TryParse(textBox2.Text, out a))
            //    {
            //        try
            //        {


            //            con.Open();
            //            SqlCommand cmd = new SqlCommand("t1", con);
            //            cmd.CommandType = CommandType.StoredProcedure;
            //cmd = new SqlCommand();
            //cmd.Connection = con;
            //cmd.CommandText = "select commandsupply_id ,request_date,date,p_parcode,quantity,pname,quality " +
            //  "from command_supply,product,prod_command_supply where prod_parcode=p_parcode and command_supply_id=commandsupply_id and commandsupply_id=@id ";

            //cmd.Prepare();
            //        cmd.Parameters.AddWithValue("@id", textBox2.Text);
            //        dr = cmd.ExecuteReader();
            //        dt = new DataTable();
            //        dt.Load(dr);
            //        dataGridView1.DataSource = dt;


            //    }
            //    catch (Exception ex)
            //    {

            //        MessageBox.Show(ex.Message);
            //    }
            //    finally { con.Close(); }
            //}
            //else
            //    MessageBox.Show("Invalid data");
        }
Exemple #16
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "")
            {
                int parsedValue;
                if (!int.TryParse(textBox1.Text, out parsedValue))
                {
                    MessageBox.Show("يجب ادخال ارقام فقط");
                    return;
                }
            }
            if (textBox2.Text != "")
            {
                int parsedValue;
                if (!int.TryParse(textBox2.Text, out parsedValue))
                {
                    MessageBox.Show("يجب ادخال ارقام فقط");
                    return;
                }
            }
            if (textBox3.Text != "")
            {
                int parsedValue;
                if (int.TryParse(textBox3.Text, out parsedValue))
                {
                    MessageBox.Show("يجب ادخال حروف فقط");
                    return;
                }
            }


            dataGridView1.DataSource = null;
            dataGridView1.Rows.Clear();
            dataGridView1.Refresh();


            //create procedure setescope_patient_select
            //as
            //begin
            //select id as 'الكود',nickname as 'اللقب/الرتبة',name as'الاسم',bof as 'تاريخ الميلاد',gender as ' النوع',open_file_date as 'تاريخ فتح الملف' from patient_endo;
            //end

            con.OpenConection();
            if (textBox1.Text == "" && textBox2.Text == "" && textBox3.Text == "")
            {
                dataGridView1.Visible    = true;
                dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("setescope_patient_select");
            }
            else
            {
                if (textBox1.Text != "")
                {
                    try
                    {
                        //create procedure setescope_patient_select_by_id(@id1 int)
                        //as
                        //begin
                        // select id as 'الكود',nickname as 'اللقب/الرتبة',name as'الاسم',bof as 'تاريخ الميلاد',gender as ' النوع',open_file_date as 'تاريخ فتح الملف' from patient_endo where id=@id1;
                        //end
                        string[]    pramname  = new string[1];
                        string[]    pramvalue = new string[1];
                        SqlDbType[] pramtype  = new SqlDbType[1];
                        pramname[0]              = "@id1";
                        pramvalue[0]             = textBox1.Text;
                        pramtype[0]              = SqlDbType.Int;
                        dataGridView1.Visible    = true;
                        dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("setescope_patient_select_by_id", pramname, pramvalue, pramtype);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
                else if (textBox2.Text != "")
                {
                    //create procedure setescope_patient_select_by_ssn(@ssn1 int)
                    //as
                    //begin
                    // select id as 'الكود',nickname as 'اللقب/الرتبة',name as'الاسم',bof as 'تاريخ الميلاد',gender as ' النوع',open_file_date as 'تاريخ فتح الملف' from patient_endo where nss=@ssn1;
                    //end


                    string[]    pramname  = new string[1];
                    string[]    pramvalue = new string[1];
                    SqlDbType[] pramtype  = new SqlDbType[1];
                    pramname[0]              = "@ssn1";
                    pramvalue[0]             = textBox2.Text;
                    pramtype[0]              = SqlDbType.Int;
                    dataGridView1.Visible    = true;
                    dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("setescope_patient_select_by_ssn", pramname, pramvalue, pramtype);
                }
                else if (textBox3.Text != "")
                {
                    //create procedure setescope_patient_select_by_name(@name1 nvarchar(50))
                    //as
                    //begin
                    //select id as 'الكود',nickname as 'اللقب/الرتبة',name as'الاسم',bof as 'تاريخ الميلاد',gender as ' النوع',open_file_date as 'تاريخ فتح الملف' from patient_endo where name=@name1;
                    //end
                    string[]    pramname  = new string[1];
                    string[]    pramvalue = new string[1];
                    SqlDbType[] pramtype  = new SqlDbType[1];
                    pramname[0]              = "@name1";
                    pramvalue[0]             = textBox3.Text;
                    pramtype[0]              = SqlDbType.VarChar;
                    dataGridView1.Visible    = true;
                    dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("setescope_patient_select_by_name", pramname, pramvalue, pramtype);
                }
            }
        }
Exemple #17
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" && (textBox2.Text == "" && (textBox3.Text == "" && (comboBox1.Text == "" && comboBox2.Text == ""))))
            {
                /*
                 *  create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_select
                 *  as
                 *  begin
                 *  select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor
                 *  end
                 * */
                //con.Open();
                //cmd.Connection = con;
                //cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_select";
                //cmd.CommandType = CommandType.StoredProcedure;
                ////cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor";
                //dr = cmd.ExecuteReader();
                con1.OpenConection();
                dr = con1.DataReader("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_select");

                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text != "" && (textBox2.Text == "" && (textBox3.Text == "" && (comboBox1.Text == "" && comboBox2.Text == ""))))
            {
                /*
                 * create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_id_select(@id int)
                 *  as
                 *   begin
                 *  select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doctor_id=@id
                 *  end
                 *
                 * */
                //con.Open();
                //cmd.Connection = con;
                ////cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doctor_id='" + textBox1.Text + "'";
                //cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_id_select";
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.Add("@id", SqlDbType.Int).Value = textBox1.Text;
                //dr = cmd.ExecuteReader();
                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.Int };
                name_input = new string[] { "@id" };
                values     = new string[] { textBox1.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_id_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox2.Text != "" && (textBox1.Text == "" && (textBox3.Text == "" && (comboBox1.Text == "" && comboBox2.Text == ""))))
            {
                /*
                 *
                 *      create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_select(@name nvarchar(50))
                 *      as
                 *      begin
                 *      select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name like N'%'+@name+'%'
                 *      end
                 * */
                //con.Open();
                //cmd.Connection = con;
                ////cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name='" + textBox2.Text + "'";
                //cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_select";
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.Add("@name", SqlDbType.NVarChar).Value = textBox2.Text;
                // dr = cmd.ExecuteReader();
                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar };
                name_input = new string[] { "@name" };
                values     = new string[] { textBox2.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_select", name_input, values, types);

                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox3.Text != "" && (textBox1.Text == "" && (textBox2.Text == "" && (comboBox1.Text == "" && comboBox2.Text == ""))))
            {
                /*
                 *  create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_sepciality_select(@sep nvarchar(50))
                 *  as
                 *  begin
                 * select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where specialization like N'%'+@sep+'%'
                 * end
                 *
                 *
                 * */
                // con.Open();
                // cmd.Connection = con;
                //// cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where specialization='" + textBox3.Text + "'";
                // cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_sepciality_select";
                // cmd.CommandType = CommandType.StoredProcedure;
                // cmd.Parameters.Add("@sep", SqlDbType.NVarChar).Value = textBox3.Text;
                // dr = cmd.ExecuteReader();

                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar };
                name_input = new string[] { "@sep" };
                values     = new string[] { textBox3.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_sepciality_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (comboBox1.Text != "" && (textBox1.Text == "" && (textBox2.Text == "" && (textBox3.Text == "" && comboBox2.Text == ""))))
            {
                /*
                 *      create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_job_select(@job nvarchar(50))
                 *      as
                 *      begin
                 *      select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where job_type like N'%'+@job+'%'
                 *      end
                 *
                 * */
                //con.Open();
                //cmd.Connection = con;
                ////cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where job_type='" + comboBox1.Text + "'";
                //cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_job_select";
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.Add("@job", SqlDbType.NVarChar).Value = comboBox1.Text;
                //dr = cmd.ExecuteReader();
                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar };
                name_input = new string[] { "@job" };
                values     = new string[] { comboBox1.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_job_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (comboBox2.Text != "" && (textBox1.Text == "" && (textBox2.Text == "" && (textBox3.Text == "" && comboBox1.Text == ""))))
            {
                /*
                 *
                 *      create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_degree_select(@deg nvarchar(50))
                 *      as
                 *      begin
                 *      select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where degree like N'%'+@deg+'%'
                 *      end
                 *
                 *
                 * */

                //con.Open();
                //cmd.Connection = con;
                ////cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where degree='" + comboBox2.Text + "'";
                //cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_degree_select";
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.Add("@deg", SqlDbType.NVarChar).Value = comboBox2.Text;
                //dr = cmd.ExecuteReader();

                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar };
                name_input = new string[] { "@deg" };
                values     = new string[] { comboBox2.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_degree_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text != "" && (textBox2.Text != "" || (textBox3.Text != "" || (comboBox1.Text != "" || comboBox2.Text != ""))))
            {
                // con.Open();
                // cmd.Connection = con;
                //// cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doctor_id='" + textBox1.Text + "'";
                // cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_id_select";
                // cmd.CommandType = CommandType.StoredProcedure;
                // cmd.Parameters.Add("@id", SqlDbType.Int).Value = textBox1.Text;
                // dr = cmd.ExecuteReader();

                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.Int };
                name_input = new string[] { "@id" };
                values     = new string[] { textBox1.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_id_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text == "" && (textBox2.Text != "" && (textBox3.Text != "" && (comboBox1.Text == "" && comboBox2.Text == ""))))
            {
                /*
                 *
                 *  create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_sep_select(@name nvarchar(50),@sep nvarchar(50))
                 *  as
                 *  begin
                 *  select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name like N'%' + @name + '%' and specialization like N'%' + @sep + '%';
                 *  end
                 *
                 */
                // con.Open();
                // cmd.Connection = con;
                //// cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name='" + textBox2.Text + "' and specialization='" + textBox3.Text + "'";

                // cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_sep_select";
                // cmd.CommandType = CommandType.StoredProcedure;
                // cmd.Parameters.Add("@name", SqlDbType.NVarChar).Value = textBox2.Text;
                // cmd.Parameters.Add("@sep", SqlDbType.NVarChar).Value = textBox3.Text;
                // dr = cmd.ExecuteReader();

                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar };
                name_input = new string[] { "@name", "@sep" };
                values     = new string[] { textBox2.Text, textBox3.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_sep_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text == "" && (textBox2.Text != "" && (textBox3.Text == "" && (comboBox1.Text != "" && comboBox2.Text == ""))))
            {
                /*
                 * create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_job_select(@name nvarchar(50),@job nvarchar(50))
                 * as
                 * begin
                 * select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name like N'%'+@name+'%' and job_type like N'%'+@job+'%'
                 * end
                 *
                 */
                //con.Open();
                //cmd.Connection = con;
                ////cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name='" + textBox2.Text + "' and job_type='" + comboBox1.Text + "'";
                //cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_job_select";
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.Add("@name", SqlDbType.NVarChar).Value = textBox2.Text;
                //cmd.Parameters.Add("@job", SqlDbType.NVarChar).Value = comboBox1.Text;
                //dr = cmd.ExecuteReader();

                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar };
                name_input = new string[] { "@name", "@job" };
                values     = new string[] { textBox2.Text, comboBox1.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_job_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text == "" && (textBox2.Text != "" && (textBox3.Text == "" && (comboBox1.Text == "" && comboBox2.Text != ""))))
            {
                /*
                 *
                 *      create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_degree_select(@name nvarchar(50),@deg nvarchar(50))
                 *      as
                 *      begin
                 *      select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name like N'%'+@name+'%' and degree like N'%'+@deg+'%'
                 *      end
                 *
                 * */
                //con.Open();
                //cmd.Connection = con;
                ////cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name='" + textBox1.Text + "' and degree='" + comboBox2.Text + "'";
                //cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_degree_select";
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.Add("@name", SqlDbType.NVarChar).Value = textBox2.Text;
                //cmd.Parameters.Add("@deg", SqlDbType.NVarChar).Value = comboBox2.Text;
                //dr = cmd.ExecuteReader();

                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar };
                name_input = new string[] { "@name", "@deg" };
                values     = new string[] { textBox2.Text, comboBox2.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_degree_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text == "" && (textBox2.Text == "" && (textBox3.Text != "" && (comboBox1.Text != "" && comboBox2.Text == ""))))
            {
                /*
                 *      create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_job_sep_select(@job nvarchar(50),@sep nvarchar(50))
                 *      as
                 *      begin
                 *      select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where job_type like N'%'+@job+'%' and specialization like N'%'+@sep+'%'
                 *      end
                 *
                 * */

                //con.Open();
                //cmd.Connection = con;
                ////cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where job_type='" + comboBox1.Text + "' and specialization='" + textBox3.Text + "'";
                //cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_job_sep_select";
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.Add("@job", SqlDbType.NVarChar).Value = comboBox1.Text;
                //cmd.Parameters.Add("@sep", SqlDbType.NVarChar).Value = textBox3.Text;
                //dr = cmd.ExecuteReader();

                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar };
                name_input = new string[] { "@job", "@sep" };
                values     = new string[] { comboBox1.Text, textBox3.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_job_sep_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text == "" && (textBox2.Text == "" && (textBox3.Text == "" && (comboBox1.Text != "" && comboBox2.Text != ""))))
            {
                /*
                 *      create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_job_deg_select(@job nvarchar(50),@deg nvarchar(50))
                 *      as
                 *      begin
                 *      select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where job_type like  N'%'+@job+'%' and degree like N'%'+@deg+'%'
                 *      end
                 *
                 * */

                // con.Open();
                // cmd.Connection = con;
                //// cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where job_type='" + comboBox1.Text + "' and degree='" + comboBox2.Text + "'";
                // cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_job_deg_select";
                // cmd.CommandType = CommandType.StoredProcedure;
                // cmd.Parameters.Add("@job", SqlDbType.NVarChar).Value = comboBox1.Text;
                // cmd.Parameters.Add("@deg", SqlDbType.NVarChar).Value = comboBox2.Text;
                // dr = cmd.ExecuteReader();

                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar };
                name_input = new string[] { "@job", "@deg" };
                values     = new string[] { comboBox1.Text, comboBox2.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_job_deg_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text == "" && (textBox2.Text == "" && (textBox3.Text != "" && (comboBox1.Text == "" && comboBox2.Text != ""))))
            {
                /*
                 *
                 *      create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_sep_deg_select(@sep nvarchar(50),@deg nvarchar(50))
                 *      as
                 *      begin
                 *      select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where specialization like N'%'+@sep+'%' and degree like N'%'+@deg+'%'
                 *      end
                 */
                // con.Open();
                // cmd.Connection = con;
                //// cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where specialization='" + textBox3.Text + "' and degree='" + comboBox2.Text + "'";
                // cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_sep_deg_select";
                // cmd.CommandType = CommandType.StoredProcedure;
                // cmd.Parameters.Add("@sep", SqlDbType.NVarChar).Value = textBox3.Text;
                // cmd.Parameters.Add("@deg", SqlDbType.NVarChar).Value = comboBox2.Text;
                // dr = cmd.ExecuteReader();

                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar };
                name_input = new string[] { "@sep", "@deg" };
                values     = new string[] { textBox3.Text, comboBox2.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_sep_deg_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text == "" && (textBox2.Text != "" && (textBox3.Text != "" && (comboBox1.Text != "" && comboBox2.Text == ""))))
            {
                /*
                 *
                 *  create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_job_sep_select(@name nvarchar(50),@job nvarchar(50),@sep nvarchar(50))
                 *  as
                 *  begin
                 *  select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name like N'%'+@name+'%' and job_type like N'%'+@job+'%' and specialization like N'%'+@sep+'%'
                 *  end
                 *
                 * */
                // con.Open();
                // cmd.Connection = con;
                //// cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name='" + textBox2.Text + "' and job_type='" + comboBox1.Text + "' and specialization='" + textBox3.Text + "'";
                // cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_job_sep_select";
                // cmd.CommandType = CommandType.StoredProcedure;
                // cmd.Parameters.Add("@name", SqlDbType.NVarChar).Value = textBox2.Text;
                // cmd.Parameters.Add("@job", SqlDbType.NVarChar).Value = comboBox1.Text;
                // cmd.Parameters.Add("@sep", SqlDbType.NVarChar).Value = textBox3.Text;
                // dr = cmd.ExecuteReader();


                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar };
                name_input = new string[] { "@name", "@job", "@sep" };
                values     = new string[] { textBox2.Text, comboBox1.Text, textBox3.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_job_sep_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text == "" && (textBox2.Text != "" && (textBox3.Text == "" && (comboBox1.Text != "" && comboBox2.Text != ""))))
            {
                /*
                 * create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_job_deg_select(@name nvarchar(50),@job nvarchar(50),@deg nvarchar(50))
                 * as
                 * begin
                 * select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name like N'%'+@name+'%' and job_type like N'%'+@job+'%' and degree like N'%'+@deg+'%'
                 * end
                 *
                 * */
                //con.Open();
                //cmd.Connection = con;
                ////cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name='" + textBox2.Text + "' and job_type='" + comboBox1.Text + "' and degree='" + comboBox2.Text + "'";
                //cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_job_deg_select";
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.Add("@name", SqlDbType.NVarChar).Value = textBox2.Text;
                //cmd.Parameters.Add("@job", SqlDbType.NVarChar).Value = comboBox1.Text;
                //cmd.Parameters.Add("@deg", SqlDbType.NVarChar).Value = comboBox2.Text;
                //dr = cmd.ExecuteReader();


                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar };
                name_input = new string[] { "@name", "@job", "@deg" };
                values     = new string[] { textBox2.Text, comboBox1.Text, comboBox2.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_job_deg_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text == "" && (textBox2.Text == "" && (textBox3.Text != "" && (comboBox1.Text != "" && comboBox2.Text != ""))))
            {
                /*
                 *
                 *      create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_job_sep_deg_select(@job nvarchar(50),@sep nvarchar(50),@deg nvarchar(50))
                 *      as
                 *      begin
                 *      select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where job_type like N'%'+@job+'%' and specialization like N'%'+@sep+'%' and degree like N'%'+@deg+'%'
                 *      end
                 *
                 *
                 */
                //con.Open();
                //cmd.Connection = con;
                ////cmd.CommandText = "select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where job_type='" + comboBox1.Text + "' and specialization='" + textBox3.Text + "' and degree='" + comboBox2.Text + "'";
                //cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_job_sep_deg_select";
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.Add("@job", SqlDbType.NVarChar).Value = comboBox1.Text;
                //cmd.Parameters.Add("@sep", SqlDbType.NVarChar).Value = textBox3.Text;
                //cmd.Parameters.Add("@deg", SqlDbType.NVarChar).Value = comboBox2.Text;
                //dr = cmd.ExecuteReader();

                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar };
                name_input = new string[] { "@job", "@sep", "@deg" };
                values     = new string[] { comboBox1.Text, textBox3.Text, comboBox2.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_job_sep_deg_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text == "" && (textBox2.Text != "" && (textBox3.Text != "" && (comboBox1.Text != "" && comboBox2.Text != ""))))
            {
                /*
                 *
                 *  create procedure clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_job_sep_deg_select(@name nvarchar(50),@job nvarchar(50),@sep nvarchar(50),@deg nvarchar(50))
                 *  as
                 *  begin
                 *  select doctor_id as 'الكود', doc_name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , specialization as 'التخصص' from doctor where doc_name like N'%'+@name+'%' and job_type like N'%'+@job+'%' and specialization like N'%'+@sep+'%' and degree like N'%'+@deg+'%'
                 *  end
                 *
                 * */
                //con.Open();
                //cmd.Connection = con;
                ////cmd.CommandText = "select code as 'الكود', name as 'الاسم' , job_type as 'نوع العمل' , degree as 'الفئة' , speciality as 'التخصص' from doctor where name='" + textBox2.Text + "' and job_type='" + comboBox1.Text + "' and speciality='" + textBox3.Text + "' and degree='" + comboBox2.Text + "'";
                //cmd.CommandText = "clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_job_sep_deg_select";
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.Add("@name", SqlDbType.NVarChar).Value = textBox2.Text;
                //cmd.Parameters.Add("@job", SqlDbType.NVarChar).Value = comboBox1.Text;
                //cmd.Parameters.Add("@sep", SqlDbType.NVarChar).Value = textBox3.Text;
                //cmd.Parameters.Add("@deg", SqlDbType.NVarChar).Value = comboBox2.Text;
                //dr = cmd.ExecuteReader();

                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar };
                name_input = new string[] { "@name", "@job", "@sep", "@deg" };
                values     = new string[] { textBox2.Text, comboBox1.Text, textBox3.Text, comboBox2.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_بحث_فريق_العمل_الطبى_doctor_name_job_sep_deg_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }
        }
Exemple #18
0
 private void Form3_Load(object sender, EventArgs e)
 {
     try { con.OpenConection(); }
     catch (Exception ex) { MessageBox.Show(ex.ToString()); }
 }
 private void الورديات_Load(object sender, EventArgs e)
 {
     //(@"server=(local);database=hospital;Integrated Security=true");
     con.OpenConection();
 }
Exemple #20
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            if (textBox1.Text == "" && textBox2.Text == "")
            {
                /*
                 *
                 *      create procedure clinic_العياده_clinic_select
                 *      as
                 *      begin
                 *      select Clinic_code as 'الكود', Arabic_name as 'الاسم العربى' , english_name as 'الاسم الانجليزى' from clinic
                 *      end
                 * */
                // con.Open();
                // cmd.Connection = con;
                //// class_con.OpenConection();
                // cmd.CommandText = "clinic_العياده_clinic_select";
                // cmd.CommandType = CommandType.StoredProcedure;
                // //cmd.CommandText = "select Clinic_code as 'الكود', Arabic_name as 'الاسم العربى' , english_name as 'الاسم الانجليزى' from clinic";
                // dr = cmd.ExecuteReader();
                con1.OpenConection();
                dr = con1.DataReader("clinic_العياده_clinic_select");
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text != "" && textBox2.Text == "")
            {
                /* create procedure clinic_العياده_clinic_code_select(@c nvarchar(50))
                 *  as
                 *  begin
                 *  select clinic_code as 'الكود', Arabic_name as 'الاسم العربى' , english_name as 'الاسم الانجليزى' from clinic where clinic_code=@c
                 *  end
                 *
                 */
                //con.Open();
                //cmd.Connection = con;
                ////class_con.OpenConection();
                //cmd.CommandText = "clinic_العياده_clinic_code_select";
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.AddWithValue("@c", textBox1.Text);
                ////cmd.CommandText = "select clinic_code as 'الكود', Arabic_name as 'الاسم العربى' , english_name as 'الاسم الانجليزى' from clinic where clinic_code='" + textBox1.Text + "'";
                //dr = cmd.ExecuteReader();
                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar };
                name_input = new string[] { "@c" };
                values     = new string[] { textBox1.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_العياده_clinic_code_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox1.Text == "" && textBox2.Text != "")
            {
                /*
                 *
                 *  create procedure clinic_العياده_clinic_name_select(@arabic nvarchar(50))
                 *                              as
                 *                              begin
                 *
                 *                              select clinic_code as 'الكود', Arabic_name as 'الاسم العربى' , english_name as 'الاسم الانجليزى' from clinic where Arabic_name  like  N'%'+@arabic+'%'
                 *                              end
                 */
                // con.Open();
                // cmd.Connection = con;
                // //class_con.OpenConection();
                // cmd.CommandText = "clinic_العياده_clinic_name_select";
                // cmd.CommandType = CommandType.StoredProcedure;
                // cmd.Parameters.Add("@arabic", SqlDbType.NVarChar).Value = textBox2.Text;
                //// cmd.CommandText = "select clinic_code as 'الكود', Arabic_name as 'الاسم العربى' , english_name as 'الاسم الانجليزى' from clinic where Arabic_name='" + textBox2.Text + "'";
                // dr = cmd.ExecuteReader();

                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar };
                name_input = new string[] { "@arabic" };
                values     = new string[] { textBox2.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_العياده_clinic_name_select", name_input, values, types);
                DataTable dt = new DataTable();
                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }

            if (textBox2.Text != "" && textBox1.Text != "")
            {
                /*create procedure clinic_العياده_clinic_All_select(@c nvarchar(50),@arabic nvarchar(50))
                 *      as
                 *      begin
                 *      select
                 *      clinic_code as 'الكود', Arabic_name as 'الاسم العربى' , english_name as 'الاسم الانجليزى' from clinic where
                 *      clinic_code=@c and Arabic_name like N'%'+@arabic+'%'
                 *      end
                 *
                 */
                //con.Open();
                //cmd.Connection = con;
                ////class_con.OpenConection();
                //cmd.CommandText = "select clinic_code as 'الكود', Arabic_name as 'الاسم العربى' , english_name as 'الاسم الانجليزى' from clinic where clinic_code='" + textBox1.Text + "' and Arabic_name='" + textBox2.Text + "'";
                //dr = cmd.ExecuteReader();
                con1.OpenConection();
                types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar };
                name_input = new string[] { "@c", "@arabic" };
                values     = new string[] { textBox1.Text, textBox2.Text };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("clinic_العياده_clinic_All_select", name_input, values, types);
                DataTable dt = new DataTable();

                dt.Load(dr);
                if (dt.Rows.Count > 0)
                {
                    dataGridView2.DataSource = dt;
                }
                else
                {
                    MessageBox.Show("لا توجد نتائج بحث");
                }
                dr.Close();
                con1.CloseConnection();
            }
        }
Exemple #21
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (dateTimePicker1.Value.Date < dateTimePicker2.Value.Date)
            {
                try
                {
                    con1.OpenConection();
                    if (textBox3.Text != "")
                    {
                        types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Int };
                        name_input = new string[] { "@x", "@y", "@z" };
                        values     = new string[] { dateTimePicker1.Text, dateTimePicker2.Text, textBox3.Text };
                        ob         = con1.ShowDataInGridViewUsingStoredProc("setescope_approval_select_withpatientid", name_input, values, types);

                        //cmd = new SqlCommand("setescope_approval_select_withpatientid", con);
                        //cmd.CommandType = CommandType.StoredProcedure;
                        //cmd.Parameters.AddWithValue("@x", dateTimePicker1.Text);
                        //cmd.Parameters.AddWithValue("@y", dateTimePicker2.Text);
                        //cmd.Parameters.AddWithValue("@z", Convert.ToInt32(textBox3.Text));
                    }
                    else if (textBox4.Text != "")
                    {
                        types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Int };
                        name_input = new string[] { "@x", "@y", "@z" };
                        values     = new string[] { dateTimePicker1.Text, dateTimePicker2.Text, textBox4.Text };
                        ob         = con1.ShowDataInGridViewUsingStoredProc("setescope_approval_select_withenscopecode", name_input, values, types);

                        //cmd = new SqlCommand("setescope_approval_select_withenscopecode", con);
                        //cmd.CommandType = CommandType.StoredProcedure;
                        //cmd.Parameters.AddWithValue("@x", dateTimePicker1.Text);
                        //cmd.Parameters.AddWithValue("@y", dateTimePicker2.Text);
                        //cmd.Parameters.AddWithValue("@z", Convert.ToInt32(textBox4.Text));
                    }
                    else if (textBox3.Text != "" && textBox4.Text != "")
                    {
                        types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Int, SqlDbType.Int };
                        name_input = new string[] { "@x", "@y", "@p", "@e" };
                        values     = new string[] { dateTimePicker1.Text, dateTimePicker2.Text, textBox3.Text, textBox4.Text };
                        ob         = con1.ShowDataInGridViewUsingStoredProc("setescope_approval_select_withpatientid_andendoscopecode", name_input, values, types);

                        //cmd = new SqlCommand("setescope_approval_select_withpatientid_andendoscopecode", con);
                        //cmd.CommandType = CommandType.StoredProcedure;
                        //cmd.Parameters.AddWithValue("@x", dateTimePicker1.Text);
                        //cmd.Parameters.AddWithValue("@y", dateTimePicker2.Text);
                        //cmd.Parameters.AddWithValue("@p", Convert.ToInt32(textBox3.Text));
                        //cmd.Parameters.AddWithValue("@e", Convert.ToInt32(textBox4.Text));
                    }
                    else
                    {
                        types      = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar };
                        name_input = new string[] { "@x", "@y" };
                        values     = new string[] { dateTimePicker1.Text, dateTimePicker2.Text };
                        ob         = con1.ShowDataInGridViewUsingStoredProc("setescope_approval_select", name_input, values, types);

                        //cmd = new SqlCommand("setescope_approval_select", con);
                        //cmd.CommandType = CommandType.StoredProcedure;
                        //cmd.Parameters.AddWithValue("@x", dateTimePicker1.Text);
                        //cmd.Parameters.AddWithValue("@y", dateTimePicker2.Text);
                    }


                    dataGridView1.Visible    = true;
                    dataGridView1.DataSource = null;
                    dataGridView1.Rows.Clear();
                    dataGridView1.Refresh();
                    dataGridView1.DataSource = ob;
                    con1.CloseConnection();
                    //dr = cmd.ExecuteReader();
                    //dt.Load(dr);
                    //dataGridView1.DataSource = dt;
                    //dr.Close();
                    //con.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                MessageBox.Show("برجاء ادخال تاريخ مناسب");
            }
        }
Exemple #22
0
        private void button1_Click(object sender, EventArgs e)
        {
            con.OpenConection();

            DataTable dt = (DataTable)con.ShowDataInGridViewUsingStoredProc("search_patient1");

            textBox4.Text = dt.Rows[0][0].ToString();
            //SqlCommand cmd = new SqlCommand();
            //SqlDataReader reader;

            //SqlConnection sql = new SqlConnection(@"Server=.\SQLEXPRESS; DataBase=PHIS; Integrated Security=true;");
            //cmd.CommandText = "search_patient1";
            //cmd.CommandType = CommandType.StoredProcedure;
            //cmd.Connection = sql;
            //sql.Open();
            //reader = cmd.ExecuteReader();
            //while (reader.Read())
            //    textBox4.Text = reader[0].ToString();
            //sql.Close();
            //  =(DataTable)con.ShowDataInGridViewUsingStoredProc("report");


            con.CloseConnection();
            if (textBox1.Text != "" && textBox3.Text == "")
            {
                try
                {
                    con.OpenConection();
                    string[]    s  = new string[] { "@x" };
                    string[]    s2 = new string[] { textBox1.Text };
                    SqlDbType[] s3 = new SqlDbType[] { SqlDbType.Int };
                    dataGridView1.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("search_patient2", s, s2, s3);

                    //string s = "select patient_id,patient_name,job,date_of_birth,gender from Registeration_patientRegisteration where patient_id=@x";
                    //cmd = new MySqlCommand(s, con);
                    //cmd.Parameters.AddWithValue("@x", Int32.Parse(textBox1.Text));

                    //dr = cmd.ExecuteReader();

                    //dt.Load(dr);

                    //dataGridView1.DataSource = dt;


                    //dr.Close();
                    //string s1 = "select visit_id ,entrance_date  from entranceoffice_visit,Registeration_patientRegisteration where pat_id=patient_id and pat_id=@x;";
                    //MySqlCommand cmd1 = new MySqlCommand(s1, con);
                    //cmd1.Parameters.AddWithValue("@x", Int32.Parse(textBox1.Text));
                    //MySqlDataReader dr1 = cmd1.ExecuteReader();
                    //DataTable dt1 = new DataTable();
                    //dt1.Load(dr1);
                    //dataGridView3.DataSource = dt1;
                    //dr1.Close();
                    string[]    f  = new string[] { "@x" };
                    string[]    f2 = new string[] { textBox1.Text };
                    SqlDbType[] f3 = new SqlDbType[] { SqlDbType.Int };
                    dataGridView3.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("search_patient4", s, s2, s3);
                }

                catch (Exception ex) { MessageBox.Show(ex.Message); }
                finally { con.CloseConnection(); }
            }
            else if (textBox3.Text != "" && textBox1.Text == "")
            {
                try
                {
                    con.OpenConection();
                    string[]    s  = new string[] { "@x" };
                    string[]    s2 = new string[] { textBox3.Text };
                    SqlDbType[] s3 = new SqlDbType[] { SqlDbType.VarChar };
                    dataGridView1.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("search_patient5", s, s2, s3);

                    //    con.Open();

                    //    string s = "select patient_id,patient_name,job,date_of_birth,gender from Registeration_patientRegisteration where patient_name=@x";
                    //    cmd = new MySqlCommand(s, con);
                    //    cmd.Parameters.AddWithValue("@x", textBox3.Text);
                    //    dr = cmd.ExecuteReader();
                    //    dt.Load(dr);
                    //    dataGridView1.DataSource = dt;
                    // dr.Close();

                    //string s1 = "select code,dat  from entranceoffice_visit,Registeration_patientRegisteration,patientAndVisit where patt_id=patient_id and code=visit_code and patient_name=@x";
                    //MySqlCommand cmd1 = new MySqlCommand(s1, con);
                    //cmd1.Parameters.AddWithValue("@x", textBox3.Text);
                    //MySqlDataReader dr1 = cmd1.ExecuteReader();
                    //DataTable dt1 = new DataTable();
                    //dt1.Load(dr1);
                    //dataGridView3.DataSource = dt1;
                    //dr1.Close();

                    string[]    f  = new string[] { "@x" };
                    string[]    f2 = new string[] { textBox3.Text };
                    SqlDbType[] f3 = new SqlDbType[] { SqlDbType.VarChar };
                    dataGridView3.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("search_patient6", f, f2, f3);
                }

                catch (Exception ex) { MessageBox.Show(ex.Message); }
                finally { con.CloseConnection(); }
            }

            else if (textBox1.Text != "" && textBox3.Text != "")
            {
                try
                {
                    con.OpenConection();
                    string[]    s  = new string[] { "@x", "@y" };
                    string[]    s2 = new string[] { textBox3.Text, textBox1.Text };
                    SqlDbType[] s3 = new SqlDbType[] { SqlDbType.VarChar, SqlDbType.Int };
                    dataGridView1.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("search_patient7", s, s2, s3);

                    //con.Open();
                    //string s = "select patient_id,patient_name,job,date_of_birth,gender from Registeration_patientRegisteration where patient_name=@x and patient_id=@y";
                    //cmd = new MySqlCommand(s, con);
                    //cmd.Parameters.AddWithValue("@y", Int32.Parse(textBox1.Text));
                    //cmd.Parameters.AddWithValue("@x", textBox3.Text);
                    //dr = cmd.ExecuteReader();
                    //dt.Load(dr);
                    //dataGridView1.DataSource = dt
                    //dr.Close();

                    //string s1 = "select code,dat  from entranceoffice_visit,Registeration_patientRegisteration,patientAndVisit where patt_id=patient_id and code=visit_code and patient_name=@x and patient_id=@y";
                    //MySqlCommand cmd1 = new MySqlCommand(s1, con);
                    //cmd1.Parameters.AddWithValue("@y", Int32.Parse(textBox1.Text));
                    //cmd1.Parameters.AddWithValue("@x", textBox3.Text);
                    //MySqlDataReader dr1 = cmd1.ExecuteReader();
                    //DataTable dt1 = new DataTable();
                    //dt1.Load(dr1);
                    //dataGridView3.DataSource = dt1;
                    //dr1.Close();

                    string[]    f  = new string[] { "@x", "@y" };
                    string[]    f2 = new string[] { textBox3.Text, textBox1.Text };
                    SqlDbType[] f3 = new SqlDbType[] { SqlDbType.VarChar, SqlDbType.Int };
                    dataGridView3.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("search_patient8", f, f2, f3);
                }

                catch (Exception ex) { MessageBox.Show(ex.Message); }
                finally { con.CloseConnection(); }
            }
            else
            {
                try
                {
                    con.OpenConection();
                    //    con.Open();
                    //    string s = "select patient_id,patient_name,job,date_of_birth,gender from Registeration_patientRegisteration";
                    //    cmd = new MySqlCommand(s, con);
                    //    dr = cmd.ExecuteReader();

                    //    dt.Load(dr);
                    //    dataGridView1.DataSource = dt;

                    //    dr.Close();

                    dataGridView1.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("search_patient10");


                    dataGridView3.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("search_patient9");
                }

                catch (Exception ex) { MessageBox.Show(ex.Message); }
                finally { con.CloseConnection(); }
            }
        }
        private void label18_Click(object sender, EventArgs e)
        {
            /*if (String.IsNullOrEmpty(textBox3.Text))
             * {
             *  MessageBox.Show("من فضلك ادخل كود الخصم   ");
             *  textBox3.Focus();
             * }
             * else
             *  if (textBox3.Text.Any(c => Char.IsLetter(c)))
             *  {
             *      MessageBox.Show("من فضلك ادخل كود الخصم بشكل صحيح");
             *      textBox3.Focus();
             *  }
             *
             *  else*/
            if (String.IsNullOrEmpty(textBox6.Text))
            {
                MessageBox.Show("من فضلك ادخل نوع الخصم ");
                textBox6.Focus();
            }
            else
            if (textBox6.Text.Any(c => Char.IsNumber(c)))
            {
                MessageBox.Show("من فضلك ادخل نوع الخصم بشكل صحيح");
                textBox6.Focus();
            }

            else

            if (String.IsNullOrEmpty(textBox8.Text))
            {
                MessageBox.Show("من فضلك عملية الخصم ");
                textBox8.Focus();
            }


            else
            if (String.IsNullOrEmpty(textBox1.Text))
            {
                MessageBox.Show("من فضلك الاجمالى قبل الخصم   ");
                textBox1.Focus();
            }
            else
            if (textBox1.Text.Any(c => Char.IsLetter(c)))
            {
                MessageBox.Show("من فضلك ادخل الاجمالى قبل الخصم  بشكل صحيح");
                textBox1.Focus();
            }

            else
            if (String.IsNullOrEmpty(textBox5.Text))
            {
                MessageBox.Show("من فضلك نسبه الخصم   ");
                textBox5.Focus();
            }
            else
            if (textBox5.Text.Any(c => Char.IsLetter(c)))
            {
                MessageBox.Show("من فضلك ادخل نسبه الخصم  بشكل صحيح");
                textBox5.Focus();
            }

            else
            if (String.IsNullOrEmpty(textBox7.Text))
            {
                MessageBox.Show("من فضلك رقم الفاتورة   ");
                textBox7.Focus();
            }
            else
            if (textBox7.Text.Any(c => Char.IsLetter(c)))
            {
                MessageBox.Show("من فضلك ادخل رقم الفاتورة بشكل صحيح");
                textBox7.Focus();
            }
            else
            if (String.IsNullOrEmpty(textBox2.Text))
            {
                MessageBox.Show("من فضلك قيمه الخصم   ");
                textBox2.Focus();
            }
            else
            if (textBox2.Text.Any(c => Char.IsLetter(c)))
            {
                MessageBox.Show("من فضلك ادخل قيمه الخصم بشكل صحيح");
                textBox2.Focus();
            }
            else
            if (String.IsNullOrEmpty(textBox4.Text))
            {
                MessageBox.Show("من فضلك الاجمالى بعد الخصم   ");
                textBox4.Focus();
            }
            else
            if (textBox4.Text.Any(c => Char.IsLetter(c)))
            {
                MessageBox.Show("من فضلك ادخل الاجمالى بعد الخصم بشكل صحيح");
                textBox4.Focus();
            }

            else
            {
                try
                {
                    con.OpenConection();
                    string[]    pramname  = new string[8];
                    string[]    pramvalue = new string[8];
                    SqlDbType[] pramtype  = new SqlDbType[8];
                    pramname[0] = "@bill_id";
                    pramname[1] = "@ratio_id";
                    pramname[2] = "@discount_type";
                    pramname[3] = "@ratio";
                    pramname[4] = "@value";
                    pramname[5] = "@total_before_discount";
                    pramname[6] = "@total_after_discount";
                    pramname[7] = "@discount_process";

                    pramvalue[0] = textBox7.Text;
                    pramvalue[1] = textBox9.Text;
                    pramvalue[2] = textBox6.Text;
                    pramvalue[3] = textBox5.Text;
                    pramvalue[4] = textBox2.Text;
                    pramvalue[5] = textBox1.Text;
                    pramvalue[6] = textBox4.Text;
                    pramvalue[7] = textBox8.Text;

                    pramtype[0] = SqlDbType.Int;
                    pramtype[1] = SqlDbType.Int;
                    pramtype[2] = SqlDbType.VarChar;
                    pramtype[3] = SqlDbType.Decimal;
                    pramtype[4] = SqlDbType.Decimal;
                    pramtype[5] = SqlDbType.Decimal;
                    pramtype[6] = SqlDbType.Decimal;
                    pramtype[7] = SqlDbType.VarChar;



                    dataGridView1.DataSource = con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("drug_discount_add", pramname, pramvalue, pramtype);



                    MessageBox.Show("تم الادخال");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally { con.CloseConnection(); }
            }
        }
Exemple #24
0
        private void ShowData()
        {
            if (String.IsNullOrEmpty(textBox1.Text) && String.IsNullOrEmpty(textBox6.Text) && String.IsNullOrEmpty(textBox3.Text))
            {
                MessageBox.Show("من فضلك ادخل رقم المخزن و رقم المستخدم ورقم الحركه  ");
                textBox1.Focus();
            }
            else
            if (String.IsNullOrEmpty(textBox1.Text))
            {
                MessageBox.Show("من فضلك ادخل رقم المخزن");
                textBox1.Focus();
            }
            else
            if (textBox1.Text.Any(c => Char.IsLetter(c)))
            {
                MessageBox.Show("من فضلك ادخل رقم المخزن بشكل صحيح");
                textBox1.Focus();
            }
            else
            if (String.IsNullOrEmpty(textBox6.Text))
            {
                MessageBox.Show("من فضلك ادخل رقم المستخدم ");
                textBox6.Focus();
            }
            else
            if (textBox6.Text.Any(c => Char.IsLetter(c)))
            {
                MessageBox.Show("من فضلك ادخل رقم المستخدم بشكل صحيح");
                textBox6.Focus();
            }
            else
            if (String.IsNullOrEmpty(textBox3.Text))
            {
                MessageBox.Show("من فضلك ادخل رقم الحركه ");
                textBox3.Focus();
            }
            else
            if (textBox3.Text.Any(c => Char.IsLetter(c)))
            {
                MessageBox.Show("من فضلك ادخل رقم الحركه بشكل صحيح");
                textBox3.Focus();
            }
            else
            if (textBox2.Text.Any(c => Char.IsNumber(c)))
            {
                MessageBox.Show("من فضلك ادخل اسم المخزن بشكل صحيح");
                textBox2.Focus();
            }
            else
            if (textBox5.Text.Any(c => Char.IsNumber(c)))
            {
                MessageBox.Show("من فضلك ادخل اسم المستخدم بشكل صحيح");
                textBox5.Focus();
            }
            else
            {
                if (comboBox1.Text != null)
                {
                    if (comboBox1.Text == "مراجع")
                    {
                        try
                        {
                            con.OpenConection();
                            //not find table [0]
                            string[]    pramname  = new string[8];
                            string[]    pramvalue = new string[8];
                            SqlDbType[] pramtype  = new SqlDbType[8];
                            pramname[0] = "@x1";
                            pramname[1] = "@x2";
                            pramname[2] = "@x3";
                            pramname[3] = "@x4";
                            pramname[4] = "@x5";
                            pramname[5] = "@x6";
                            pramname[6] = "@x7";
                            pramname[7] = "@x8";

                            pramvalue[0] = dateTimePicker1.Value.ToString();
                            pramvalue[1] = dateTimePicker2.Value.ToString();
                            pramvalue[2] = textBox3.Text;
                            pramvalue[3] = textBox1.Text;
                            pramvalue[4] = comboBox1.Text;
                            pramvalue[5] = textBox2.Text;
                            pramvalue[6] = comboBox3.Text;
                            pramvalue[7] = textBox6.Text;

                            pramtype[0] = SqlDbType.VarChar;
                            pramtype[1] = SqlDbType.VarChar;
                            pramtype[2] = SqlDbType.Int;
                            pramtype[3] = SqlDbType.VarChar;
                            pramtype[4] = SqlDbType.Int;
                            pramtype[5] = SqlDbType.VarChar;
                            pramtype[6] = SqlDbType.VarChar;
                            pramtype[7] = SqlDbType.VarChar;

                            dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("review_pharmacy_movementT", pramname, pramvalue, pramtype);
                            //MessageBox.Show("");
                            con.CloseConnection();
                        }
                        catch (Exception)
                        {
                            MessageBox.Show("من فضلك ادخل البيانات كاملة ");
                        }
                    }
                }
                else
                {
                    try
                    {
                        con.OpenConection();
                        //not find table [0]
                        string[]    pramname  = new string[8];
                        string[]    pramvalue = new string[8];
                        SqlDbType[] pramtype  = new SqlDbType[8];
                        pramname[0] = "@x1";
                        pramname[1] = "@x2";
                        pramname[2] = "@x3";
                        pramname[3] = "@x4";
                        pramname[4] = "@x5";
                        pramname[5] = "@x6";
                        pramname[6] = "@x7";
                        pramname[7] = "@x8";

                        pramvalue[0] = dateTimePicker1.Value.ToString();
                        pramvalue[1] = dateTimePicker2.Value.ToString();
                        pramvalue[2] = textBox3.Text;
                        pramvalue[3] = textBox1.Text;
                        pramvalue[4] = comboBox1.Text;
                        pramvalue[5] = textBox2.Text;
                        pramvalue[6] = comboBox3.Text;
                        pramvalue[7] = textBox6.Text;

                        pramtype[0] = SqlDbType.VarChar;
                        pramtype[1] = SqlDbType.VarChar;
                        pramtype[2] = SqlDbType.Int;
                        pramtype[3] = SqlDbType.VarChar;
                        pramtype[4] = SqlDbType.Int;
                        pramtype[5] = SqlDbType.VarChar;
                        pramtype[6] = SqlDbType.VarChar;
                        pramtype[7] = SqlDbType.VarChar;

                        dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("review_pharmacy_movementF", pramname, pramvalue, pramtype);
                        //MessageBox.Show("");
                        con.CloseConnection();
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("من فضلك ادخل البيانات كاملة ");
                    }
                }
            }
        }
Exemple #25
0
 private void patients_visits_Load(object sender, EventArgs e)
 {
     // con = new MySqlConnection("server=localhost;uid=root;pwd=root;database=hospital1");
     con.OpenConection();
 }
Exemple #26
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            selected = listBox1.SelectedItem.ToString();
            if (selected == "تخدير")
            {
                if (tableLayoutPanel1.RowCount > 1)
                {
                    for (int j = tableLayoutPanel1.RowCount - 1; j > 0; j--)
                    {
                        tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(0, j));
                        tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(1, j));
                        tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(2, j));
                        tableLayoutPanel1.RowStyles.RemoveAt(j);
                        tableLayoutPanel1.RowCount--;
                    }
                }
                con1.OpenConection();
                //create procedure select_docs(@id int,@type nvarchar(50))
                //as

                //select d.Do_id, d.name from doctor_operation o,doctors d where o.id_op=@id and o.Do_id=d.Do_id and jop=@type;
                //cmd = new SqlCommand("select_docs", con);
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.AddWithValue("@id", Convert.ToInt32(الصفحه_الرئيسيه_للمنظار.opid));
                //cmd.Parameters.AddWithValue("@type", "Anesthesia");
                types      = new SqlDbType[] { SqlDbType.Int, SqlDbType.NVarChar };
                name_input = new string[] { "@id", "@type" };
                values     = new string[] { "Anesthesia", الصفحه_الرئيسيه_للمنظار.opid };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("select_docs", name_input, values, types);



                DataTable dt1 = new DataTable();
                dt1.Load(dr);
                int i;
                for (i = 0; i < dt1.Rows.Count; i++)
                {
                    if (i == 0)
                    {
                        textBox1.Text = dt1.Rows[0][0].ToString();
                        textBox2.Text = dt1.Rows[0][1].ToString();
                        l1.Add(textBox1.Text);
                    }
                    else
                    {
                        t1        = new TextBox();
                        t2        = new TextBox();
                        b1        = new Button();
                        b1.Click += b1_Click;

                        t1.Size     = textBox1.Size;
                        t1.Location = textBox1.Location;
                        t1.Font     = textBox1.Font;

                        t2.Size     = textBox2.Size;
                        t2.Location = textBox2.Location;
                        t2.Font     = textBox2.Font;

                        b1.Size            = button1.Size;
                        b1.Location        = button1.Location;
                        b1.BackgroundImage = button1.BackgroundImage;
                        b1.Margin          = button1.Margin;


                        this.tableLayoutPanel1.AutoSize = true;
                        if (tableLayoutPanel1.RowCount > 0)
                        {
                            temp = tableLayoutPanel1.RowStyles[0];
                        }
                        else
                        {
                            temp = temp1;
                        }
                        this.tableLayoutPanel1.RowStyles.Add(new RowStyle(temp.SizeType, temp.Height));
                        tableLayoutPanel1.RowCount++;
                        this.tableLayoutPanel1.Controls.Add(t1, 2, i);
                        this.tableLayoutPanel1.Controls.Add(b1, 1, i);
                        this.tableLayoutPanel1.Controls.Add(t2, 0, i);
                        t1.Text = dt1.Rows[i][0].ToString();
                        t2.Text = dt1.Rows[i][1].ToString();
                        l1.Add(t1.Text);
                    }
                }
                rowIndex = i;
                dr.Close();
                con1.CloseConnection();
            }
            if (selected == "جراح مساعد")
            {
                if (tableLayoutPanel1.RowCount > 1)
                {
                    for (int j = tableLayoutPanel1.RowCount - 1; j > 0; j--)
                    {
                        tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(0, j));
                        tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(1, j));
                        tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(2, j));
                        tableLayoutPanel1.RowStyles.RemoveAt(j);
                        tableLayoutPanel1.RowCount--;
                    }
                }
                con1.OpenConection();
                //create procedure select_docs(@id int,@type nvarchar(50))
                //as

                //select d.Do_id, d.name from doctor_operation o,doctors d where o.id_op=@id and o.Do_id=d.Do_id and jop=@type;

                //cmd = new SqlCommand("select_docs", con);
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.AddWithValue("@id", Convert.ToInt32(الصفحه_الرئيسيه_للمنظار.opid));
                //cmd.Parameters.AddWithValue("@type", "surgeon");
                types      = new SqlDbType[] { SqlDbType.Int, SqlDbType.NVarChar };
                name_input = new string[] { "@id", "@type" };
                values     = new string[] { الصفحه_الرئيسيه_للمنظار.opid, "surgeon" };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("select_docs", name_input, values, types);
                DataTable dt2 = new DataTable();
                dt2.Load(dr);


                int i;
                for (i = 1; i < dt2.Rows.Count; i++)
                {
                    if (i == 1)
                    {
                        textBox1.Text = dt2.Rows[1][0].ToString();
                        textBox2.Text = dt2.Rows[1][1].ToString();
                        l2.Add(textBox1.Text);
                    }
                    else
                    {
                        t1        = new TextBox();
                        t2        = new TextBox();
                        b1        = new Button();
                        b1.Click += b1_Click;

                        t1.Size     = textBox1.Size;
                        t1.Location = textBox1.Location;
                        t1.Font     = textBox1.Font;

                        t2.Size     = textBox2.Size;
                        t2.Location = textBox2.Location;
                        t2.Font     = textBox2.Font;

                        b1.Size            = button1.Size;
                        b1.Location        = button1.Location;
                        b1.BackgroundImage = button1.BackgroundImage;
                        b1.Margin          = button1.Margin;


                        this.tableLayoutPanel1.AutoSize = true;
                        if (tableLayoutPanel1.RowCount > 0)
                        {
                            temp = tableLayoutPanel1.RowStyles[0];
                        }
                        else
                        {
                            temp = temp1;
                        }
                        this.tableLayoutPanel1.RowStyles.Add(new RowStyle(temp.SizeType, temp.Height));
                        tableLayoutPanel1.RowCount++;
                        this.tableLayoutPanel1.Controls.Add(t1, 2, i - 1);
                        this.tableLayoutPanel1.Controls.Add(b1, 1, i - 1);
                        this.tableLayoutPanel1.Controls.Add(t2, 0, i - 1);
                        t1.Text = dt2.Rows[i][0].ToString();
                        t2.Text = dt2.Rows[i][1].ToString();
                        l2.Add(t1.Text);
                    }
                }
                rowIndex = i - 1;
                dr.Close();
                con1.CloseConnection();
            }
            if (selected == "تمريض")
            {
                if (tableLayoutPanel1.RowCount > 1)
                {
                    for (int j = tableLayoutPanel1.RowCount - 1; j > 0; j--)
                    {
                        tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(0, j));
                        tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(1, j));
                        tableLayoutPanel1.Controls.Remove(tableLayoutPanel1.GetControlFromPosition(2, j));
                        tableLayoutPanel1.RowStyles.RemoveAt(j);
                        tableLayoutPanel1.RowCount--;
                    }
                }
                con1.OpenConection();

                //                create procedure select_docs(@id int,@type nvarchar(50))
                //as

                //select d.Do_id, d.name from doctor_operation o,doctors d where o.id_op=@id and o.Do_id=d.Do_id and jop=@type;
                //cmd = new SqlCommand("select_docs", con);
                //cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.AddWithValue("@id", Convert.ToInt32(الصفحه_الرئيسيه_للمنظار.opid));
                //cmd.Parameters.AddWithValue("@type", "Nursing");
                //da3= new SqlDataAdapter(cmd);
                //DataSet ds3 = new DataSet();
                //da3.Fill(ds3);
                types      = new SqlDbType[] { SqlDbType.Int, SqlDbType.NVarChar };
                name_input = new string[] { "@id", "@type" };
                values     = new string[] { الصفحه_الرئيسيه_للمنظار.opid, "Nursing" };
                dr         = con1.ShowDataInGridViewUsingStoredProcDR("select_docs", name_input, values, types);
                DataTable dt3 = new DataTable();
                dt3.Load(dr);

                int i;
                for (i = 0; i < dt3.Rows.Count; i++)
                {
                    if (i == 0)
                    {
                        textBox1.Text = dt3.Rows[0][0].ToString();
                        textBox2.Text = dt3.Rows[0][1].ToString();
                        l3.Add(textBox1.Text);
                    }
                    else
                    {
                        t1        = new TextBox();
                        t2        = new TextBox();
                        b1        = new Button();
                        b1.Click += b1_Click;

                        t1.Size     = textBox1.Size;
                        t1.Location = textBox1.Location;
                        t1.Font     = textBox1.Font;

                        t2.Size     = textBox2.Size;
                        t2.Location = textBox2.Location;
                        t2.Font     = textBox2.Font;

                        b1.Size            = button1.Size;
                        b1.Location        = button1.Location;
                        b1.BackgroundImage = button1.BackgroundImage;
                        b1.Margin          = button1.Margin;


                        this.tableLayoutPanel1.AutoSize = true;
                        if (tableLayoutPanel1.RowCount > 0)
                        {
                            temp = tableLayoutPanel1.RowStyles[0];
                        }
                        else
                        {
                            temp = temp1;
                        }
                        this.tableLayoutPanel1.RowStyles.Add(new RowStyle(temp.SizeType, temp.Height));
                        tableLayoutPanel1.RowCount++;
                        this.tableLayoutPanel1.Controls.Add(t1, 2, i);
                        this.tableLayoutPanel1.Controls.Add(b1, 1, i);
                        this.tableLayoutPanel1.Controls.Add(t2, 0, i);
                        t1.Text = dt3.Rows[i][0].ToString();
                        t2.Text = dt3.Rows[i][1].ToString();
                        l3.Add(t1.Text);
                    }
                }
                rowIndex = i;
                dr.Close();
                con1.CloseConnection();
            }
        }
Exemple #27
0
        private void ShowData()
        {
            if (String.IsNullOrEmpty(CodeTextBox.Text) && String.IsNullOrEmpty(textBox3.Text))
            {
                MessageBox.Show("من فضلك ادخل كود الجهه و كود الفئه ");
                CodeTextBox.Focus();
            }
            else if (String.IsNullOrEmpty(CodeTextBox.Text))
            {
                MessageBox.Show("من فضلك ادخل كود الجهه");
                CodeTextBox.Focus();
            }
            else if (CodeTextBox.Text.Any(c => Char.IsLetter(c)))
            {
                MessageBox.Show("من فضلك ادخل كود الجهه بشكل صحيح");
                CodeTextBox.Focus();
            }
            else if (String.IsNullOrEmpty(textBox3.Text))
            {
                MessageBox.Show("من فضلك ادخل كود الفئه");
                textBox3.Focus();
            }
            else if (textBox3.Text.Any(c => Char.IsLetter(c)))
            {
                MessageBox.Show("من فضلك ادخل كود الفئه بشكل صحيح");
                textBox3.Focus();
            }
            else if (textBox2.Text.Any(c => Char.IsNumber(c)))
            {
                MessageBox.Show("من فضلك ادخل اسم الجهه بشكل صحيح");
                textBox2.Focus();
            }
            else if (textBox4.Text.Any(c => Char.IsNumber(c)))
            {
                MessageBox.Show("من فضلك ادخل اسم الفئه بشكل صحيح");
                textBox4.Focus();
            }
            else
            {
                if (comboBox1.Text != null)
                {
                    if (comboBox1.Text == "مراجع")
                    {
                        try
                        {
                            con.OpenConection();
                            //not find table [0]
                            string[]    pramname  = new string[4];
                            string[]    pramvalue = new string[4];
                            SqlDbType[] pramtype  = new SqlDbType[4];
                            pramname[0] = "@x1";
                            pramname[1] = "@x2";
                            pramname[2] = "@x3";
                            pramname[3] = "@x4";

                            pramvalue[0] = CodeTextBox.Text;
                            pramvalue[1] = textBox3.Text;
                            pramvalue[2] = dateTimePicker1.Value.ToString();
                            pramvalue[3] = dateTimePicker2.Value.ToString();

                            pramtype[0] = SqlDbType.Int;
                            pramtype[1] = SqlDbType.Int;
                            pramtype[2] = SqlDbType.VarChar;
                            pramtype[3] = SqlDbType.VarChar;

                            dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("review_bill_patientT", pramname, pramvalue, pramtype);
                            //MessageBox.Show("");
                            con.CloseConnection();
                        }
                        catch (Exception)
                        {
                            MessageBox.Show("من فضلك ادخل البيانات كاملة ");
                        }
                    }
                }

                else
                {
                    try
                    {
                        con.OpenConection();
                        //not find table [0]
                        string[]    pramname  = new string[4];
                        string[]    pramvalue = new string[4];
                        SqlDbType[] pramtype  = new SqlDbType[4];
                        pramname[0] = "@x1";
                        pramname[1] = "@x2";
                        pramname[2] = "@x3";
                        pramname[3] = "@x4";

                        pramvalue[0] = CodeTextBox.Text;
                        pramvalue[1] = textBox3.Text;
                        pramvalue[2] = dateTimePicker1.Value.ToString();
                        pramvalue[3] = dateTimePicker2.Value.ToString();

                        pramtype[0] = SqlDbType.Int;
                        pramtype[1] = SqlDbType.Int;
                        pramtype[2] = SqlDbType.VarChar;
                        pramtype[3] = SqlDbType.VarChar;

                        dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("review_bill_patientF", pramname, pramvalue, pramtype);
                        //MessageBox.Show("");
                        con.CloseConnection();
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("من فضلك ادخل البيانات كاملة ");
                    }
                }
            }
        }
        private void C_Save_Click(object sender, EventArgs e)
        {
            #region insert

            if (valdate())
            {
                try
                {
                    string[]    paramname  = new string[17];
                    string[]    paramvalue = new string[17];
                    SqlDbType[] paramtype  = new SqlDbType[17];

                    paramname[0]  = "@id";
                    paramname[1]  = "@Aname";
                    paramname[2]  = "@Ename";
                    paramname[3]  = "@StartDD";
                    paramname[4]  = "@StopDD";
                    paramname[5]  = "@Stopdealing";
                    paramname[6]  = "@EOpenblance";
                    paramname[7]  = "@MOpenblance";
                    paramname[8]  = "@ELimitblance";
                    paramname[9]  = "@MLimitblance";
                    paramname[10] = "@TE_id";
                    paramname[11] = "@Employee";
                    paramname[12] = "@RP_id";
                    paramname[13] = "@Region_id";
                    paramname[14] = "@HEmployee_id";
                    paramname[15] = "@OSD_id";
                    paramname[16] = "@AD_id";



                    paramvalue[0]  = Txt_id.Text;
                    paramvalue[1]  = Txt_aname.Text;
                    paramvalue[2]  = Txt_Ename.Text;
                    paramvalue[3]  = dtp_start.Value.ToShortDateString();
                    paramvalue[4]  = dtp_stop.Value.ToShortDateString();
                    paramvalue[5]  = stopdealing.ToString();
                    paramvalue[6]  = ELimitb.ToString();
                    paramvalue[7]  = MLimitb.ToString();
                    paramvalue[8]  = Txt_Climitb.Text;
                    paramvalue[9]  = Txt_Mlimitb.Text;
                    paramvalue[10] = txt_ET_id.Text;
                    paramvalue[11] = Txt_employee.Text;
                    paramvalue[12] = txt_RP_id.Text;
                    paramvalue[13] = txt_Region_id.Text;
                    paramvalue[14] = Txt_HEid.Text;
                    paramvalue[15] = txt_OSD_id.Text;
                    paramvalue[16] = Txt_AD_id.Text;


                    paramtype[0]  = SqlDbType.Int;
                    paramtype[1]  = SqlDbType.NVarChar;
                    paramtype[2]  = SqlDbType.NVarChar;
                    paramtype[3]  = SqlDbType.Date;
                    paramtype[4]  = SqlDbType.Date;
                    paramtype[5]  = SqlDbType.Bit;
                    paramtype[6]  = SqlDbType.Bit;
                    paramtype[7]  = SqlDbType.Bit;
                    paramtype[8]  = SqlDbType.Int;
                    paramtype[9]  = SqlDbType.Int;
                    paramtype[10] = SqlDbType.Int;
                    paramtype[11] = SqlDbType.NVarChar;
                    paramtype[12] = SqlDbType.Int;
                    paramtype[13] = SqlDbType.Int;
                    paramtype[14] = SqlDbType.Int;
                    paramtype[15] = SqlDbType.Int;
                    paramtype[16] = SqlDbType.Int;


                    int x;
                    con.OpenConection();
                    x = con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("sp_Contracting_Entites_insert", paramname, paramvalue, paramtype);
                    // con.ExecutenonReturnProcdure("sp_Access_Method_insert", paramname, paramvalue, paramtype);
                    if (x == 1)
                    {
                        MessageBox.Show("تمت الاضافة بنجاح ");
                    }
                    this.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
            #endregion insert
        }
Exemple #29
0
 private void Form13_Load(object sender, EventArgs e)
 {
     con.OpenConection();
 }
Exemple #30
0
        private void button1_Click(object sender, EventArgs e)
        {
            Connection con = new Connection();

            con.OpenConection();


            string[] param_names = new string[] {
                "@intial_assesment_date"
                , "@inventry_id"
                , "@doc_code"
                , "@weightt"
                , "@head"
                , "@lenght"
                , "@abdominalc"
                , "@void_urine "
                , "@tempreture "
                , "@heart_rate"
                , "@respiratory"
                , "@pass_stool"
                , "@physical_examination_color"
                , "@physical_examination_head"
                , "@physical_examination_fontanels"
                , "@physical_examination_eyes"
                , "@physical_examination_ears"
                , "@physical_examination_nose"
                , "@physical_examination_mouth"
                , "@physical_examination_neck"
                , "@physical_examination_calavicles "
                , "@physical_examination_breast "
                , "@physical_examination_thorax "
                , "@physical_examination_activity"
                , "@physical_examination_heart "
                , "@physical_examination_abdomen"
                , "@physical_examination_liver "
                , "@physical_examination_spleen "
                , "@physical_examination_lungs "
                , "@physical_examination_hernia "
                , "@physical_examination_umbilicus "
                , "@physical_examination_genitilia "
                , "@physical_examination_anus "
                , "@physical_examination_deformit"
                , "@physical_examination_skin "
                , "@physical_examination_extemities"
                , "@physical_examination_solo_crease "
                , "@physical_examination_reflexes "
                , "@physical_examination_moro "
                , "@physical_examination_grasp "
                , "@physical_examination_light "
                , "@physical_examination_glabellar"
                , "@physical_examination_rooting "
                , "@physical_examination_suckling "
                , "@immpression_tatitional_age "
                , "@immpression_weeks "
                , "@immpression_provisional_diagnosis "
                , "@immpression_date"
            }; // الامراض الوراثسيه والعائليه للمريض


            //@doc_code            @age   اسم الدكتور               @name       اسمالمريض             @iventry id                @date                                 @present                          @past                            @family
            string[] param_values = new string[]

            {
                dateTimePicker1.Value.ToString("yyyy-MM-dd"),
                textBox45.Text,                  //   "@initial_assessment_date" ,
                textBox46.Text,                  //    "@doc_code" ,                                                  //   weight ,
                textBox15.Text,                  // head
                textBox1.Text,
                textBox14.Text,                  //   length
                textBox2.Text,                   //   "@patient_id"  ,
                textBox7.Text,                   //    "@general_apperance_age" ,
                textBox8.Text,                   //   "@general_apperance_conscious_level" ,
                textBox3.Text,                   //   "@general_apperance_glass_coma_score" ,
                textBox4.Text,                   //   "@general_apperance_h_r" ,
                textBox6.Text,                   //   "@general_apperance_r_r" ,
                textBox5.Text,                   //   "@general_apperance_tempreture" ,
                textBox17.Text,                  //   "@general_apperance_blood_pressure" ,
                textBox16.Text,                  //   "@general_apperance_color" ,
                textBox11.Text,                  //   "@general_apperance_turgor",
                textBox9.Text,                   //  "@general_apperance_eruption" ,
                textBox10.Text,                  //   "@head_neck_fascies" ,
                textBox18.Text,                  //    "@head_neck_eyes" ,
                textBox12.Text,                  //   "@head_neck_mouth_tongue" ,
                textBox13.Text,                  //   "@head_neck_pharynx" ,
                textBox19.Text,                  //   "@head_neck_lymph_nodes" ,
                textBox40.Text,                  //   "@head_neck_oters" ,
                textBox29.Text,                  //   "@heart_precordial_bulge" ,
                textBox27.Text,                  //   "@heart_apex_beat" ,
                textBox28.Text,                  //   "@heart_thrill",
                textBox26.Text,                  //    "@heart_heart_sound" ,
                textBox24.Text,                  //    "@heart_murmurs",
                textBox25.Text,                  //    "@heart_others" ,
                textBox21.Text,                  //    "@chest_shape" ,
                textBox22.Text,                  //    "@chest_movement" ,
                textBox20.Text,
                textBox23.Text,                  //     "@chest_reactions" ,
                textBox39.Text,                  //     "@chest_air_entry" ,
                textBox37.Text,                  //    "@chest_breath_sounds" ,
                textBox38.Text,                  //    "@chest_adventure_sounds" ,
                textBox36.Text,                  //    "@abdomen_liver",
                textBox34.Text,                  //    "@abdomen_spleen" ,
                textBox35.Text,                  //     "@abdomen_kidneys" ,
                textBox33.Text,                  //    "@abdomen_ascites" ,
                textBox31.Text,                  //   "@abdomen_others" ,
                textBox32.Text,                  //    "@back_spine_deformity" ,
                textBox30.Text,                  //     "@back_spine_sweling" ,
                textBox43.Text,                  //     "@neurological_examination_mentality" ,
                textBox44.Text,
                textBox42.Text,
                textBox41.Text,
                dateTimePicker2.Value.ToString("yyyy-MM-dd")
                //     "@neurological_examination_cranial_nerves"
            };
            SqlDbType[] param_types = new SqlDbType[]
            {
                SqlDbType.Date,
                SqlDbType.Int,
                SqlDbType.VarChar,
                SqlDbType.Float,
                SqlDbType.VarChar,
                SqlDbType.Float,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.Float,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.VarChar,
                SqlDbType.Date
            };
            con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("insert_initial_assessment", param_names, param_values, param_types);



            validation v = new validation();

            v.numbervalidation(textBox15, "this value");
            v.numbervalidation(textBox8, "this value");
            v.numbervalidation(textBox1, "this value");
            v.numbervalidation(textBox3, "this value");
            v.numbervalidation(textBox6, "this value");
            v.numbervalidation(textBox14, "this value");
            v.numbervalidation(textBox4, "this value");
            v.numbervalidation(textBox2, "this value");
            v.numbervalidation(textBox6, "this value");
            v.numbervalidation(textBox7, "this value");
            v.stringvalidation(textBox5, "this value");
            v.stringvalidation(textBox17, "this value");
            v.stringvalidation(textBox16, "this value");
            v.stringvalidation(textBox11, "this value");
            v.stringvalidation(textBox9, "this value");
            v.stringvalidation(textBox10, "this value");
            v.stringvalidation(textBox18, "this value");
            v.stringvalidation(textBox12, "this value");
            v.stringvalidation(textBox13, "this value");
            v.stringvalidation(textBox19, "this value");
            v.stringvalidation(textBox40, "this value");
            v.stringvalidation(textBox23, "this value");
            v.stringvalidation(textBox20, "this value");
            v.stringvalidation(textBox22, "this value");
            v.stringvalidation(textBox21, "this value");
            v.stringvalidation(textBox25, "this value");
            v.stringvalidation(textBox24, "this value");
            v.stringvalidation(textBox23, "this value");
            v.stringvalidation(textBox24, "this value");
            v.stringvalidation(textBox27, "this value");
            v.stringvalidation(textBox28, "this value");
            v.stringvalidation(textBox29, "this value");
            v.stringvalidation(textBox30, "this value");
            v.stringvalidation(textBox31, "this value");
            v.stringvalidation(textBox32, "this value");
            v.stringvalidation(textBox33, "this value");
            v.stringvalidation(textBox34, "this value");
            v.stringvalidation(textBox35, "this value");
            v.stringvalidation(textBox36, "this value");
            v.stringvalidation(textBox37, "this value");
            v.stringvalidation(textBox38, "this value");
            v.stringvalidation(textBox39, "this value");
            v.stringvalidation(textBox40, "this value");
            v.stringvalidation(textBox41, "this value");
            v.stringvalidation(textBox42, "this value");
            v.stringvalidation(textBox43, "this value");
            v.stringvalidation(textBox44, "this value");

            textBox1.Text  = "";
            textBox2.Text  = "";
            textBox3.Text  = "";
            textBox4.Text  = "";
            textBox5.Text  = "";
            textBox6.Text  = "";
            textBox7.Text  = "";
            textBox8.Text  = "";
            textBox9.Text  = "";
            textBox10.Text = "";
            textBox11.Text = "";
            textBox12.Text = "";
            textBox13.Text = "";
            textBox14.Text = "";
            textBox15.Text = "";
            textBox16.Text = "";
            textBox17.Text = "";
            textBox18.Text = "";
            textBox19.Text = "";
            textBox20.Text = "";
            textBox21.Text = "";
            textBox22.Text = "";
            textBox23.Text = "";
            textBox24.Text = "";
            textBox25.Text = "";
            textBox26.Text = "";
            textBox27.Text = "";
            textBox28.Text = "";
            textBox29.Text = "";
            textBox30.Text = "";
            textBox31.Text = "";
            textBox32.Text = "";
            textBox33.Text = "";
            textBox34.Text = "";
            textBox35.Text = "";
            textBox36.Text = "";
            textBox37.Text = "";
            textBox38.Text = "";
            textBox39.Text = "";
            textBox40.Text = "";
            textBox41.Text = "";
            textBox42.Text = "";
            textBox43.Text = "";
            textBox44.Text = "";
        }