Beispiel #1
0
        private void تعديل_البطاقة_العلاجية_لمريض_Load(object sender, EventArgs e)
        {
            con.OpenConection();
            MessageBox.Show(f.ToString());
            try {
                string[]    s  = new string[] { "@x" };
                string[]    s2 = new string[] { f.ToString() };
                SqlDbType[] s3 = new SqlDbType[] { SqlDbType.VarChar };
                dataGridView1.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("update_medical_card", s, s2, s3);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
            //Connection con = new Connection("server=localhost,database=hospital,uid=);
            //MySqlDataAdapter da = new MySqlDataAdapter("select *from  Registeration_patientRegisteration where  patient_id=f", con);

            //DataSet c= new DataSet();
            //dataGridView1.DataSource = c.Tables[0];
        }
Beispiel #2
0
        private void Form30_Load(object sender, EventArgs e)
        {
            con.OpenConection();
            dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("productt");
            con.CloseConnection();
            //dataGridView1.DataSource = null;
            //ds.Tables.Clear();
            //dataGridView1.Rows.Clear();
            //dataGridView1.Refresh();
            //SqlCommand cmd = new SqlCommand("productt", con);
            //cmd.CommandType = CommandType.StoredProcedure;
            //da = new SqlDataAdapter(cmd);

            //SqlCommandBuilder cb = new SqlCommandBuilder(da);
            //da.Fill(ds);
            //dataGridView1.DataSource = ds.Tables[0];
        }
 private void Form36_Load(object sender, EventArgs e)
 {
     con.OpenConection();
     dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("fservice");
     con.CloseConnection();
     //dataGridView1.DataSource = null;
     //ds.Tables.Clear();
     //dataGridView1.Rows.Clear();
     //dataGridView1.Refresh();
     //SqlCommand cmd = new SqlCommand("fservice", con);
     //cmd.CommandType = CommandType.StoredProcedure;
     //da = new SqlDataAdapter(cmd);
     ////da = new SqlDataAdapter("select * from services", @"Server=DEMIANA\SQLEXPRESS;Database=PHIS;integrated security=true");
     //SqlCommandBuilder cb = new SqlCommandBuilder(da);
     //da.Fill(ds);
     //dataGridView1.DataSource = ds.Tables[0];
 }
Beispiel #4
0
        private void label3_Click(object sender, EventArgs e)
        {
            connect.OpenConection();
            string procName = "Traing_Jobs";

            string[]    paramNames  = { };
            string[]    paramValues = { };
            SqlDbType[] paramType   = { };
            dataGridView1.DataSource = connect.ShowDataInGridViewUsingStoredProc(procName);

            /*
             * connect.ShowDataInGridViewUsingStoredProc(procName);
             * connect.ShowDataInGridViewUsingStoredProc(procName, paramNames, paramValues, paramType);
             * connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(procName, paramNames, paramValues, paramType);
             */
            connect.CloseConnection();
        }
 private void A_FRM_Accommodation_Degree_Load(object sender, EventArgs e)
 {
     #region
     object x = new object();
     try
     {
         con.OpenConection();
         x              = con.ShowDataInGridViewUsingStoredProc("sp_Accommodation_Degrees_Select");
         dt             = (DataTable)x;
         DGV.DataSource = dt;
     }
     catch (Exception)
     {
         throw;
     }
     #endregion
 }
Beispiel #6
0
        private void radiology_Load(object sender, EventArgs e)
        {
            Connection con = new Connection();

            try
            {
                con.OpenConection();

                object dt = con.ShowDataInGridViewUsingStoredProc("radiology");
                reportViewer1.LocalReport.DataSources.Clear();
                var rtds = new ReportDataSource("DataSet1", dt);
                reportViewer1.LocalReport.DataSources.Add(rtds);
                reportViewer1.RefreshReport();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
            finally { con.CloseConnection(); }
        }
Beispiel #7
0
        private void Salvage_Report_Load(object sender, EventArgs e)
        {
            this.reportViewer1.RefreshReport();
            Connection sqlCon = new Connection();

            try
            {
                sqlCon.OpenConection();
                object xx = sqlCon.ShowDataInGridViewUsingStoredProc("asset_sal_select");
                comboBox1.DataSource    = xx;
                comboBox1.ValueMember   = "code";
                comboBox1.DisplayMember = "arabic_name";
                label2.DataBindings.Add("text", xx, "code");
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
            finally { sqlCon.CloseConnection(); }
        }
Beispiel #8
0
        private void button4_Click(object sender, EventArgs e)
        {
            Connection mycon = new Connection();

            mycon.OpenConection();
            //con.Open();

            string[]    pname  = { "@id_dif" };
            string[]    pvalue = { textBox3.Text };
            SqlDbType[] ptype  = { SqlDbType.Int };

            DataTable dt = (DataTable)mycon.ShowDataInGridViewUsingStoredProc("p10", pname, pvalue, ptype);

            //SqlDataReader dr = dt.CreateDataReader();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBox1.Items.Add(dt.Rows[i].ItemArray[i].ToString());
            }
            mycon.CloseConnection();
            // rd.Close();

            /*
             * conn.Open();
             *
             * SqlDataReader rd;
             *
             * conn.Open();
             * SqlCommand cmd = new SqlCommand("p10", conn);
             * cmd.CommandType = CommandType.StoredProcedure;
             * cmd.Parameters.AddWithValue("@id_dif", textBox3.Text);
             * //string s = "select select all from differentservices where id_differentservices ="+textBox3.Text+" ;";
             * //SqlCommand cmd = new SqlCommand(s, conn);
             *
             * rd = cmd.ExecuteReader();
             * while (rd.Read())
             * {
             *
             *  comboBox1.Items.Add(rd["select all"]);
             *
             * }
             *
             * rd.Close();
             * rd.Dispose();
             * conn.Close();*/
        }
Beispiel #9
0
        private void label3_Click(object sender, EventArgs e)
        {
            connect.OpenConection();

            string procName = "TRAINING_COURSE_NAMETRAININGCOURSE";

            string[]    paramNames  = { }; //"@cl_name" };
            string[]    paramValues = { }; //textBox2.Text };
            SqlDbType[] paramType   = { }; //SqlDbType.VarChar };
            dataGridView1.DataSource = connect.ShowDataInGridViewUsingStoredProc(procName);

            /*
             * connect.ShowDataInGridViewUsingStoredProc(procName);
             * connect.ShowDataInGridViewUsingStoredProc(procName, paramNames, paramValues, paramType);
             * connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(procName, paramNames, paramValues, paramType);
             */
            connect.CloseConnection();
        }
Beispiel #10
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         con.OpenConection();
         String[]     x  = { dateTimePicker1.Value.ToString(), dateTimePicker2.Value.ToString() };
         String[]     y  = { "@x", "@y" };
         SqlDbType [] z  = { SqlDbType.Date, SqlDbType.Date };
         object       dt = con.ShowDataInGridViewUsingStoredProc("demand_account", y, x, z);
         reportViewer1.LocalReport.DataSources.Clear();
         var rtds = new ReportDataSource("DataSet1", dt);
         reportViewer1.LocalReport.DataSources.Add(rtds);
         reportViewer1.RefreshReport();
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
     finally { con.CloseConnection(); }
     this.reportViewer1.RefreshReport();
 }
Beispiel #11
0
        private void catogrical_reservation_Load(object sender, EventArgs e)
        {
            // con = new MySqlConnection("server=localhost;uid=root;pwd=root;database=hospital1");

            con.OpenConection();


            dataGridView1.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("cateogirical_reservation");
            //string s = "select catog_code  as 'كود الجهه',name as 'اسم الجهه' from catogricals;";
            //cmd = new MySqlCommand(s, con);
            //MySqlDataReader dr = cmd.ExecuteReader();
            //DataTable d = new DataTable();
            //d.Load(dr);
            //dataGridView1.DataSource = d;
            //dr.Close();
            //con.Close();
            con.CloseConnection();
        }
Beispiel #12
0
        private void الاطباء_Load(object sender, EventArgs e)

        {
            con.OpenConection();
            dataGridView1.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("emergency_doctor1");
            //con = new MySqlConnection("server=localhost;uid=root;pwd=root;database=hospital1");

            //con.Open();
            //string s = "select doctor_code as 'كود الطبيب',doctor_name as 'اسم الطبيب' from doctors;";
            //cmd = new MySqlCommand(s, con);
            //MySqlDataReader dr = cmd.ExecuteReader();
            //DataTable d = new DataTable();
            //d.Load(dr);
            //dataGridView1.DataSource = d;
            //dr.Close();
            //con.Close();
            con.CloseConnection();
        }
Beispiel #13
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                con.OpenConection();
                //not find table [0]
                string[]    pramname  = new string[6];
                string[]    pramvalue = new string[6];
                SqlDbType[] pramtype  = new SqlDbType[6];
                pramname[0] = "@x1";
                pramname[1] = "@x2";
                pramname[2] = "@x3";
                pramname[3] = "@x4";
                pramname[4] = "@x5";
                pramname[5] = "@x6";

                pramvalue[0] = comboBox2.SelectedItem.ToString();
                pramvalue[1] = textBox1.Text;
                pramvalue[2] = comboBox1.SelectedItem.ToString();
                pramvalue[3] = dateTimePicker4.Value.ToString();
                pramvalue[4] = dateTimePicker1.Value.ToString();
                pramvalue[5] = textBox3.Text;

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



                //con.OpenConection();

                dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("Cancel_claims_delivery", pramname, pramvalue, pramtype);
                //MessageBox.Show("");
                con.CloseConnection();
            }
            catch (Exception)
            {
                MessageBox.Show("من فضلك ادخل البيانات كاملة ");
            }
        }
Beispiel #14
0
        private void btn_search_Click(object sender, EventArgs e)
        {
            try
            {
                connect.OpenConection();
                string pName = "planing_job_name";

                string[]    paramNames  = { "@j_code" };
                string[]    paramValues = { textBox2.Text };
                SqlDbType[] paramType   = { SqlDbType.VarChar };

                dataGridView1.DataSource = connect.ShowDataInGridViewUsingStoredProc(pName, paramNames, paramValues, paramType);
            }
            catch (Exception)
            {
                MessageBox.Show("قم بادخال الكود للبحث ");
            }
            connect.CloseConnection();
        }
Beispiel #15
0
        private void A_FRM_Contracting_Entities_Load(object sender, EventArgs e)
        {
            object x = new object();

            try
            {
                con.OpenConection();
                x                         = con.ShowDataInGridViewUsingStoredProc("sp_Contracting_Entities_Select");
                dt                        = (DataTable)x;
                DGV.DataSource            = dt;
                DGV.Columns[0].HeaderText = "الكود";
                DGV.Columns[1].HeaderText = "الاسم العربى";
                DGV.Columns[2].HeaderText = "الاسم اللاتينى";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #16
0
        public void generate_reports()
        {
            Connection sqlCon = new Connection();

            try
            {
                sqlCon.OpenConection();
                object dt = sqlCon.ShowDataInGridViewUsingStoredProc("asset_report");
                reportViewer1.LocalReport.DataSources.Clear();
                var rtds = new ReportDataSource("DataSet1", dt);
                reportViewer1.LocalReport.DataSources.Add(rtds);
                reportViewer1.RefreshReport();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
            finally
            {
                sqlCon.CloseConnection();
            }
        }
Beispiel #17
0
 private void button1_Click(object sender, EventArgs e)
 {
     con.OpenConection();
     try
     {
         dataGridView1.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("disp_emergency_services");
         //    string s = "select serv_code as 'كود الخدمة',serv_name as 'اسم الخدمة',serv_time as 'توقيت الخدمة' from emergency_emergency_services;";
         //    cmd1 = new MySqlCommand(s, con);
         //    dr = cmd1.ExecuteReader();
         //    DataTable dt = new DataTable();
         //    dt.Load(dr);
         //    dataGridView1.DataSource = dt;
         //    dr.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     con.CloseConnection();
 }
Beispiel #18
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                x.OpenConection();
                String[]    arr1 = { "@z" };
                String[]    arr2 = { comboBox1.SelectedItem.ToString() };
                SqlDbType[] arr3 = { SqlDbType.Int };
                object      dt   = x.ShowDataInGridViewUsingStoredProc("spgy", arr1, arr2, arr3);
                reportViewer1.LocalReport.DataSources.Clear();
                var rtds = new ReportDataSource("DataSet1", dt);
                reportViewer1.LocalReport.DataSources.Add(rtds);
                reportViewer1.RefreshReport();
            }

            catch (Exception ex)
            {
                MessageBox.Show(" من فضلك أدخل السنة ");
            }
        }
Beispiel #19
0
        private void toolStripLabel2_Click(object sender, EventArgs e)
        {
            string[]    a = { name.Text, website.Text, address.Text, type.Text, natureOfActivity.Text, e_mail.Text, phoneNumber.Text };
            string[]    b = { "@name", "@website", "@address", "@type", "@natureOfActivity", "@e_mail", "@phoneNumberint" };
            SqlDbType[] c = { SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.Int };

            conn.OpenConection();
            conn.ShowDataInsertUsingStoredProc("supplier_insert", b, a, c);
            conn.CloseConnection();

            conn.OpenConection();
            dataGridView1.DataSource = conn.ShowDataInGridViewUsingStoredProc("supplier_Select");
            clear.Clear(this);
            conn.CloseConnection();
        }
Beispiel #20
0
        private void button1_Click(object sender, EventArgs e)
        {
            Connection con = new Connection();

            con.OpenConection();
            if (con.DataReader("pharmacy_select_patientDescription").HasRows)
            {
                con.ShowDataInGridViewUsingStoredProc("pharmacy_select_patientDescription");
            }
            else
            {
                MessageBox.Show("لا يوجد مرضى.....");
            }

            //cmd = new SqlCommand("select visit_id as 'رقم الزيارة', entranceoffice_visit.pat_id As '  رقم المريض ', Registeration_patientRegisteration.patient_name  as ' اسم المريض' from follow_up_sheet_slected_med, follow_up_sheet, entranceoffice_visit,Registeration_patientRegisteration where follow_up_sheet_slected_med.inventry_id=follow_up_sheet.inventry_id and follow_up_sheet.inventry_id=entranceoffice_visit.visit_id and entranceoffice_visit.pat_id=Registeration_patientRegisteration.patient_id", connection);
            //dr = cmd.ExecuteReader();
            //DataTable dt = new DataTable();
            //dt.Load(dr);
            //dataGridView1.DataSource = dt;
            //dr.Close();
        }
Beispiel #21
0
        private void button1_Click(object sender, EventArgs e)
        {
            Connection con = new Connection();

            try
            {
                con.OpenConection();

                String []   a  = { "@x", "@y" };
                String []   b  = { dateTimePicker1.Value.ToString(), dateTimePicker2.Value.ToString() };
                SqlDbType[] c  = { SqlDbType.Date, SqlDbType.Date };
                object      dt = con.ShowDataInGridViewUsingStoredProc("occupation_rate", a, b, c);
                reportViewer1.LocalReport.DataSources.Clear();
                var rtds = new ReportDataSource("DataSet1", dt);

                reportViewer1.LocalReport.DataSources.Add(rtds);
                reportViewer1.RefreshReport();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
            finally { con.CloseConnection(); }
        }
Beispiel #22
0
        private void lab_serviceName_Load(object sender, EventArgs e)
        {
            Connection con = new Connection();

            try
            {
                con.OpenConection();
                //SqlCommand cmd = new SqlCommand("lab_serviceName", con);
                //cmd.CommandType = CommandType.StoredProcedure;
                //SqlDataReader dr = cmd.ExecuteReader();
                //DataTable dt = new DataTable();
                //dt.Load(dr);
                object dt = con.ShowDataInGridViewUsingStoredProc("lab_serviceName");
                reportViewer1.LocalReport.DataSources.Clear();
                var rtds = new ReportDataSource("DataSet1", dt);
                reportViewer1.LocalReport.DataSources.Add(rtds);
                reportViewer1.RefreshReport();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
            finally { con.CloseConnection(); }
        }
Beispiel #23
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         int         device_code = int.Parse(comboBox3.SelectedValue.ToString());
         string[]    pramname    = new string[1];
         string[]    pramvalue   = new string[1];
         SqlDbType[] pramtype    = new SqlDbType[1];
         pramname[0]  = "@Device_code";
         pramvalue[0] = device_code.ToString();
         pramtype[0]  = SqlDbType.Int;
         con.OpenConection();
         dt.Clear();
         object x = new object();
         x = con.ShowDataInGridViewUsingStoredProc("physiotherapy_execute_plan_select", pramname, pramvalue, pramtype);;
         dataGridView1.DataSource = (DataTable)x;
     }
     catch (Exception ex)
     { MessageBox.Show(ex.Message); }
     finally { con.CloseConnection(); }
 }
Beispiel #24
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         string[]    s  = new string[] { "@g", "@x", "@y" };
         string[]    s2 = new string[] { comboBox1.Text, textBox1.Text, textBox2.Text };
         SqlDbType[] s3 = new SqlDbType[] { SqlDbType.VarChar, SqlDbType.Int, SqlDbType.Int };
         dataGridView1.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("registration_report_list", s, s2, s3);
         //string s = "select patient_name,address_of_patient,nationality ,marital_status from Registeration_patientRegisteration where gender=@g and age between @x and @y";
         //cmd = new MySqlCommand(s, con);
         //cmd.Parameters.AddWithValue("@g", comboBox1.SelectedItem);
         //cmd.Parameters.AddWithValue("@x", textBox1.Text);
         //cmd.Parameters.AddWithValue("@y", textBox2.Text);
         //da = new MySqlDataAdapter(cmd);
         //MySqlCommandBuilder cb = new MySqlCommandBuilder(da);
         //da.Fill(ds);
         //bs.DataSource = ds.Tables[0];
         //dataGridView1.DataSource = bs;
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
 }
Beispiel #25
0
        private void Form1_Load(object sender, EventArgs e)
        {
            sqlCon.OpenConection();
            String[]    a    = { "@table" };
            String[]    b    = { "asset_store" };
            SqlDbType[] c    = { SqlDbType.NVarChar };
            object      dt   = sqlCon.ShowDataInGridViewUsingStoredProc("asset_get_code", a, b, c);
            DataTable   dtt  = (DataTable)dt;
            int         code = 0;

            if (dtt.Rows.Count != 0)
            {
                code = Convert.ToInt32(dtt.Rows[0][0]) + 1;
            }

            else
            {
                code = 1;
            }
            textBox1.Text = code.ToString();
        }
Beispiel #26
0
        private void حذفToolStripMenuItem_Click(object sender, EventArgs e)
        {
            con.OpenConection();

            string[]    pramname  = new string[1];
            string[]    pramvalue = new string[2];
            SqlDbType[] pramtype  = new SqlDbType[1];
            pramname[0] = "@x";


            pramvalue[0] = textBox1.Text;


            pramtype[0] = SqlDbType.Int;


            object x = new object();

            con.ShowDataInGridViewUsingStoredProc("MedicalSheet_BodyComponentPhoto_deleteRecord_byID", pramname, pramvalue, pramtype);
            MessageBox.Show("تم عمليه الحذف بنجاح");
            con.CloseConnection();
        }
Beispiel #27
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                sqlCon.OpenConection();

                String[] a = { "@t", "@c", "@ar", "@la", "@flag" };
                String[] b = { "asset_re_evaluation_reasons", "0", textBox2.Text, textBox3.Text, "0" };
                if (textBox1.Text != "")
                {
                    b[4] = "1";
                    b[1] = textBox1.Text;
                }
                SqlDbType[] c = { SqlDbType.NVarChar, SqlDbType.Int, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Int };
                dataGridView1.DataSource = sqlCon.ShowDataInGridViewUsingStoredProc("search_conditional1", a, b, c);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally { sqlCon.CloseConnection(); }
        }
Beispiel #28
0
        private void button1_Click(object sender, EventArgs e)
        {
            con.OpenConection();

            try
            {
                dataGridView1.DataSource = (DataTable)con.ShowDataInGridViewUsingStoredProc("add_emegency_doctors_dispaly");

                //string s = "select * from emergency_emergency_doctors;";
                //cmd1 = new MySqlCommand(s, con);
                //dr = cmd1.ExecuteReader();
                //DataTable d = new DataTable();
                //d.Load(dr);
                //dataGridView1.DataSource = d;
                //dr.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            con.CloseConnection();
        }
Beispiel #29
0
 private void Form22_Load(object sender, EventArgs e)
 {
     try
     {
         con.OpenConection();
         dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("bill_show");
         con.CloseConnection();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally { con.CloseConnection(); }
     //dataGridView1.DataSource = null;
     //ds.Tables.Clear();
     //dataGridView1.Rows.Clear();
     //dataGridView1.Refresh();
     //da = new SqlDataAdapter("bill_show", con);
     //SqlCommandBuilder cb = new SqlCommandBuilder(da);
     //da.Fill(ds);
     //dataGridView1.DataSource = ds.Tables[0];
 }
 private void Form13_Load(object sender, EventArgs e)
 {
     /*dataGridView1.DataSource = null;
      * ds.Tables.Clear();
      * dataGridView1.Rows.Clear();
      * dataGridView1.Refresh();
      * da = new sqlDataAdapter("select * from subactor", "server=localhost;database=final;uid=root;pwd=root");
      * sqlCommandBuilder cb = new sqlCommandBuilder(da);
      * da.Fill(ds);
      * dataGridView1.DataSource = ds.Tables[0];*/
     try
     {
         con.OpenConection();
         dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("data_subactor");
         con.CloseConnection();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally { con.CloseConnection(); }
 }