protected void gvDSChucVu_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     ChucVuDAO cvdao = new ChucVuDAO();
     int autoid = int.Parse(gvDSChucVu.DataKeys[e.RowIndex].Value.ToString());
     cvdao.XoaChucVu(autoid);
     HienThiDanhSach();
 }
 protected void btnThem_Click(object sender, EventArgs e)
 {
     ChucVuDAO cvdao = new ChucVuDAO();
     string ten = txtTenChucVu.Text;
     cvdao.ThemChucVu(ten);
     HienThiDanhSach();
     txtTenChucVu.Text = "";
 }
        protected void gvDSChucVu_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GridViewRow row = gvDSChucVu.Rows[e.RowIndex];

            TextBox txt2nd_column = row.Cells[1].Controls[0] as TextBox;

            int a = Int32.Parse(gvDSChucVu.DataKeys[e.RowIndex].Value.ToString());
            string b = txt2nd_column.Text;

            ChucVuDAO cvdao = new ChucVuDAO();
            cvdao.SuaChucVu(a, b);

            e.Cancel = true;
            gvDSChucVu.EditIndex = -1;
            HienThiDanhSach();
        }
 protected void HienThiDanhSach()
 {
     ChucVuDAO cvdao = new ChucVuDAO();
     gvDSChucVu.DataSource = cvdao.DSChucVu();
     gvDSChucVu.DataBind();
 }
        void load_ChucVu()
        {
            if (!this.IsPostBack)
            {
                ChucVuDAO cvdao = new ChucVuDAO();
                drChucVu.DataSource = cvdao.DSChucVu();
                drChucVu.DataValueField = "Id_ChucVu";
                drChucVu.DataTextField = "TenChucVu";
                drChucVu.DataBind();

                drChucVuS.DataSource = cvdao.DSChucVu();
                drChucVuS.DataValueField = "Id_ChucVu";
                drChucVuS.DataTextField = "TenChucVu";
                drChucVuS.DataBind();
            }
        }