示例#1
0
        private void ubAgregarOP_Click(object sender, EventArgs e)
        {
            try
            {
                Collection        Ops            = new Collection();
                FrmSelectedEntity FrmSeleccionar = new FrmSelectedEntity();
                String            Filtro         = Facturacion.ObtenerFiltroOps();
                Filtro = (Filtro.Length > 0) ? String.Format(" ID NOT IN ({0}) AND IDCliente = '{1}' AND EstadoFacturacion <> 'TOTAL'", Filtro, Facturacion.Cliente.ID) : String.Format(" IDCliente = '{0}' AND EstadoFacturacion <> 'TOTAL'", Facturacion.Cliente.ID);
                Ops    = FrmSeleccionar.GetSelectedsEntities(typeof(OrdenProduccion), "Selección de Ordenes de Producción", Filtro);
                foreach (OrdenProduccion ItemOP in Ops)
                {
                    ItemFacturacion Item = Facturacion.AddItem();
                    Item.IDOrdenProduccion = ItemOP.ID;
                    Item.NroOP             = ItemOP.Numeracion;
                    Item.Descripcion       = ItemOP.Descripcion;
                    Item.CantidadOP        = (ItemOP.Cantidad - ItemOP.CantidadFacturada);
                    Item.Cantidad          = Item.CantidadOP;

                    ItemPresupuesto itemPresupuesto = (ItemPresupuesto)HelperNHibernate.GetEntityByID("ItemPresupuesto", ItemOP.IDItemPresupuesto);
                    Item.Precio = (itemPresupuesto.TotalFinal / ItemOP.Cantidad);
                }
                MostrarItems();
                MostrarTotales();
            }
            catch (Exception ex)
            {
                SoftException.Control(ex);
            }
        }
示例#2
0
        private void ugOrdenesProduccion_CellChange(object sender, CellEventArgs e)
        {
            try
            {
                ItemFacturacion Item = (ItemFacturacion)e.Cell.Row.Tag;
                switch (e.Cell.Column.Key)
                {
                case colCantidad:
                    decimal Cantidad = Convert.ToDecimal(e.Cell.Text.Replace('_', ' '));
                    if (Cantidad > Item.CantidadOP)
                    {
                        throw new Exception("La cantidad no puede ser mayor a : " + Item.CantidadOP);
                    }
                    else
                    {
                        Item.Cantidad = Cantidad;
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                SoftException.Control(ex);
            }
            finally {
                MostrarItem(e.Cell.Row);
                MostrarTotales();
            }
        }
示例#3
0
        public void MostrarItem(UltraGridRow Row)
        {
            ItemFacturacion Item = (ItemFacturacion)Row.Tag;

            Row.Cells[colNroOP].Value       = Item.NroOP;
            Row.Cells[colDescripcion].Value = Item.Descripcion;
            Row.Cells[colObservacion].Value = Item.Observacion;
            Row.Cells[colCantidad].Value    = Item.Cantidad;
            Row.Cells[colPrecio].Value      = Item.Precio;
            Row.Cells[colTotal].Value       = Item.Total;
        }