Beispiel #1
0
 public bool UpdData(NuocSXObj nsxObj)
 {
     cmd.CommandText = "UPDATE NUOCSX SET TENNSX=N'" + nsxObj.TenNsx + "'WHERE MANSX='" + nsxObj.MaNsx + "'";
     cmd.CommandType = CommandType.Text;
     cmd.Connection  = con.Connection;
     try
     {
         con.OpenConn();
         cmd.ExecuteNonQuery();
         con.CloseConn();
         return(true);
     }
     catch (Exception ex)
     {
         string mex = ex.Message;
         cmd.Dispose();
         con.CloseConn();
     }
     return(false);
 }
Beispiel #2
0
 public bool AddData(NuocSXObj nsxObj)
 {
     cmd.CommandText = "INSERT INTO NUOCSX VALUES ('" + nsxObj.MaNsx + "', N'" + nsxObj.TenNsx + "')";
     cmd.CommandType = CommandType.Text;
     cmd.Connection  = con.Connection;
     try
     {
         con.OpenConn();
         cmd.ExecuteNonQuery();
         con.CloseConn();
         return(true);
     }
     catch (Exception ex)
     {
         string mex = ex.Message;
         cmd.Dispose();
         con.CloseConn();
     }
     return(false);
 }
 public bool updData(NuocSXObj nsxObj)
 {
     return(nsxMod.UpdData(nsxObj));
 }
Beispiel #4
0
 private void addData(NuocSXObj nsx)
 {
     nsx.MaNsx  = txtmansx.Text.Trim();
     nsx.TenNsx = txttennsx.Text.Trim();
 }
 public bool addData(NuocSXObj nsxObj)
 {
     return(nsxMod.AddData(nsxObj));
 }