コード例 #1
0
ファイル: Pedido.cs プロジェクト: javiertmezac/ASP.NET
 /// <summary>
 /// Agrega registros de pedidos
 /// </summary>
 /// <returns>'true' si fue correcto, 'false' si fue incorrecto</returns>
 public bool UpSert()
 {
     try
     {
         SqlCommand cmd = DBaccess.CreateSQLCommand(K_PREFIJO + "_UPSERT");
         DBaccess.ParameterAdd(cmd, "@id", SqlDbType.Int, this.Id);
         DBaccess.ParameterAdd(cmd, "@noCliente", SqlDbType.VarChar, this.NoCliente);
         DBaccess.ParameterAdd(cmd, "@idChofer", SqlDbType.VarChar, this.IdChofer);
         DBaccess.ParameterAdd(cmd, "@fechaCreacion", SqlDbType.VarChar, this.FechaCreacion);
         DBaccess.ParameterAdd(cmd, "@fechaEntregar", SqlDbType.VarChar, this.FechaEntregar);
         DBaccess.ParameterAdd(cmd, "@notas", SqlDbType.VarChar, this.Notas);
         DBaccess.ParameterAdd(cmd, "@esAtendido", SqlDbType.VarChar, this.EsAtendido);
         DBaccess.ParameterAdd(cmd, "@status", SqlDbType.Bit, this.Status);
         if (this._id == 0)
         {
             this._id = Convert.ToInt32(DBaccess.EjecutarSQLScalar(cmd));
             return(this._id > 0);
         }
         else
         {
             bool s = DBaccess.EjecutarSQLNonQuery(cmd) > 0;
             return(s);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #2
0
ファイル: TipoProfesor.cs プロジェクト: javiertmezac/ASP.NET
    /// <summary>
    /// Elimina alumnos registrados
    /// </summary>
    /// <returns>'true' si fue correcto, 'false' si fue incorrecto</returns>
    public bool Delete()
    {
        SqlCommand cmd = DBaccess.CreateSQLCommand(K_PREFIJO + "_DELETE");

        DBaccess.ParameterAdd(cmd, "@id", SqlDbType.Int, this.Id);
        return(DBaccess.EjecutarSQLNonQuery(cmd) > 0);
    }
コード例 #3
0
ファイル: Empresa.cs プロジェクト: javiertmezac/ASP.NET
    /// <summary>
    /// Agrega registros de empresas
    /// </summary>
    /// <returns>'true' si fue correcto, 'false' si fue incorrecto</returns>
    public bool UpSert()
    {
        SqlCommand cmd = DBaccess.CreateSQLCommand(K_PREFIJO + "_UPSERT");

        DBaccess.ParameterAdd(cmd, "@id", SqlDbType.Int, this.Id);
        DBaccess.ParameterAdd(cmd, "@noCliente", SqlDbType.VarChar, this.NoCliente);
        DBaccess.ParameterAdd(cmd, "@nombre", SqlDbType.VarChar, this.Nombre);
        DBaccess.ParameterAdd(cmd, "@rfc", SqlDbType.VarChar, this.RFC);
        DBaccess.ParameterAdd(cmd, "@tel", SqlDbType.VarChar, this.Telefono);
        DBaccess.ParameterAdd(cmd, "@colonia", SqlDbType.VarChar, this.Colonia);
        DBaccess.ParameterAdd(cmd, "@calle", SqlDbType.VarChar, this.Calle);
        DBaccess.ParameterAdd(cmd, "@noInt", SqlDbType.Int, this.NoInterior);
        DBaccess.ParameterAdd(cmd, "@noExt", SqlDbType.Int, this.NoExterior);
        DBaccess.ParameterAdd(cmd, "@cPostal", SqlDbType.VarChar, this.CodPostal);
        DBaccess.ParameterAdd(cmd, "@fechaRegistro", SqlDbType.DateTime, this.FechaRegistro);
        DBaccess.ParameterAdd(cmd, "@status", SqlDbType.Bit, this.Status);
        DBaccess.ParameterAdd(cmd, "@idPrecio", SqlDbType.TinyInt, this.Precio);
        if (this._id == 0)
        {
            this._id = Convert.ToInt32(DBaccess.EjecutarSQLScalar(cmd));
            return(this._id > 0);
        }
        else
        {
            bool s = DBaccess.EjecutarSQLNonQuery(cmd) > 0;
            return(s);
        }
    }
コード例 #4
0
    /// <summary>
    /// Agrega registros de alumnos
    /// </summary>
    /// <returns>'true' si fue correcto, 'false' si fue incorrecto</returns>
    public bool UpSert()
    {
        SqlCommand cmd = DBaccess.CreateSQLCommand(K_PREFIJO + "_UPSERT");

        DBaccess.ParameterAdd(cmd, "@id", SqlDbType.Int, this.Id);
        DBaccess.ParameterAdd(cmd, "@precio", SqlDbType.Decimal, this.Precio);
        if (this._id == 0)
        {
            this._id = Convert.ToInt32(DBaccess.EjecutarSQLScalar(cmd));
            return(this._id > 0);
        }
        else
        {
            bool s = DBaccess.EjecutarSQLNonQuery(cmd) > 0;
            return(s);
        }
    }
コード例 #5
0
    /// <summary>
    /// Agrega registros de alumnos
    /// </summary>
    /// <returns>'true' si fue correcto, 'false' si fue incorrecto</returns>
    public bool UpSert()
    {
        SqlCommand cmd = DBaccess.CreateSQLCommand(K_PREFIJO + "_UPSERT");

        DBaccess.ParameterAdd(cmd, "@id", SqlDbType.Int, this.Id);
        DBaccess.ParameterAdd(cmd, "@descripcion", SqlDbType.VarChar, this.Descripcion);
        DBaccess.ParameterAdd(cmd, "@valor", SqlDbType.VarChar, this.Valor);
        if (this._id == 0)
        {
            this._id = Convert.ToInt32(DBaccess.EjecutarSQLScalar(cmd));
            return(this._id > 0);
        }
        else
        {
            bool s = DBaccess.EjecutarSQLNonQuery(cmd) > 0;
            return(s);
        }
    }
コード例 #6
0
    /// <summary>
    /// Agrega registros de alumnos
    /// </summary>
    /// <returns>'true' si fue correcto, 'false' si fue incorrecto</returns>
    public bool UpSert()
    {
        SqlCommand cmd = DBaccess.CreateSQLCommand(K_PREFIJO + "_UPSERT");

        DBaccess.ParameterAdd(cmd, "@id", SqlDbType.Int, this.Id);
        DBaccess.ParameterAdd(cmd, "@nombre", SqlDbType.VarChar, this.Nombre);
        DBaccess.ParameterAdd(cmd, "@fechaInicio", SqlDbType.DateTime, this.FechaInicio);
        DBaccess.ParameterAdd(cmd, "@fechaFin", SqlDbType.DateTime, this.FechaFin);
        if (this._id == 0)
        {
            this._id = Convert.ToInt32(DBaccess.EjecutarSQLScalar(cmd));
            return(this._id > 0);
        }
        else
        {
            bool s = DBaccess.EjecutarSQLNonQuery(cmd) > 0;
            return(s);
        }
    }
コード例 #7
0
ファイル: Grados.cs プロジェクト: javiertmezac/ASP.NET
    /// <summary>
    /// Agrega registros de alumnos
    /// </summary>
    /// <returns>'true' si fue correcto, 'false' si fue incorrecto</returns>
    public bool UpSert()
    {
        SqlCommand cmd = DBaccess.CreateSQLCommand(K_PREFIJO + "_UPSERT");

        DBaccess.ParameterAdd(cmd, "@id", SqlDbType.Int, this.Id);
        DBaccess.ParameterAdd(cmd, "@profesor", SqlDbType.VarChar, this.Profesor);
        DBaccess.ParameterAdd(cmd, "@grado", SqlDbType.VarChar, this.Grado);
        DBaccess.ParameterAdd(cmd, "@tipoGrado", SqlDbType.VarChar, this.TipoGrado);
        DBaccess.ParameterAdd(cmd, "@cedula", SqlDbType.VarChar, this.Cedula);
        DBaccess.ParameterAdd(cmd, "@institucion", SqlDbType.VarChar, this.Institucion);
        DBaccess.ParameterAdd(cmd, "@fecha", SqlDbType.DateTime, this.Fecha);
        if (this._id == 0)
        {
            this._id = Convert.ToInt32(DBaccess.EjecutarSQLScalar(cmd));
            return(this._id > 0);
        }
        else
        {
            bool s = DBaccess.EjecutarSQLNonQuery(cmd) > 0;
            return(s);
        }
    }
コード例 #8
0
    /// <summary>
    /// Agrega registros de alumnos
    /// </summary>
    /// <returns>'true' si fue correcto, 'false' si fue incorrecto</returns>
    public bool UpSert()
    {
        SqlCommand cmd = DBaccess.CreateSQLCommand(K_PREFIJO + "_UPSERT");

        DBaccess.ParameterAdd(cmd, "@id", SqlDbType.Int, this.Id);
        DBaccess.ParameterAdd(cmd, "@nombre", SqlDbType.VarChar, this.Nombre);
        DBaccess.ParameterAdd(cmd, "@apellidoP", SqlDbType.VarChar, this.ApPaterno);
        DBaccess.ParameterAdd(cmd, "@apellidoM", SqlDbType.VarChar, this.ApMaterno);
        DBaccess.ParameterAdd(cmd, "@celular", SqlDbType.VarChar, this.Celular);
        DBaccess.ParameterAdd(cmd, "@radio", SqlDbType.VarChar, this.Radio);
        DBaccess.ParameterAdd(cmd, "@email", SqlDbType.VarChar, this.Email);
        DBaccess.ParameterAdd(cmd, "@status", SqlDbType.Bit, this.Status);
        if (this._id == 0)
        {
            this._id = Convert.ToInt32(DBaccess.EjecutarSQLScalar(cmd));
            return(this._id > 0);
        }
        else
        {
            bool s = DBaccess.EjecutarSQLNonQuery(cmd) > 0;
            return(s);
        }
    }
コード例 #9
0
    /// <summary>
    /// Agrega registros de alumnos
    /// </summary>
    /// <returns>'true' si fue correcto, 'false' si fue incorrecto</returns>
    public bool UpSert()
    {
        int        n   = 0;
        SqlCommand cmd = DBaccess.CreateSQLCommand(K_PREFIJO + "_UPSERT");

        DBaccess.ParameterAdd(cmd, "@id", SqlDbType.Int, this.Id);
        DBaccess.ParameterAdd(cmd, "@idContacto", SqlDbType.Int, this.IdContacto);
        DBaccess.ParameterAdd(cmd, "@idEmpresa", SqlDbType.Int, this.IdEmpresa);
        DBaccess.ParameterAdd(cmd, "@fechaRegistro", SqlDbType.DateTime, this.FechaInicio);
        DBaccess.ParameterAdd(cmd, "@status", SqlDbType.Bit, this.Status);
        if (this._id == 0)
        {
            this._id = Convert.ToInt32(DBaccess.EjecutarSQLScalar(cmd));
            return(this._id > 0);
        }
        else
        {
            n = DBaccess.EjecutarSQLNonQuery(cmd);

            //return s;
        }
        return(n > 0);
    }