Exemple #1
0
 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Bạn có chắc chắn xóa không?", "Phieu Dang Ky", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         bindingNavigator1.BindingSource.RemoveCurrent();
         ctrl.Save();
     }
 }
Exemple #2
0
        void ThemMoi()
        {
            DataRow row = ctrl.NewRow();

            row["MaNhanPhong"] = txtMaNhanPhong.Text;
            row["MaPhieuThue"] = cmbMaPThue.SelectedValue;
            row["MaKhachHang"] = cmbMaKH.SelectedValue;

            ctrl.Add(row);

            PhieuNhanPhongControl ctrlPN = new PhieuNhanPhongControl();

            if (ctrlPN.LayPhieuNhan(txtMaNhanPhong.Text) != null)
            {
                MessageBox.Show("Mã Phiếu này đã tồn tại !", "Phieu Nhan", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (ThamSo.LaSoNguyen(txtMaNhanPhong.Text))
            {
                int so = Convert.ToInt32(txtMaNhanPhong.Text);
                if (so >= ThamSo.LayPhieuNhan())
                {
                    ThamSo.GanPhieuNhan(so + 1);
                }
            }

            ctrl.Update();
            DataTable tblCTP = (DataTable)bindingNavigator1.BindingSource.DataSource;

            ctpnctrl.Update();
            ctrl.Save();
            ctpnctrl.Save();
            khctrl.Save();
            ptctrl.Save();
        }
 void CapNhat()
 {
     ctrl.Save();
     ctrl.Update();
 }
 private void toolStripButtonLuu_Click(object sender, EventArgs e)
 {
     ctrl.Save();
 }