Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                errorProvider1.Clear();


                //------------------------------------------بررسی تاریخ وارد شده--------------------------------------

                BarrasiTarikh();

                //--------------------------------------------------------------------------------



                //--------------------------تنظیم تاریخ یادداشت ---------------------


                //------------------------------------------------------

                if (comboBox13.Text == "")
                {
                    errorProvider1.SetError(comboBox13, "  روز تاریخ را وارد کنيد");
                }
                else if (comboBox12.Text == "")
                {
                    errorProvider1.SetError(comboBox12, "  ماه تاریخ را وارد کنيد");
                }
                else if (textBox2.Text == "")
                {
                    errorProvider1.SetError(textBox2, "  سال تاریخ را وارد کنيد");
                }



                else if (textBox3.Text == "")
                {
                    errorProvider1.SetError(textBox3, "موضوع را وا وارد نمایید");
                }


                else if (textBox4.Text == "")
                {
                    errorProvider1.SetError(textBox4, " متن را وا وارد نمایید");
                }



                else
                {
                    insertYaddasht();



                    textBox1.Text = "";

                    textBox3.Text = "";
                    textBox4.Text = "";

                    pictureBox1.Image = null;
                }
            }
            catch (Exception ex)
            {
                MsgBox.ShowMessage(this.Handle.ToInt32(), ex.Message.ToString(), " خطا ", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
            }
        }
Exemple #2
0
        public void insertYaddasht()
        {
            try
            {
                string str1 = "";
                str1 = ConfigurationManager.ConnectionStrings["cn1"].ConnectionString;
                SqlConnection CN = new SqlConnection(str1);



                //--------------------------------------------------------------
                string str_rouz_G = "", str_mah_G = "", str_sal_G = "";

                str_rouz_G = comboBox13.Text;
                str_mah_G  = comboBox12.Text;
                str_sal_G  = textBox2.Text;

                tarikh_G = str_sal_G + "/" + str_mah_G + "/" + str_rouz_G;

                //----------------------------------------------------



                if (textBox1.Text != "")
                {
                    // اگر تصویر انتخاب شده است

                    string qry = "insert into Yaddasht(تاریخ,موضوع,متن,تصویر,آدرس_تصویر)Values(@c1,@c2,@c3,@c4,@c5)";

                    SqlCom = new SqlCommand(qry, CN);

                    byte[] imageData = Class_mft.ReadFile(textBox1.Text);
                    SqlCom.Parameters.Add(new SqlParameter("@c1", (object)tarikh_G));
                    SqlCom.Parameters.Add(new SqlParameter("@c2", (object)textBox3.Text));
                    SqlCom.Parameters.Add(new SqlParameter("@c3", (object)textBox4.Text));

                    SqlCom.Parameters.Add(new SqlParameter("@c4", (object)imageData));


                    SqlCom.Parameters.Add(new SqlParameter("@c5", (object)textBox1.Text));
                }
                else
                {
                    //اگر تصویر انتخاب نشده باشد

                    string qry = "insert into Yaddasht(تاریخ,موضوع,متن)Values(@c1,@c2,@c3)";

                    SqlCom = new SqlCommand(qry, CN);

                    SqlCom.Parameters.Add(new SqlParameter("@c1", (object)tarikh_G));
                    SqlCom.Parameters.Add(new SqlParameter("@c2", (object)textBox3.Text));
                    SqlCom.Parameters.Add(new SqlParameter("@c3", (object)textBox4.Text));

                    //  SqlCom.Parameters.Add(new SqlParameter("@c4", (object)imageData));
                }


                CN.Open();

                SqlCom.ExecuteNonQuery();

                MsgBox.ShowMessage(this.Handle.ToInt32(), "عملیات ثبت با موفقیت انجام شد", " ", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);



                CN.Close();
            }
            catch (Exception er)
            {
                MsgBox.ShowMessage(this.Handle.ToInt32(), er.Message.ToString(), "خطا ", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
            }

            finally {
                MaxNumberYaddasht();
            }
        }
Exemple #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            try{
                errorProvider1.Clear();


                BarrasiTarikhGozaresh();


                if (comboBox13.Text == "")
                {
                    errorProvider1.SetError(comboBox13, "   روز تاریخ گزارش را وارد نمایید");
                }
                else if (comboBox12.Text == "")
                {
                    errorProvider1.SetError(comboBox12, "   ماه تاریخ گزارش را وارد نمایید");
                }
                else if (textBox2.Text == "")
                {
                    errorProvider1.SetError(textBox2, "   سال تاریخ گزارش را وارد نمایید");
                }

                else
                {
                    //--------------------------------------------------------------------------------

                    onvanGozaresh();



                    //--------------------------تنظیم تاریخ گزارش---------------------

                    string str_rouz_G = "", str_mah_G = "", str_sal_G = "";

                    str_rouz_G = comboBox13.Text;
                    str_mah_G  = comboBox12.Text;
                    str_sal_G  = textBox2.Text;

                    string tarikh_G = str_sal_G + "/" + str_mah_G + "/" + str_rouz_G;

                    //------------------------------------------------------



                    if (radioButton1.Checked == true)
                    {
                        errorProvider1.Clear();


                        if (comboBox1.Text == "")
                        {
                            errorProvider1.SetError(comboBox1, "  نوع عضویت را وارد نمایید");
                        }

                        else
                        {
                            Report2 r = new Report2("..\\Debug\\rpt\\rpt2\\Report_NovehOzviat.rdlc", " select * from Personel,ser,Sabt_ozv where Personel.کد_عضویت=Sabt_ozv.کد_عضویت  and Sabt_ozv.نوع_عضویت =N'" + comboBox1.Text + "'   ", rb1, tarikh_G);
                            r.ShowDialog();
                        }
                    }


                    else if (radioButton2.Checked == true)
                    {
                        errorProvider1.Clear();


                        if (comboBox2.Text == "")
                        {
                            errorProvider1.SetError(comboBox2, "  نوع شغل را وارد نمایید");
                        }

                        else
                        {
                            Report2 r = new Report2("..\\Debug\\rpt\\rpt2\\Report_NovehShoghl.rdlc", " select * from Personel,ser,shoghl where Personel.کد_عضویت=shoghl.کد_عضویت  and shoghl.نوع_شغل = N'" + comboBox2.Text + "' ", rb2, tarikh_G);
                            r.ShowDialog();
                        }
                    }


                    else if (radioButton3.Checked == true)
                    {
                        errorProvider1.Clear();


                        if (comboBox3.Text == "")
                        {
                            errorProvider1.SetError(comboBox3, "نام بخش را مشخص نمایید");
                        }

                        else
                        {
                            Report2 r = new Report2("..\\Debug\\rpt\\rpt2\\Report_BakhshOzviat.rdlc", " select * from Personel,ser,faal where Personel.کد_عضویت=faal.کد_عضویت  and faal.موضوع_فعالیت =N'" + comboBox3.Text + "' ", rb3, tarikh_G);
                            r.ShowDialog();
                        }
                    }


                    else if (radioButton4.Checked)
                    {
                        //SearchDB("select * from Personel where شهر_اقامت ='" + comboBox11.Text + "' ");

                        errorProvider1.Clear();


                        if (comboBox4.Text == "")
                        {
                            errorProvider1.SetError(comboBox4, " شهر محل اقامت را وارد نمایید");
                        }

                        else
                        {
                            Report2 r = new Report2("..\\Debug\\rpt\\rpt2\\Report_ShareEghamat.rdlc", " select * from Personel,ser where شهر_اقامت ='" + comboBox4.Text + "' ", rb4, tarikh_G);
                            r.ShowDialog();
                        }
                    }


                    else if (radioButton5.Checked == true)
                    {
                        errorProvider1.Clear();


                        if (comboBox5.Text == "")
                        {
                            errorProvider1.SetError(comboBox5, " میزان تحصیلات را وارد نمایید");
                        }

                        else
                        {
                            Report2 r = new Report2("..\\Debug\\rpt\\rpt2\\Report_MizaneTahsilat.rdlc", " select * from Personel,ser,tah where Personel.کد_عضویت=tah.کد_عضویت  and tah.میزان_تحصیلات =N'" + comboBox5.Text + "' ", rb5, tarikh_G);
                            r.ShowDialog();
                        }
                    }



                    else if (radioButton6.Checked == true)
                    {
                        errorProvider1.Clear();


                        if (comboBox6.Text == "")
                        {
                            errorProvider1.SetError(comboBox6, "   ,وضعیت تأهل را وارد نمایید");
                        }

                        else
                        {
                            Report2 r = new Report2("..\\Debug\\rpt\\rpt2\\Report_VazeiatTaholl.rdlc", " select * from Personel,ser where وضعیت_تاهل ='" + comboBox6.Text + "' ", rb6, tarikh_G);
                            r.ShowDialog();
                        }
                    }


                    else if (radioButton7.Checked == true)
                    {
                        errorProvider1.Clear();


                        if (comboBox7.Text == "")
                        {
                            errorProvider1.SetError(comboBox7, "  رشته تحصیلی را وارد نمایید");
                        }

                        else
                        {
                            Report2 r = new Report2("..\\Debug\\rpt\\rpt2\\Report_p_Reshtetah.rdlc", " select * from Personel,ser,tah where Personel.کد_عضویت=tah.کد_عضویت  and tah.رشته_تحصیلی like N'" + comboBox7.Text + "' ", rb7, tarikh_G);
                            r.ShowDialog();
                        }
                    }



                    else if (radioButton8.Checked == true)
                    {
                        errorProvider1.Clear();


                        if (comboBox8_1.Text == "")
                        {
                            errorProvider1.SetError(comboBox8_1, " شماره عضویت ابتدا وارد نمایید");
                        }
                        else if (comboBox8_2.Text == "")
                        {
                            errorProvider1.SetError(comboBox8_2, " شماره عضویت انتها وارد نمایید");
                        }

                        else
                        {
                            Report2 r = new Report2("..\\Debug\\rpt\\rpt2\\Report_ListKol.rdlc", "select * from Personel,ser,Sabt_ozv where Personel.کد_عضویت= Sabt_ozv.کد_عضویت and Personel.کد_عضویت between '" + comboBox8_1.Text + "' and '" + comboBox8_2.Text + "'", rb8, tarikh_G);
                            r.ShowDialog();
                        }
                    }



                    //----------radioButton9----------------



                    else if (radioButton9.Checked == true)
                    {
                        BarrasiFieldTarikhi();

                        errorProvider1.Clear();


                        if (comboBox13.Text == "")
                        {
                            errorProvider1.SetError(comboBox13, " روز تاريخ اول تولد را وارد کنيد");
                        }
                        else if (comboBox12.Text == "")
                        {
                            errorProvider1.SetError(comboBox12, " ماه تاريخ اول را وارد کنيد");
                        }
                        else if (textBox2.Text == "")
                        {
                            errorProvider1.SetError(textBox2, " سال تاريخ اول را وارد کنيد");
                        }
                        else if (comboBox21.Text == "")
                        {
                            errorProvider1.SetError(comboBox21, " روز تاريخ اول تولد را وارد کنيد");
                        }
                        else if (comboBox22.Text == "")
                        {
                            errorProvider1.SetError(comboBox22, " ماه تاريخ اول را وارد کنيد");
                        }
                        else if (textBox23.Text == "")
                        {
                            errorProvider1.SetError(textBox23, " سال تاريخ اول را وارد کنيد");
                        }

                        else if (comboBox10.Text == "")
                        {
                            errorProvider1.SetError(comboBox10, " روز تاريخ دوم را وارد کنيد");
                        }
                        else if (comboBox9.Text == "")
                        {
                            errorProvider1.SetError(comboBox9, " ماه تاريخ دوم را وارد کنيد");
                        }
                        else if (textBox1.Text == "")
                        {
                            errorProvider1.SetError(textBox1, " سال تاريخ دوم را وارد کنيد");
                        }

                        else
                        {
                            //--------------------------------تاریخ اول--------------------------
                            string str_rouz = "", str_mah = "", str_sal = "";

                            str_rouz = comboBox21.Text;
                            str_mah  = comboBox22.Text;
                            str_sal  = textBox23.Text;

                            string tarikh1 = str_sal + "/" + str_mah + "/" + str_rouz;

                            //----------------------------------تاریخ دوم----------------
                            string str_rouz2 = "", str_mah2 = "", str_sal2 = "";

                            str_rouz2 = comboBox10.Text;
                            str_mah2  = comboBox9.Text;
                            str_sal2  = textBox1.Text;

                            string tarikh2 = str_sal2 + "-" + str_mah2 + "-" + str_rouz2;
                            //-----------------------------------------------------------------------------------


                            Report2 r = new Report2("..\\Debug\\rpt\\rpt2\\Report_p_TarikhOzviat.rdlc", " select * from Personel,ser,Sabt_ozv where Personel.کد_عضویت= Sabt_ozv.کد_عضویت and Sabt_ozv.تاریخ_عضویت between '" + tarikh1 + "' and '" + tarikh2 + "' ", rb9, tarikh_G);
                            r.ShowDialog();
                        }
                    }


                    //-----------------------------



                    else if (radioButton10.Checked == true)
                    {
                        Report2 r = new Report2("..\\Debug\\rpt\\rpt2\\Report_ListKol.rdlc", " select * from Personel,ser  ", rb10, tarikh_G);
                        r.ShowDialog();
                    }

                    else if (radioButton11.Checked == true)
                    {
                        Report2 r = new Report2("..\\Debug\\rpt\\rpt2\\Report_jensiat.rdlc", " select * from Personel,ser where جنسیت='مذکر' ", rb11, tarikh_G);
                        r.ShowDialog();
                    }

                    else if (radioButton12.Checked == true)
                    {
                        Report2 r = new Report2("..\\Debug\\rpt\\rpt2\\Report_jensiat.rdlc", " select * from Personel,ser where جنسیت='موئنث' ", rb12, tarikh_G);
                        r.ShowDialog();
                    }


                    else
                    {
                        MsgBox.ShowMessage(this.Handle.ToInt32(), "هیچ انتخابی برای عملیات گزارش صورت نگرفته است", " ", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
                    }
                }
            }
            catch (Exception)
            {
                MsgBox.ShowMessage(this.Handle.ToInt32(), "خطا وجود دارد ...", "خطا", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
            }
        }
Exemple #4
0
        public void BarrasiFieldTarikhi()
        {
            //برای اینکه عدد بزرگتر از 31 روز وارد نشود..و.و


            //-----------------------------------------------------------------------------------------
            //-----------------------------------------------------------------------------------------
            //-----------------------------------------------------------------------------------------
            //-----------------------------------------------------------------------------------------
            //-----------------------------------------------------------------------------------------
            //-----------------------------------------------------------------------------------------

            //-------------------------------------------------برای بررسی تاریخ اول--------

            //برای اینکه عدد بزرگتر از 31 روز وارد نشود..و.و

            if (comboBox21.Text != "")
            {
                int num1 = int.Parse(comboBox21.Text);

                if (num1 >= 32 || comboBox21.Text == "00" || comboBox21.Text == "0")
                {
                    MsgBox.ShowMessage(this.Handle.ToInt32(), "روز تاریخ اول را صحیح وارد نمایید", " ", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);


                    comboBox21.Text = "";
                }
            }



            //برای اینکه عدد بزرگتر از 12 ماه وارد نشودو  ..و.و



            if (comboBox22.Text != "")
            {
                int num2 = int.Parse(comboBox22.Text);

                if (num2 >= 13 || comboBox22.Text == "00" || comboBox22.Text == "0")
                {
                    MsgBox.ShowMessage(this.Handle.ToInt32(), "ماه تاریخ اول را صحیح وارد نمایید", " ", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);


                    comboBox22.Text = "";
                }
            }



            if (textBox23.Text != "")
            {
                int num3 = int.Parse(textBox23.Text);
                if (num3 <= 999 || textBox23.Text == "0000" || textBox23.Text == "000" || textBox23.Text == "00" || textBox23.Text == "0")
                {
                    MsgBox.ShowMessage(this.Handle.ToInt32(), "سال تاریخ اول را صحیح وارد نمایید", " ", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);


                    textBox23.Text = "";
                }
            }

            //-----------------------------------------------------------------------------------------


            //-------------------------------------------------برای بررسی تاریخ عضویت--------

            //برای اینکه عدد بزرگتر از 31 روز وارد نشود..و.و

            if (comboBox10.Text != "")
            {
                int num1 = int.Parse(comboBox10.Text);

                if (num1 >= 32 || comboBox10.Text == "00" || comboBox10.Text == "0")
                {
                    MsgBox.ShowMessage(this.Handle.ToInt32(), "روز تاریخ دوم را صحیح وارد نمایید", " ", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);


                    comboBox10.Text = "";
                }
            }



            //برای اینکه عدد بزرگتر از 12 ماه وارد نشودو  ..و.و



            if (comboBox9.Text != "")
            {
                int num2 = int.Parse(comboBox9.Text);

                if (num2 >= 13 || comboBox9.Text == "00" || comboBox9.Text == "0")
                {
                    MsgBox.ShowMessage(this.Handle.ToInt32(), "ماه تاریخ دوم را صحیح وارد نمایید", " ", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);



                    comboBox9.Text = "";
                }
            }



            if (textBox1.Text != "")
            {
                int num3 = int.Parse(textBox1.Text);
                if (num3 <= 999 || textBox23.Text == "0000" || textBox1.Text == "000" || textBox1.Text == "00" || textBox1.Text == "0")
                {
                    MsgBox.ShowMessage(this.Handle.ToInt32(), "سال تاریخ دوم را صحیح وارد نمایید", " ", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);

                    textBox1.Text = "";
                }
            }
        }
Exemple #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            try{
                if (radioButton1.Checked)

                {
                    SearchDB("select  Personel.کد_عضویت,Sabt_ozv.نوع_عضویت,Personel.نام,Personel.فامیلی,Personel.نام_پدر,Personel.تاریخ_تولد,Personel.شماره_شناسنامه,Personel.کد_ملی,Personel.شهر_اقامت,Personel.مذهب,Personel.تابعیت,Personel.پست_الکترونیکی,Personel.تلفن_همراه,Personel.وضعیت_تاهل,Personel.آدرس from Personel,Sabt_ozv where Personel.کد_عضویت=Sabt_ozv.کد_عضویت  and Sabt_ozv.نوع_عضویت =N'" + comboBox1.Text + "' ");
                }

                else if (radioButton2.Checked)
                {
                    SearchDB("select Personel.کد_عضویت,shoghl.نوع_شغل,Personel.نام,Personel.فامیلی,Personel.نام_پدر,Personel.تاریخ_تولد,Personel.شماره_شناسنامه,Personel.کد_ملی,Personel.شهر_اقامت,Personel.مذهب,Personel.تابعیت,Personel.پست_الکترونیکی,Personel.تلفن_همراه,Personel.وضعیت_تاهل,Personel.آدرس from Personel,shoghl where Personel.کد_عضویت=shoghl.کد_عضویت  and shoghl.نوع_شغل = N'" + comboBox2.Text + "' ");
                }
                else if (radioButton3.Checked)
                {
                    SearchDB("select  Personel.کد_عضویت,faal.موضوع_فعالیت as بخش,Personel.نام,Personel.فامیلی,Personel.نام_پدر,Personel.تاریخ_تولد,Personel.شماره_شناسنامه,Personel.کد_ملی,Personel.شهر_اقامت,Personel.مذهب,Personel.تابعیت,Personel.پست_الکترونیکی,Personel.تلفن_همراه,Personel.وضعیت_تاهل,Personel.آدرس from Personel,faal where Personel.کد_عضویت=faal.کد_عضویت  and faal.موضوع_فعالیت =N'" + comboBox3.Text + "' ");
                }

                else if (radioButton4.Checked)
                {
                    SearchDB("select  Personel.کد_عضویت,Personel.شهر_اقامت,Personel.نام,Personel.فامیلی,Personel.نام_پدر,Personel.تاریخ_تولد,Personel.شماره_شناسنامه,Personel.کد_ملی,Personel.شهر_اقامت,Personel.مذهب,Personel.تابعیت,Personel.پست_الکترونیکی,Personel.تلفن_همراه,Personel.وضعیت_تاهل,Personel.آدرس  from Personel where شهر_اقامت ='" + comboBox4.Text + "' ");
                }

                else if (radioButton5.Checked)
                {
                    SearchDB("select Personel.کد_عضویت,tah.میزان_تحصیلات,Personel.نام,Personel.فامیلی,Personel.نام_پدر,Personel.تاریخ_تولد,Personel.شماره_شناسنامه,Personel.کد_ملی,Personel.شهر_اقامت,Personel.مذهب,Personel.تابعیت,Personel.پست_الکترونیکی,Personel.تلفن_همراه,Personel.وضعیت_تاهل,Personel.آدرس  from Personel,tah where Personel.کد_عضویت=tah.کد_عضویت  and tah.میزان_تحصیلات =N'" + comboBox5.Text + "' ");
                }


                else if (radioButton6.Checked)
                {
                    SearchDB("select   Personel.کد_عضویت,Personel.وضعیت_تاهل,Personel.نام,Personel.فامیلی,Personel.نام_پدر,Personel.تاریخ_تولد,Personel.شماره_شناسنامه,Personel.کد_ملی,Personel.شهر_اقامت,Personel.مذهب,Personel.تابعیت,Personel.پست_الکترونیکی,Personel.تلفن_همراه,Personel.وضعیت_تاهل,Personel.آدرس from Personel where وضعیت_تاهل ='" + comboBox6.Text + "' ");
                }
                else if (radioButton7.Checked)
                {
                    SearchDB("select   Personel.کد_عضویت,tah.رشته_تحصیلی,Personel.نام,Personel.فامیلی,Personel.نام_پدر,Personel.تاریخ_تولد,Personel.شماره_شناسنامه,Personel.کد_ملی,Personel.شهر_اقامت,Personel.مذهب,Personel.تابعیت,Personel.پست_الکترونیکی,Personel.تلفن_همراه,Personel.وضعیت_تاهل,Personel.آدرس   from Personel,tah where Personel.کد_عضویت=tah.کد_عضویت  and tah.رشته_تحصیلی = N'" + comboBox7.Text + "' ");
                }
                else if (radioButton8.Checked)
                {
                    //int x1 = int.Parse(textBox1.Text);
                    //int x2 = int.Parse(textBox2.Text);



                    SearchDB("select Personel.کد_عضویت,Personel.نام,Personel.فامیلی,Personel.نام_پدر,Personel.تاریخ_تولد,Personel.شماره_شناسنامه,Personel.کد_ملی,Personel.شهر_اقامت,Personel.مذهب,Personel.تابعیت,Personel.پست_الکترونیکی,Personel.تلفن_همراه,Personel.وضعیت_تاهل,Personel.آدرس   from Personel,Sabt_ozv where Personel.کد_عضویت= Sabt_ozv.کد_عضویت and Personel.کد_عضویت between '" + comboBox8_1.Text + "' and '" + comboBox8_2.Text + "' ");
                }



                else if (radioButton9.Checked)
                {
                    BarrasiFieldTarikhi();

                    errorProvider1.Clear();

                    if (comboBox21.Text == "")
                    {
                        errorProvider1.SetError(comboBox21, " روز تاريخ اول تولد را وارد کنيد");
                    }
                    else if (comboBox22.Text == "")
                    {
                        errorProvider1.SetError(comboBox22, " ماه تاريخ اول را وارد کنيد");
                    }
                    else if (textBox23.Text == "")
                    {
                        errorProvider1.SetError(textBox23, " سال تاريخ اول را وارد کنيد");
                    }

                    else if (comboBox10.Text == "")
                    {
                        errorProvider1.SetError(comboBox10, " روز تاريخ دوم را وارد کنيد");
                    }
                    else if (comboBox9.Text == "")
                    {
                        errorProvider1.SetError(comboBox9, " ماه تاريخ دوم را وارد کنيد");
                    }
                    else if (textBox1.Text == "")
                    {
                        errorProvider1.SetError(textBox1, " سال تاريخ دوم را وارد کنيد");
                    }

                    else
                    {
                        //--------------------------------تاریخ اول--------------------------
                        string str_rouz = "", str_mah = "", str_sal = "";

                        str_rouz = comboBox21.Text;
                        str_mah  = comboBox22.Text;
                        str_sal  = textBox23.Text;

                        string tarikh1 = str_sal + "/" + str_mah + "/" + str_rouz;

                        //----------------------------------تاریخ دوم----------------
                        string str_rouz2 = "", str_mah2 = "", str_sal2 = "";

                        str_rouz2 = comboBox10.Text;
                        str_mah2  = comboBox9.Text;
                        str_sal2  = textBox1.Text;

                        string tarikh2 = str_sal2 + "/" + str_mah2 + "/" + str_rouz2;
                        //-----------------------------------------------------------------------------------

                        SearchDB("select   Personel.کد_عضویت,Sabt_ozv.تاریخ_عضویت ,Personel.نام,Personel.فامیلی,Personel.نام_پدر,Personel.تاریخ_تولد,Personel.شماره_شناسنامه,Personel.کد_ملی,Personel.شهر_اقامت,Personel.مذهب,Personel.تابعیت,Personel.پست_الکترونیکی,Personel.تلفن_همراه,Personel.وضعیت_تاهل,Personel.آدرس from Personel,Sabt_ozv where Personel.کد_عضویت= Sabt_ozv.کد_عضویت and Sabt_ozv.تاریخ_عضویت between '" + tarikh1 + "' and '" + tarikh2 + "' ");
                    }
                }



                else if (radioButton10.Checked)
                {
                    SearchDB("select * from Personel");
                }

                else if (radioButton11.Checked)
                {
                    SearchDB("select * from Personel where جنسیت='مذکر' ");
                }

                else if (radioButton12.Checked)
                {
                    SearchDB("select * from Personel where جنسیت='موئنث' ");
                }

                else
                {
                    MsgBox.ShowMessage(this.Handle.ToInt32(), "هیچ انتخابی برای عملیات جستجو صورت نگرفته است", " ", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
                }
            }
            catch (Exception)
            {
                MsgBox.ShowMessage(this.Handle.ToInt32(), "خطا وجود دارد ...", "خطا", "تایید", "", "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
            }
        }