Example #1
0
        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {
            if (DGVKhachHang.RowCount == 0)
            {
                BindingNavigatorKhachHang.Enabled = true;
            }
            DataRow m_Row = m_KhachHangCtrl.ThemDongMoi();

            m_Row["MaKH"]      = "KH" + m_QuyDinh.LaySTT(DGVKhachHang.Rows.Count + 1);;
            m_Row["HoTen"]     = "";
            m_Row["DiaChi"]    = "";
            m_Row["DienThoai"] = "";
            m_KhachHangCtrl.ThemMoi(m_Row);
            BindingNavigatorKhachHang.BindingSource.MoveLast();
        }
Example #2
0
        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {
            if (dGVKhachHang.RowCount == 0)
            {
                bindingNavigatorDeleteItem.Enabled = true;
            }

            DataRow m_Row = m_KhachHangCtrl.ThemDongMoi();

            m_Row["MaKH"]   = "KH" + dGVKhachHang.Rows.Count + 1;
            m_Row["TenKH"]  = "";
            m_Row["SDT"]    = "";
            m_Row["DiaChi"] = "";
            m_KhachHangCtrl.ThemNguoiDung(m_Row);
            bindingNavigatorKhachHang.BindingSource.MoveLast();
        }