Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
 protected void btnThem_Click(object sender, EventArgs e)
 {
     ChucVuDAO cvdao = new ChucVuDAO();
     string ten = txtTenChucVu.Text;
     cvdao.ThemChucVu(ten);
     HienThiDanhSach();
     txtTenChucVu.Text = "";
 }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
 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();
            }
        }