コード例 #1
0
ファイル: tsh_Stock.cs プロジェクト: windygu/ger20160318
        public static tsh_StockDataset.tsh_StockRow GetByPk(string IdProducto, long IdSeccion)
        {
            tsh_StockDataset data = new tsh_StockDataset();

            SqlCommand cmd = new SqlCommand("Pr_tsh_Stock_GetByPk", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdProducto", SqlDbType.VarChar));
            cmd.Parameters["@IdProducto"].Value = IdProducto;

            cmd.Parameters.Add(new SqlParameter("@IdSeccion", SqlDbType.BigInt));
            cmd.Parameters["@IdSeccion"].Value = IdSeccion;

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

            adapter.TableMappings.Add("Table", "tsh_Stock");

            adapter.Fill(data);

            if (data.tsh_Stock.Rows.Count == 1)
            {
                return((tsh_StockDataset.tsh_StockRow)data.tsh_Stock.Rows[0]);
            }

            return(null);
        }
コード例 #2
0
        /// <summary>
        /// Envia los cambios del tsh_StockDataset a la base de datos.
        /// </summary>
        public static void Update(tsh_StockDataset dataSet)
        {
            ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber);
            ApplicationAssert.Check(dataSet.tsh_Stock.Rows.Count > 0, "La tabla dataSet.tsh_StockDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber);

            mz.erp.dataaccess.tsh_Stock.Update(dataSet);
        }
コード例 #3
0
ファイル: tsh_Stock.cs プロジェクト: windygu/ger20160318
        public static tsh_StockDataset GetList(string IdProducto, long IdSeccion, decimal Cantidad, DateTime FechaCreacion, long IdConexionCreacion, byte[] UltimaModificacion, long IdConexionUltimaModificacion, long IdReservado, Guid RowId, long IdSucursal, long IdEmpresa)
        {
            tsh_StockDataset data = new tsh_StockDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

            adapter.TableMappings.Add("Table", "tsh_Stock");

            SqlCommand cmd = new SqlCommand("Pr_tsh_Stock_Search", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdProducto", SqlDbType.VarChar));
            cmd.Parameters["@IdProducto"].Value = IdProducto;

            cmd.Parameters.Add(new SqlParameter("@IdSeccion", SqlDbType.BigInt));
            cmd.Parameters["@IdSeccion"].Value = IdSeccion;

            cmd.Parameters.Add(new SqlParameter("@Cantidad", SqlDbType.Decimal));
            cmd.Parameters["@Cantidad"].Value = Cantidad;

            cmd.Parameters.Add(new SqlParameter("@FechaCreacion", SqlDbType.DateTime));
            cmd.Parameters["@FechaCreacion"].Value = FechaCreacion;

            cmd.Parameters.Add(new SqlParameter("@IdConexionCreacion", SqlDbType.BigInt));
            cmd.Parameters["@IdConexionCreacion"].Value = IdConexionCreacion;

            cmd.Parameters.Add(new SqlParameter("@UltimaModificacion", SqlDbType.Timestamp));
            cmd.Parameters["@UltimaModificacion"].Value = UltimaModificacion;

            cmd.Parameters.Add(new SqlParameter("@IdConexionUltimaModificacion", SqlDbType.BigInt));
            cmd.Parameters["@IdConexionUltimaModificacion"].Value = IdConexionUltimaModificacion;

            cmd.Parameters.Add(new SqlParameter("@IdReservado", SqlDbType.BigInt));
            cmd.Parameters["@IdReservado"].Value = IdReservado;

            cmd.Parameters.Add(new SqlParameter("@RowId", SqlDbType.UniqueIdentifier));
            cmd.Parameters["@RowId"].Value = RowId;

            cmd.Parameters.Add(new SqlParameter("@IdSucursal", SqlDbType.BigInt));
            cmd.Parameters["@IdSucursal"].Value = IdSucursal;

            cmd.Parameters.Add(new SqlParameter("@IdEmpresa", SqlDbType.BigInt));
            cmd.Parameters["@IdEmpresa"].Value = IdEmpresa;


            adapter.SelectCommand = cmd;

            adapter.Fill(data);

            return(data);
        }
コード例 #4
0
ファイル: tsh_Stock.cs プロジェクト: windygu/ger20160318
        public static tsh_StockDataset GetList()
        {
            tsh_StockDataset data = new tsh_StockDataset();

            return(( tsh_StockDataset )GetList(data));
        }
コード例 #5
0
ファイル: tsh_Stock.cs プロジェクト: windygu/ger20160318
 public static void Update(tsh_StockDataset dataSet)
 {
     Update(dataSet.tsh_Stock);
 }