Esempio n. 1
0
        public static tsa_PedidosDetDataset.tsa_PedidosDetRow GetByPk(long IdPedido, string IdProducto, short Renglon)
        {
            tsa_PedidosDetDataset data = new tsa_PedidosDetDataset();

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

            cmd.CommandType = CommandType.StoredProcedure;

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

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

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

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

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

            adapter.Fill(data);

            if (data.tsa_PedidosDet.Rows.Count == 1)
            {
                return((tsa_PedidosDetDataset.tsa_PedidosDetRow)data.tsa_PedidosDet.Rows[0]);
            }

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

            mz.erp.dataaccess.tsa_PedidosDet.Update(dataSet);
        }
Esempio n. 3
0
        public static tsa_PedidosDetDataset GetList(long IdPedido, string IdProducto, short Renglon, decimal Cantidad, decimal Resuelto, bool AceptaVariante, DateTime FechaCreacion, long IdConexionCreacion, byte[] UltimaModificacion, long IdConexionUltimaModificacion, long IdReservado, Guid RowId, long IdSucursal, long IdEmpresa)
        {
            tsa_PedidosDetDataset data = new tsa_PedidosDetDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

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

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

            cmd.CommandType = CommandType.StoredProcedure;

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

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

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

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

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

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

            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);
        }
Esempio n. 4
0
        public static tsa_PedidosDetDataset GetList()
        {
            tsa_PedidosDetDataset data = new tsa_PedidosDetDataset();

            return(( tsa_PedidosDetDataset )GetList(data));
        }
Esempio n. 5
0
 public static void Update(tsa_PedidosDetDataset dataSet)
 {
     Update(dataSet.tsa_PedidosDet);
 }