예제 #1
0
        public static tsh_StockMinimoDataset.tsh_StockMinimoRow GetByPk(string IdProducto, long IdDeposito)
        {
            tsh_StockMinimoDataset data = new tsh_StockMinimoDataset();

            SqlCommand cmd = new SqlCommand("Pr_tsh_StockMinimo_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("@IdDeposito", SqlDbType.BigInt));
            cmd.Parameters["@IdDeposito"].Value = IdDeposito;

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

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

            adapter.Fill(data);

            if (data.tsh_StockMinimo.Rows.Count == 1)
            {
                return((tsh_StockMinimoDataset.tsh_StockMinimoRow)data.tsh_StockMinimo.Rows[0]);
            }

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

            mz.erp.dataaccess.tsh_StockMinimo.Update(dataSet);
        }
예제 #3
0
        public static tsh_StockMinimoDataset GetList(string IdProducto, long IdDeposito, decimal Cantidad, DateTime FechaCreacion, long IdConexionCreacion, byte[] UltimaModificacion, long IdConexionUltimaModificacion, long IdReservado, Guid RowId, long IdSucursal, long IdEmpresa)
        {
            tsh_StockMinimoDataset data = new tsh_StockMinimoDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

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

            SqlCommand cmd = new SqlCommand("Pr_tsh_StockMinimo_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("@IdDeposito", SqlDbType.BigInt));
            cmd.Parameters["@IdDeposito"].Value = IdDeposito;

            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
        public static tsh_StockMinimoDataset GetList()
        {
            tsh_StockMinimoDataset data = new tsh_StockMinimoDataset();

            return(( tsh_StockMinimoDataset )GetList(data));
        }
예제 #5
0
 public static void Update(tsh_StockMinimoDataset dataSet)
 {
     Update(dataSet.tsh_StockMinimo);
 }