示例#1
0
 public static int Insert(ProductosInfo _ProductosInfo)
 {
     //Execute the query and return the new Guid
     object retval = _AdoHelper.ExecuteScalar(ConnectionString, "ProductosInsert",
         new SqlParameter("@Producto", _ProductosInfo.Producto),
         new SqlParameter("@Abreviatura", _ProductosInfo.Abreviatura),
         new SqlParameter("@Promociona", _ProductosInfo.Promociona),
         new SqlParameter("@External_Code", _ProductosInfo.External_Code),
         new SqlParameter("@Download", _ProductosInfo.Download),
         new SqlParameter("@Action", _ProductosInfo.Action),
         new SqlParameter("@SyncID", _ProductosInfo.SyncID)
     );
     return Int32.Parse(retval.ToString());
 }
示例#2
0
        /// <summary>
        /// Creates a new instance of the Productos class and populates it with data from the specified SqlDataReader.
        /// </summary>
        private static ProductosInfo MakeProductos(SqlDataReader dataReader)
        {
            ProductosInfo productos = new ProductosInfo();

            if (dataReader.IsDBNull(Cod_Producto) == false)
                productos.Cod_Producto = dataReader.GetInt32(Cod_Producto);
            if (dataReader.IsDBNull(Producto) == false)
                productos.Producto = dataReader.GetString(Producto);
            if (dataReader.IsDBNull(Abreviatura) == false)
                productos.Abreviatura = dataReader.GetString(Abreviatura);
            if (dataReader.IsDBNull(Promociona) == false)
                productos.Promociona = dataReader.GetBoolean(Promociona);
            if (dataReader.IsDBNull(External_Code) == false)
                productos.External_Code = dataReader.GetString(External_Code);
            if (dataReader.IsDBNull(Download) == false)
                productos.Download = dataReader.GetDateTime(Download);
            if (dataReader.IsDBNull(Action) == false)
                productos.Action = dataReader.GetString(Action);
            if (dataReader.IsDBNull(SyncID) == false)
                productos.SyncID = dataReader.GetGuid(SyncID);
            if (dataReader.IsDBNull(SyncTimeStamp) == false)
                productos.SyncTimeStamp = DateTime.MinValue;

            return productos;
        }
示例#3
0
 public static void Delete(ProductosInfo _ProductosInfo)
 {
     _AdoHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, "ProductosDelete",
         new SqlParameter("@Cod_Producto", _ProductosInfo.Cod_Producto)
     );
 }
示例#4
0
 public static void Update(ProductosInfo _ProductosInfo)
 {
     _AdoHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, "ProductosUpdate",
         new SqlParameter("@Cod_Producto", _ProductosInfo.Cod_Producto),
         new SqlParameter("@Producto", _ProductosInfo.Producto),
         new SqlParameter("@Abreviatura", _ProductosInfo.Abreviatura),
         new SqlParameter("@Promociona", _ProductosInfo.Promociona),
         new SqlParameter("@External_Code", _ProductosInfo.External_Code),
         new SqlParameter("@Download", _ProductosInfo.Download),
         new SqlParameter("@Action", _ProductosInfo.Action),
         new SqlParameter("@SyncID", _ProductosInfo.SyncID)
     );
 }