Example #1
0
        private void hienThi()
        {
            DataTable table = new DataTable();

            table = BLL.showKH();
            dgvKhachHang.DataSource = table;
        }
        // hàm lấy ra mã khách hàng cuối cùng
        public static String getLastIndexCustomer(String MaKHLastIndexof)
        {
            DataTable customers = BLL.showKH();
            int       index     = customers.Rows.Count;

            if (index > 0)
            {
                DataRow row = customers.Rows[index - 1];

                MaKHLastIndexof = (int.Parse(row["BaseID"].ToString()) + 1).ToString();
                return("KH" + MaKHLastIndexof);
            }
            else
            {
                return("KH1");
            }
        }