コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 private void GanDuLieu(ChucVuObj cv1obj)
 {
     cv1obj.MaCV  = txtMaCV.Text.ToString().Trim();
     cv1obj.TenCV = txtTenCV.Text.ToString().Trim();
 }