示例#1
0
        private void getHocVienCode()
        {
            boHv = new BO_HOCVIEN();
            DataTable tb = new DataTable();

            tb = boHv.get_HocCVien_LastCode();
            string lCode = String.Empty;
            string fCode = string.Empty;

            lCode        = tb.Rows[0]["HOV_Code"].ToString();
            fCode        = lCode.Substring(0, 7);
            lCode        = lCode.Substring(7, 1);
            txtCode.Text = (fCode + (int.Parse(lCode.ToString()) + 1).ToString());
        }
示例#2
0
        private void vCreateCode()
        {
            DataTable tb = new DataTable();

            boHocVien = new BO_HOCVIEN();
            tb        = boHocVien.get_HocCVien_LastCode();
            string hVCode = String.Empty;

            if (tb.Rows.Count == 0)
            {
                hVCode = "000000";
            }
            else
            {
                hVCode = tb.Rows[0]["HOV_Code"].ToString();
                hVCode = hVCode.Substring(3, 5);
            }

            txtStudentCode.Text = ("HOV" + Utilities.quydinh.LaySTT(int.Parse(hVCode.ToString()) + 1)).ToString();
        }