示例#1
0
 public bool eliminarObjeto(object _newObject)
 {
     try
     {
         Nombres _newObj = (Nombres)_newObject;
         string  str     = "";
         str = "UPDATE [MRFragancias].[dbo].[Nombres] SET Activo = 0 " +
               " WHERE idNombre = " + _newObj.idNombre;
         AccesoADatos.connectToDB.launchCommand(str);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#2
0
 public bool modificarObjeto(object _newObject)
 {
     try
     {
         Nombres _newObj = (Nombres)_newObject;
         string  str     = "";
         str = "UPDATE [MRFragancias].[dbo].[Nombres] SET " +
               "idCliente = '" + _newObj.idCliente + "'," +
               "Tipo = '" + _newObj.Tipo + "'," +
               "Nombre = '" + _newObj.Nom + "'," +
               "Observaciones = '" + _newObj.Observaciones + "'" +
               " WHERE idNombre = " + _newObj.idNombre;
         AccesoADatos.connectToDB.launchCommand(str);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#3
0
 public bool agregarObjeto(object _newObject)
 {
     try
     {
         Nombres _newObj = (Nombres)_newObject;
         string  str     = "";
         str = "INSERT INTO [MRFragancias].[dbo].[Nombres] VALUES (" +
               "'" + _newObj.idCliente + "'," +
               "'" + _newObj.Tipo + "'," +
               "'" + _newObj.Nom + "'," +
               "'" + _newObj.Observaciones + "'" +
               ",1)";
         AccesoADatos.connectToDB.launchCommand(str);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }