Exemple #1
0
        private void btntienhoanlai_Click(object sender, EventArgs e)
        {
            cltamung cl = new cltamung();
            float    tientamung, tienphaitra;
            float    kq = 0;

            tientamung  = cl.chuyensangso(txttientamung.Text);
            tienphaitra = cl.chuyensangso(txttienphaitra.Text);

            kq = cl.tinhtienhoanlai(tientamung, tienphaitra);
            txttienhoanlai.Text = cl.chuyensangchuoi(kq);
            strsql = "update tbtamung set tongtienhoanlai='" + txttienhoanlai.Text + "' where mabn='" + cbomabn.Text + "'";
            objcmd = new SqlCommand(strsql, objcon);

            objcmd.ExecuteNonQuery();
            Hienthi();
        }
        private void btntienhoanlai_Click(object sender, EventArgs e)
        {
            cltamung cl = new cltamung();
            float tientamung, tienphaitra;
            float kq = 0;
            tientamung = cl.chuyensangso(txttientamung.Text);
            tienphaitra = cl.chuyensangso(txttienphaitra.Text);
           
            kq = cl.tinhtienhoanlai(tientamung,tienphaitra);
            txttienhoanlai.Text = cl.chuyensangchuoi(kq);
            strsql = "update tbtamung set tongtienhoanlai='" + txttienhoanlai.Text + "' where mabn='" + cbomabn.Text + "'";
            objcmd = new SqlCommand(strsql, objcon);

            objcmd.ExecuteNonQuery();
            Hienthi();
        }