public bool UpdateChucVu(ChucVuObj CvObj) { cmd.CommandText = " update ChucVu set TenChucVu=N'" + CvObj.TenChucVu + "' where MaChucVu='" + CvObj.MaChucVu + "'"; cmd.CommandType = CommandType.Text; cmd.Connection = con.strConn; try { con.OpenConnect(); cmd.ExecuteNonQuery(); con.CloseConnection(); return(true); } catch (Exception ex) { string mes = ex.Message; cmd.Dispose(); con.CloseConnection(); } return(true); }
public bool AddChucVu(ChucVuObj CvObj) { cmd.CommandText = "Insert into ChucVu values ('" + CvObj.MaChucVu + "',N'" + CvObj.TenChucVu + "')"; cmd.CommandType = CommandType.Text; cmd.Connection = con.strConn; try { con.OpenConnect(); cmd.ExecuteNonQuery(); con.CloseConnection(); return(true); } catch (Exception ex) { string mes = ex.Message; cmd.Dispose(); con.CloseConnection(); } return(true); }
private void GanDuLieu(ChucVuObj cv1obj) { cv1obj.MaCV = txtMaCV.Text.ToString().Trim(); cv1obj.TenCV = txtTenCV.Text.ToString().Trim(); }