Beispiel #1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            std stdn = new std();

            stdn.stdno = txtstdno.Text;
            if (!stdn.SelectfornameCheck().Equals(txtname.Text))
            {
                MessageBox.Show("نام هنرجو  با شماره پرونده مطابقت ندارد", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtname.Focus();
                return;
            }


            ghabz gh = new ghabz();

            gh.id        = txtid.Text;
            gh.stdno     = txtstdno.Text;
            gh.name      = txtname.Text.Trim();
            gh.artcourse = txtartcourse.Text.Trim();
            gh.date      = txtdate.Text;
            gh.lastcheck = txtlastcheck.Text;
            gh.lastdate  = txtlastdate.Text;
            gh.mablagh   = long.Parse(txtmablagh.Text);
            gh.sharh     = txtsharh.Text;
            gh.Update();


            MessageBox.Show("قبض با موفقیت ویرایش گردید");
            this.Close();
        }
Beispiel #2
0
        private void cmdadd_Click(object sender, EventArgs e)
        {
            std stdn = new std();

            stdn.stdno = txtstdno.Text;
            if (!stdn.SelectfornameCheck().Equals(txtname.Text))
            {
                MessageBox.Show("نام هنرجو با شماره پرونده مطابقت ندارد", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtname.Focus();
                return;
            }


            ghabz gh = new ghabz();

            gh.id        = txtid.Text;
            gh.stdno     = txtstdno.Text;
            gh.name      = txtname.Text.Trim();
            gh.artcourse = txtartcourse.Text.Trim();
            gh.date      = txtdate.Text;
            gh.lastcheck = txtlastcheck.Text;
            gh.lastdate  = txtlastdate.Text;
            gh.mablagh   = long.Parse(txtmablagh.Text);
            gh.paid      = long.Parse(txtpaid.Text);
            gh.sharh     = txtsharh.Text;
            gh.Update();

            if (!stdno.Equals(txtstdno.Text))
            {
                std_history st = new std_history();
                st.ghabz_id = txtid.Text;
                st.stdno    = stdno; // old stdno
                st.Delete();

                pardakht();
                Daryaft();
            }
            else
            {
                std_history sh = new std_history();
                sh.ghabz_id   = txtid.Text;
                sh.stdno      = txtstdno.Text;;
                sh.sharh      = "شهریه " + txtlastcheck.Text + "-" + txtsharh.Text;
                sh.date       = txtdate.Text;
                sh.bedehkari  = long.Parse(txtmablagh.Text);
                sh.bestankari = long.Parse(txtmablagh.Text);
                sh.UpdateAfterEslahGhabz();
            }

            MessageBox.Show("قبض با موفقیت ویرایش گردید");

            this.Close();
        }