Exemple #1
0
        private void cmsXoaSTK_Click(object sender, EventArgs e)
        {
            // ' Get the current cell location.
            int currentRowIndex = dgvSoTietKiem.CurrentCellAddress.Y;// 'current row selected


            //'Verify that indexing OK
            if (-1 < currentRowIndex && currentRowIndex < dgvSoTietKiem.RowCount)
            {
                SoTietKiemDTO stk = (SoTietKiemDTO)dgvSoTietKiem.Rows[currentRowIndex].DataBoundItem;
                if (stk != null)
                {
                    bool kt = stkBUS.dongSoTietKiem(stk);
                    if (kt == false)
                    {
                        MessageBox.Show("Đóng sổ tiết kiệm thất bại. Vui lòng kiểm tra lại dũ liệu");
                    }
                    else
                    {
                        MessageBox.Show("Đóng sổ tiết kiệm thành công");
                        this.LoadData();
                    }
                }
            }
        }
Exemple #2
0
        private void BtnDongSo_Click(object sender, EventArgs e)
        {
            //1. Map key primary from GUI
            SoTietKiemDTO stk = new SoTietKiemDTO();

            stk.StrMaSoSTK = txtMaSoSTK.Text;
            //2. Kiểm tra data hợp lệ

            //3. Xóa khỏi DB
            bool kq = stkBUS.dongSoTietKiem(stk);

            if (kq == false)
            {
                MessageBox.Show("Đóng Sổ Tiết Kiệm thất bại. Vui lòng kiểm tra lại dũ liệu");
            }
            else
            {
                MessageBox.Show("Đóng Sổ tiết kiệm thành công");
            }
        }