Пример #1
0
 void ganDL(NVBDT dt)
 {
     dt.Manxb  = txtMaNXB.Text.Trim();
     dt.Tennxb = txtTenNXB.Text.Trim();
     dt.Diachi = txtDiaChi.Text.Trim();
     dt.Web    = txtWeb.Text.Trim();
 }
Пример #2
0
 //SỬA dl
 public bool UpdateData(NVBDT dt)
 {
     cmd.CommandText = "UPDATE loaisach SET TenNXB= N'" + dt.Tennxb + "', DiaChiNXB= N'" + dt.Diachi + "', Website=  N'" + dt.Web + "' WHERE MaNXB ='" + dt.Manxb + "'";
     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);
 }
Пример #3
0
 //thêm mới dl
 public bool AddData(NVBDT dt)
 {
     cmd.CommandText = "INSERT INTO NXB VALUES ( '" + dt.Manxb + "',N'" + dt.Tennxb + "', N'" + dt.Diachi + "', N'" + dt.Web + "' )";
     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);
 }
Пример #4
0
 public bool UpdateData(NVBDT dt)
 {
     return(MH.UpdateData(dt));
 }
Пример #5
0
 public bool AddData(NVBDT dt)
 {
     return(MH.AddData(dt));
 }