Exemple #1
0
        private void ugItems_ClickCellButton(object sender, CellEventArgs e)
        {
            ItemSalidaCaja Item = (ItemSalidaCaja)e.Cell.Row.Tag;

            if (e.Cell.Column.Header.Caption == "OT")
            {
                FrmSelectedEntity FrmSeleccionar  = new FrmSelectedEntity();
                dynamic           OrdenProduccion = FrmSeleccionar.GetSelectedEntity("Soft.Produccion.Entidades", "OrdenProduccion", "Orden de Producción");
                Item.IDOrdenProduccion         = OrdenProduccion.ID;
                Item.NumeracionOrdenProduccion = OrdenProduccion.Numeracion;
                MostrarItem(e.Cell.Row);
            }
            if (e.Cell.Column.Header.Caption == "OP")
            {
                FrmSelectedEntity FrmSeleccionar = new FrmSelectedEntity();
                dynamic           CosolidadoOP   = FrmSeleccionar.GetSelectedEntity("Soft.Produccion.Entidades", "ConsolidadoOp", "Consolidado de Ordenes de Producción");
                Item.IDConsolidadoOrdenProduccion         = CosolidadoOP.ID;
                Item.NumeracionConsolidadoOrdenProduccion = CosolidadoOP.Numeracion;
                MostrarItem(e.Cell.Row);
            }
            if (Item.EsTipoTransporte && e.Cell.Column.Key == colDescripcion)
            {
                FrmSeleccionarDireccion FrmSeleccionar = new FrmSeleccionarDireccion();
                FrmSeleccionar.ObtenerItemSalidaCaja(ref Item);
                CalcularPrecio(Item);
                MostrarItem(e.Cell.Row);
                MostrarTotales();
            }
        }
Exemple #2
0
 private void ubNuevoItemTransporte_Click(object sender, EventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(SalidaCaja.IDListaPreciosTransporte))
         {
             throw new Exception("Debe de seleccionar una lista de precios de transporte...");
         }
         else
         {
             FrmSeleccionarDireccion FrmSeleccionar = new FrmSeleccionarDireccion();
             ItemSalidaCaja          itemSalidaCaja = SalidaCaja.AddItem();
             itemSalidaCaja.Cantidad         = 1;
             itemSalidaCaja.EsTipoTransporte = true;
             FrmSeleccionar.ObtenerItemSalidaCaja(ref itemSalidaCaja);
             CalcularPrecio(itemSalidaCaja);
             UltraGridRow RowNuevo = ugItems.DisplayLayout.Bands[0].AddNew();
             RowNuevo.Tag = itemSalidaCaja;
             Mostrar();
         }
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }
 public void Mostrar(ItemSalidaCaja itemSalidaCaja)
 {
     busDepartamento.Text        = (itemSalidaCaja.DepartamentoOrigen == null) ? string.Empty : itemSalidaCaja.DepartamentoOrigen.Nombre;
     busProvincia.Text           = (itemSalidaCaja.ProvinciaOrigen == null) ? string.Empty : itemSalidaCaja.ProvinciaOrigen.Nombre;
     busDistrito.Text            = (itemSalidaCaja.DistritoOrigen == null) ? string.Empty : itemSalidaCaja.DistritoOrigen.Nombre;
     busDepartamentoDestino.Text = (itemSalidaCaja.DepartamentoDestino == null) ? string.Empty : itemSalidaCaja.DepartamentoDestino.Nombre;
     busProvinciaDestino.Text    = (itemSalidaCaja.ProvinciaDestino == null) ? string.Empty : itemSalidaCaja.ProvinciaDestino.Nombre;
     busDistritoDestino.Text     = (itemSalidaCaja.DistritoDestino == null) ? string.Empty : itemSalidaCaja.DistritoDestino.Nombre;
     txtDireccion.Text           = itemSalidaCaja.Direccion;
     uceTipoVehiculo.Text        = itemSalidaCaja.TipoVehiculo;
 }
Exemple #4
0
 private void ubNuevoItem_Click(object sender, EventArgs e)
 {
     try
     {
         UltraGridRow   RowNuevo = ugItems.DisplayLayout.Bands[0].AddNew();
         ItemSalidaCaja item     = SalidaCaja.AddItem();
         item.Cantidad = 1;
         RowNuevo.Tag  = item;
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }
Exemple #5
0
        private void CalcularPrecio(ItemSalidaCaja itemSalidaCaja)
        {
            if (itemSalidaCaja.DistritoOrigen != null && itemSalidaCaja.DistritoDestino != null)
            {
                String Filtro = String.Format(@" IDListaPrecios ='{0}' AND IDDistritoOrigen = '{1}' AND IDDistritoDestino = '{2}' AND TipoVehiculo = '{3}'",
                                              SalidaCaja.IDListaPreciosTransporte, itemSalidaCaja.DistritoOrigen.ID, itemSalidaCaja.DistritoDestino.ID, itemSalidaCaja.TipoVehiculo);

                XmlDocument XML = HelperNHibernate.ExecuteView("vSF_Escalas_LP_Transporte", Filtro);
                if (XML.HasChildNodes)
                {
                    if (XML.DocumentElement.ChildNodes.Count > 0)
                    {
                        XmlNode NodoItem = XML.DocumentElement.ChildNodes[0];
                        itemSalidaCaja.Precio = Convert.ToDecimal(NodoItem.SelectSingleNode("@Precio").Value);
                    }
                }
            }
        }
Exemple #6
0
        public void MostrarItem(UltraGridRow Row)
        {
            ItemSalidaCaja Item = (ItemSalidaCaja)Row.Tag;

            Row.Cells[colCodigo].Value = Item.Codigo;
            if (SalidaCaja.RelacionItem == "OT")
            {
                Row.Cells[colOT_OP].Value = Item.NumeracionOrdenProduccion;
            }
            if (SalidaCaja.RelacionItem == "OP")
            {
                Row.Cells[colOT_OP].Value = Item.NumeracionConsolidadoOrdenProduccion;
            }
            Row.Cells[colDescripcion].Value = Item.Descripcion;
            Row.Cells[colPrecio].Value      = Item.Precio;
            Row.Cells[colCantidad].Value    = Item.Cantidad;
            Row.Cells[colTotal].Value       = Item.Total;
            Row.Cells[colObservacion].Value = Item.Observacion;
        }
Exemple #7
0
        private void ugItems_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
        {
            try
            {
                ItemSalidaCaja Item = (ItemSalidaCaja)e.Cell.Row.Tag;
                switch (e.Cell.Column.Key)
                {
                case colCodigo:
                    Item.Codigo = e.Cell.Text;
                    break;

                case colDescripcion:
                    Item.Descripcion = e.Cell.Text;
                    break;

                case colPrecio:
                    Item.Precio = Convert.ToDecimal(e.Cell.Text.Replace('_', ' '));
                    break;

                case colCantidad:
                    Item.Cantidad = Convert.ToDecimal(e.Cell.Text.Replace('_', ' '));
                    break;

                case colObservacion:
                    Item.Observacion = e.Cell.Text;
                    break;

                default:
                    break;
                }
                MostrarItem(e.Cell.Row);
                MostrarTotales();
            }
            catch (Exception ex)
            {
                SoftException.Control(ex);
            }
        }
        public ItemSalidaCaja ObtenerItemSalidaCaja(ref ItemSalidaCaja item)
        {
            this.itemSalidaCaja = item;
            Mostrar(this.itemSalidaCaja);
            ShowDialog();
            string circunscripcion = "SERVICIO DE TRANSPORTE >> DE ";

            if (this.itemSalidaCaja.DepartamentoOrigen != null)
            {
                circunscripcion += this.itemSalidaCaja.DepartamentoOrigen.Nombre + "/";
            }
            if (this.itemSalidaCaja.ProvinciaOrigen != null)
            {
                circunscripcion += this.itemSalidaCaja.ProvinciaOrigen.Nombre + "/";
            }
            if (this.itemSalidaCaja.DistritoOrigen != null)
            {
                circunscripcion += this.itemSalidaCaja.DistritoOrigen.Nombre + " A ";
            }
            if (this.itemSalidaCaja.DepartamentoDestino != null)
            {
                circunscripcion += this.itemSalidaCaja.DepartamentoDestino.Nombre + "/";
            }
            if (this.itemSalidaCaja.ProvinciaDestino != null)
            {
                circunscripcion += this.itemSalidaCaja.ProvinciaDestino.Nombre + "/";
            }
            if (this.itemSalidaCaja.DistritoDestino != null)
            {
                circunscripcion += this.itemSalidaCaja.DistritoDestino.Nombre + " - ";
            }
            circunscripcion += this.itemSalidaCaja.Direccion;
            circunscripcion += " TIPO VEHÍCULO : " + this.itemSalidaCaja.TipoVehiculo;
            this.itemSalidaCaja.Descripcion = circunscripcion;
            return(this.itemSalidaCaja);
        }