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); } }
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); } }
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); } }