コード例 #1
0
ファイル: frmLop.cs プロジェクト: Org-1124/QuanLyTruongHoc
        private void btnThem_Click(object sender, EventArgs e)
        {
            btnLuu.Visible  = true;
            btnhuy.Visible  = true;
            btnThem.Visible = false;
            btnSua.Visible  = false;
            btnXoa.Visible  = false;
            hien();
            txtSoLuongHS.ReadOnly = true;
            ktluu = 2;
            DataTable maxid = new DataTable();

            maxid = LopDAO.MaxIDLop();
            int idlop;

            try
            {
                idlop = (int)maxid.Rows[0][0];
            }
            catch
            {
                idlop = 0;
            }
            idlop++;
            txtIDLop.Text = idlop.ToString();
            int soluong = 0;

            txtSoLuongHS.Text = soluong.ToString();
        }