예제 #1
0
        public static tpu_LotesDataset.tpu_LotesRow GetByPk(long IdLote, string IdProducto)
        {
            tpu_LotesDataset data = new tpu_LotesDataset();

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

            cmd.CommandType = CommandType.StoredProcedure;

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

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

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

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

            adapter.Fill(data);

            if (data.tpu_Lotes.Rows.Count == 1)
            {
                return((tpu_LotesDataset.tpu_LotesRow)data.tpu_Lotes.Rows[0]);
            }

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

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

            SqlDataAdapter adapter = new SqlDataAdapter();

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

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

            cmd.CommandType = CommandType.StoredProcedure;

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

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

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

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

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

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

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

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