Example #1
0
 //thêm mới dl
 public bool AddData(ChucVuDT dtCV)
 {
     cmd.CommandText = "INSERT INTO chucvu values ('" + dtCV.Machucvu + "',N'" + dtCV.Tenchucvu + "')";
     cmd.CommandType = CommandType.Text;
     cmd.Connection  = conn.Connection;
     try
     {
         conn.OpenConn();
         cmd.ExecuteNonQuery();
         conn.CloseConn();
         return(true);
     }
     catch (Exception ex)
     {
         string mex = ex.Message;
         cmd.Dispose();
         conn.CloseConn();
     }
     return(false);
 }
Example #2
0
 //SỬA dl
 public bool UpdateData(ChucVuDT dtCV)
 {
     cmd.CommandText = "UPDATE chucvu SET tenchucvu= N'" + dtCV.Tenchucvu + "' WHERE machucvu ='" + dtCV.Machucvu + "'";
     cmd.CommandType = CommandType.Text;
     cmd.Connection  = conn.Connection;
     try
     {
         conn.OpenConn();
         cmd.ExecuteNonQuery();
         conn.CloseConn();
         return(true);
     }
     catch (Exception ex)
     {
         string mex = ex.Message;
         cmd.Dispose();
         conn.CloseConn();
     }
     return(false);
 }
Example #3
0
 public bool UpdateData(ChucVuDT dtCV)
 {
     return(cvMH.UpdateData(dtCV));
 }
Example #4
0
 public bool AddData(ChucVuDT dtCV)
 {
     return(cvMH.AddData(dtCV));
 }
Example #5
0
 //ham lay du lieu tu cotroller
 void ganDL(ChucVuDT dtCV)
 {
     dtCV.Machucvu  = txtMaChucVu.Text.Trim();
     dtCV.Tenchucvu = txtTenChucVu.Text.Trim();
 }