Ejemplo n.º 1
0
        /// <summary>
        /// Envia los cambios del tpu_ComprobantesRelacionOrigenDestinoDataset a la base de datos.
        /// </summary>
        public static void Update(tpu_ComprobantesRelacionOrigenDestinoDataset dataSet)
        {
            ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber);
            ApplicationAssert.Check(dataSet.tpu_ComprobantesRelacionOrigenDestino.Rows.Count > 0, "La tabla dataSet.tpu_ComprobantesRelacionOrigenDestinoDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber);

            mz.erp.dataaccess.tpu_ComprobantesRelacionOrigenDestino.Update(dataSet);
        }
Ejemplo n.º 2
0
        public static tpu_ComprobantesRelacionOrigenDestinoDataset.tpu_ComprobantesRelacionOrigenDestinoRow GetByPk(string IdComprobanteOrigen, string IdComprobanteDestino)
        {
            tpu_ComprobantesRelacionOrigenDestinoDataset data = new tpu_ComprobantesRelacionOrigenDestinoDataset();

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

            cmd.CommandType = CommandType.StoredProcedure;

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

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

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

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

            adapter.Fill(data);

            if (data.tpu_ComprobantesRelacionOrigenDestino.Rows.Count == 1)
            {
                return((tpu_ComprobantesRelacionOrigenDestinoDataset.tpu_ComprobantesRelacionOrigenDestinoRow)data.tpu_ComprobantesRelacionOrigenDestino.Rows[0]);
            }

            return(null);
        }
Ejemplo n.º 3
0
        public static tpu_ComprobantesRelacionOrigenDestinoDataset.tpu_ComprobantesRelacionOrigenDestinoRow GetRelacionOrigenDestinoPreOrdenDeCompra(string IdComprobanteDestino, long IdOrdinalDestino)
        {
            tpu_ComprobantesRelacionOrigenDestinoDataset.tpu_ComprobantesRelacionOrigenDestinoRow row = null;
            tpu_ComprobantesRelacionOrigenDestinoDataset data = dataaccess.tpu_ComprobantesEx.GetRelacionOrigenDestinoPreOrdenDeCompra(IdComprobanteDestino, IdOrdinalDestino);

            if (data.tpu_ComprobantesRelacionOrigenDestino.Rows.Count > 0)
            {
                row = (tpu_ComprobantesRelacionOrigenDestinoDataset.tpu_ComprobantesRelacionOrigenDestinoRow)data.tpu_ComprobantesRelacionOrigenDestino.Rows[0];
            }
            return(row);
        }
Ejemplo n.º 4
0
/*
 *              public static tpu_ComprobantesExDataset SetMovimientosDeStock( tpu_ComprobantesExDataset data, long IdSucursal, long IdEmpresa, string IdDeposito, string IdSeccion, string IdMomentoDeStock, string IdEstadoDeStockOrigen, string IdEstadoDeStockDestino, string IdTipoDeAjuste, string IdProducto, decimal Cantidad)
 *              {
 *                      //tlg_MovimientosDeStockDataset.tlg_MovimientosDeStockRow	rowDefinicionMovimiento = mz.erp.businessrules.Stock.GetMovimiento(IdSucursal, IdEmpresa, IdDeposito, IdSeccion, IdEstadoDeStock, IdTipoDeAjuste, IdProducto, Cantidad);
 *                      tpu_ComprobantesExDataset.tlg_MovimientosDeStockRow rowNuevoMovimiento = data.tlg_MovimientosDeStock.Newtlg_MovimientosDeStockRow();
 *
 *                      rowNuevoMovimiento.IdProducto = IdProducto;
 *                      rowNuevoMovimiento.Cantidad = Cantidad;
 *                      rowNuevoMovimiento.IdDeposito = IdDeposito;
 *                      rowNuevoMovimiento.IdSeccion = IdSeccion;
 *
 *                      rowNuevoMovimiento.IdMovimientoDeStock = Util.NewStringId();
 *
 *                      rowNuevoMovimiento.IdEstadoDeStockOrigen = IdEstadoDeStockOrigen;
 *                      rowNuevoMovimiento.IdEstadoDeStockDestino = IdEstadoDeStockDestino;
 *
 *                      rowNuevoMovimiento.IdEmpresa = Security.IdEmpresa;
 *                      rowNuevoMovimiento.IdSucursal = Security.IdSucursal;
 *
 *                      rowNuevoMovimiento.FechaCreacion = mz.erp.businessrules.Sistema.DateTime.Now;
 *                      rowNuevoMovimiento.IdConexionCreacion = Security.IdConexion;
 *                      rowNuevoMovimiento.IdConexionUltimaModificacion = Security.IdConexion;
 *                      rowNuevoMovimiento.IdReservado = 0;
 *
 *
 *                      //rowNuevoMovimiento.IdTipoDeAjuste = rowDefinicionMovimiento.IdTipoDeAjuste;
 *
 *                      data.tlg_MovimientosDeStock.Addtlg_MovimientosDeStockRow( rowNuevoMovimiento );
 *                      return data;
 *              }
 */

        /*public static void SetMovimientosDeStock( tlg_MovimientosDeStockDataset data, long IdSucursal, long IdEmpresa, string IdDeposito, string IdSeccion, string IdMomentoDeStock, string IdEstadoDeStockOrigen, string IdEstadoDeStockDestino, string IdTipoDeAjuste, string IdProducto, decimal Cantidad)
         * {
         *
         *      tlg_MovimientosDeStockDataset.tlg_MovimientosDeStockRow rowNuevoMovimiento = data.tlg_MovimientosDeStock.Newtlg_MovimientosDeStockRow();
         *
         *      rowNuevoMovimiento.IdProducto = IdProducto;
         *      rowNuevoMovimiento.Cantidad = Cantidad;
         *      rowNuevoMovimiento.IdDeposito = IdDeposito;
         *      rowNuevoMovimiento.IdSeccion = IdSeccion;
         *
         *      rowNuevoMovimiento.IdMovimientoDeStock = Util.NewStringId();
         *
         *      rowNuevoMovimiento.IdEstadoDeStockOrigen = IdEstadoDeStockOrigen;
         *      rowNuevoMovimiento.IdEstadoDeStockDestino = IdEstadoDeStockDestino;
         *
         *      rowNuevoMovimiento.IdEmpresa = Security.IdEmpresa;
         *      rowNuevoMovimiento.IdSucursal = Security.IdSucursal;
         *
         *      rowNuevoMovimiento.FechaCreacion = mz.erp.businessrules.Sistema.DateTime.Now;
         *      rowNuevoMovimiento.IdConexionCreacion = Security.IdConexion;
         *      rowNuevoMovimiento.IdConexionUltimaModificacion = Security.IdConexion;
         *      rowNuevoMovimiento.IdReservado = 0;
         *
         *
         *
         *      data.tlg_MovimientosDeStock.Addtlg_MovimientosDeStockRow( rowNuevoMovimiento );
         *
         * }
         */



        public static void SetRelacionOrigenDestino(tpu_ComprobantesRelacionOrigenDestinoDataset data, long IdRelacionOrigenDestino, string IdComprobanteOrigen, string IdComprobanteDestino, long IdOrdinalOrigen, long IdOrdinalDestino, decimal Cantidad, bool CierraCircuito)
        {
            tpu_ComprobantesRelacionOrigenDestinoDataset.tpu_ComprobantesRelacionOrigenDestinoRow rowEx = data.tpu_ComprobantesRelacionOrigenDestino.Newtpu_ComprobantesRelacionOrigenDestinoRow();
            rowEx.IdRelacionOrigenDestino = IdRelacionOrigenDestino;

            if (IdComprobanteOrigen != null)
            {
                rowEx.IdComprobanteOrigen = IdComprobanteOrigen;
            }
            else
            {
                rowEx.IdComprobanteOrigen = null;
            }
            if (IdComprobanteDestino != null)
            {
                rowEx.IdComprobanteDestino = IdComprobanteDestino;
            }
            else
            {
                rowEx.IdComprobanteDestino = null;
            }
            rowEx.IdOrdinalOrigen  = IdOrdinalOrigen;
            rowEx.IdOrdinalDestino = IdOrdinalDestino;
            rowEx.Cantidad         = Cantidad;

            rowEx.IdConexionCreacion           = Security.IdConexion;
            rowEx.IdConexionUltimaModificacion = Security.IdConexion;
            rowEx.IdReservado = 0;
            rowEx.IdEmpresa   = Security.IdEmpresa;
            rowEx.IdSucursal  = Security.IdSucursal;

            data.tpu_ComprobantesRelacionOrigenDestino.Addtpu_ComprobantesRelacionOrigenDestinoRow(rowEx);

            if (CierraCircuito)
            {
                rowEx = data.tpu_ComprobantesRelacionOrigenDestino.Newtpu_ComprobantesRelacionOrigenDestinoRow();
                rowEx.IdRelacionOrigenDestino = Convert.ToInt64(mz.erp.systemframework.Util.NewStringId());
                rowEx.IdComprobanteOrigen     = IdComprobanteDestino;
                rowEx.IdComprobanteDestino    = IdComprobanteDestino;
                rowEx.IdOrdinalOrigen         = IdOrdinalDestino;
                rowEx.IdOrdinalDestino        = IdOrdinalDestino;

                rowEx.Cantidad = Cantidad;

                rowEx.IdConexionCreacion           = Security.IdConexion;
                rowEx.IdConexionUltimaModificacion = Security.IdConexion;
                rowEx.IdReservado = 0;
                rowEx.IdEmpresa   = Security.IdEmpresa;
                rowEx.IdSucursal  = Security.IdSucursal;

                data.tpu_ComprobantesRelacionOrigenDestino.Addtpu_ComprobantesRelacionOrigenDestinoRow(rowEx);
            }
        }
Ejemplo n.º 5
0
        public static tpu_ComprobantesRelacionOrigenDestinoDataset GetList(string IdComprobanteOrigen, string IdComprobanteDestino)
        {
            tpu_ComprobantesRelacionOrigenDestinoDataset data = new tpu_ComprobantesRelacionOrigenDestinoDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

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

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

            cmd.CommandType = CommandType.StoredProcedure;

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

            adapter.SelectCommand = cmd;

            adapter.Fill(data);

            return(data);
        }
Ejemplo n.º 6
0
        public static tpu_ComprobantesRelacionOrigenDestinoDataset GetList()
        {
            tpu_ComprobantesRelacionOrigenDestinoDataset data = new tpu_ComprobantesRelacionOrigenDestinoDataset();

            return(( tpu_ComprobantesRelacionOrigenDestinoDataset )GetList(data));
        }
Ejemplo n.º 7
0
 public static void Update(tpu_ComprobantesRelacionOrigenDestinoDataset dataSet)
 {
     Update(dataSet.tpu_ComprobantesRelacionOrigenDestino);
 }