private void button1_Click(object sender, EventArgs e)
        {
            studentclass d = new studentclass();

            d.stdIDsg          = txt_stdID.Text;
            d.namesg           = txt_name.Text;
            d.familysg         = txt_family.Text;
            d.reshte_tahsilysg = txt_reshte_tahsily.Text;
            d.tarikh_tavalodsg = txtyear.Text + "/" + txtmonth.Text + "/" + txtday.Text;
            d.code_mellisg     = txt_codemelli.Text;
            d.maghte_tahsilysg = txt_maghte_tahsily.Text;
            d.name_pedarsg     = txt_namepedar.Text;
            d.addresssg        = txt_address.Text;
            d.code_postysg     = txt_codeposty.Text;


            if (zan.Checked == true)
            {
                d.jensiyatsg = "زن";
            }
            else if (mard.Checked == true)
            {
                d.jensiyatsg = "مرد";
            }

            if (motahel.Checked == true)
            {
                d.taaholsg = "متاهل";
            }
            else if (mojarad.Checked == true)
            {
                d.taaholsg = "مجرد";
            }

            d.tedad_kamanatisg = "0";
            d.insert_student();
        }
        ///////////////////////////////////////////////////////insert studend button
        private void btnsavestudent_Click(object sender, EventArgs e)
        {
            studentclass d = new studentclass();

            d.stdIDsg = txt_stdID.Text;
            DataTable dt = d.seaech_studend_ID();

            if (dt.Rows.Count == 0)
            {
                d.namesg           = txt_name.Text;
                d.familysg         = txt_family.Text;
                d.reshte_tahsilysg = txt_reshte_tahsily.Text;
                if (zan.Checked == true)
                {
                    d.jensiyatsg = "زن";
                }
                else if (mard.Checked == true)
                {
                    d.jensiyatsg = "مرد";
                }
                if (motahel.Checked == true)
                {
                    d.taaholsg = "متاهل";
                }
                else if (mojarad.Checked == true)
                {
                    d.taaholsg = "مجرد";
                }

                d.tarikh_tavalodsg = txtyear.Text + "/" + txtmonth.Text + "/" + txtday.Text;
                d.code_mellisg     = txt_codemelli.Text;
                d.maghte_tahsilysg = txt_maghte_tahsily.Text;
                d.name_pedarsg     = txt_namepedar.Text;
                d.addresssg        = txt_address.Text;
                d.code_postysg     = txt_codeposty.Text;
                d.tedad_kamanatisg = "0";
                d.insert_student();
            }
            else
            {
                MessageBox.Show("این دانشجو قبلا ثبت نام کرده است");
            }
            txt_stdID.Text          = "";
            txt_name.Text           = "";
            txt_family.Text         = "";
            txt_reshte_tahsily.Text = "";
            zan.Checked             = false;
            mard.Checked            = false;
            mojarad.Checked         = false;
            motahel.Checked         = false;
            txtyear.Text            = "";
            txtmonth.Text           = "";
            txtday.Text             = "";
            txt_codemelli.Text      = "";
            txt_maghte_tahsily.Text = "";
            txt_namepedar.Text      = "";
            txt_address.Text        = "";
            txt_codeposty.Text      = "";



            ///////////////////////////////////////////////////////insert studend button
        }