protected override void DeleteLineaAction()
        {
            if (Lineas_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }
            LineaPedido item = (LineaPedido)Lineas_DGW.CurrentRow.DataBoundItem;

            if (item == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                PgMng.Reset(4, 1, Store.Resources.Messages.UPDATING_STOCK, this);

                BatchInfo partida = BatchInfo.Get(item.OidPartida, true);
                PgMng.Grow();

                if (partida.IsKit)
                {
                    DeleteKit(partida);
                }
                PgMng.Grow();

                _entity.Lineas.Remove(item, _entity);

                ControlsMng.UpdateBinding(Datos_Lineas);
                ControlsMng.UpdateBinding(Datos);
                PgMng.FillUp();
            }
        }
예제 #2
0
        protected override void AddPeriodoTipoInteresAction()
        {
            _entity.InterestRates.NewItem(_entity);
            ControlsMng.UpdateBinding(InterestRates_BS);

            UpdateImportes();
        }
예제 #3
0
        protected virtual void LoadStockAction()
        {
            try
            {
                if (Partidas_DGW.CurrentRow == null)
                {
                    return;
                }
                if (Partidas_DGW.CurrentRow.DataBoundItem == null)
                {
                    return;
                }

                BatchInfo batch = Partidas_DGW.CurrentRow.DataBoundItem as BatchInfo;

                //if (Cache.Instance.Get(typeof(StockList)) != null) return;

                PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);
                PgMng.Grow();

                StockList list = StockList.GetByBatchList(batch.Oid, false, true);
                list.UpdateStocksByBatch(false);
                Stock_BS.DataSource = list;
                //Cache.Instance.Save(typeof(StockList), Stock_BS.DataSource as StockList);
                PgMng.Grow();

                HideComponentes(Stock_TP);

                ControlsMng.UpdateBinding(Stock_BS);
            }
            finally
            {
                PgMng.FillUp();
            }
        }
        protected override void AddLineaAction()
        {
            if (_entity.OidSerie == 0)
            {
                PgMng.ShowInfoException(Resources.Messages.NO_SERIE_SELECTED);
                return;
            }

            if (_entity.OidCliente == 0)
            {
                PgMng.ShowInfoException(Resources.Messages.NO_CLIENT_SELECTED);
                return;
            }

            _cliente = Datos_Cliente.Current as ClienteInfo;

            LineaPedidoAddForm form = new LineaPedidoAddForm(ETipoProducto.Almacen, _entity, _serie, _cliente, this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _entity.CalculateTotal();

                if (_entity.Lineas.Count > 0)
                {
                    Serie_BT.Enabled = false;
                }

                ControlsMng.UpdateBinding(Datos_Lineas);

                HideComponentes();

                AddCacheItem(form.Entity);
            }
        }
        protected override void DeleteLineAction()
        {
            if (Lines_BS.Current == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                if (Concepto.OidPedido == 0)
                {
                    PgMng.Reset(4, 1, Store.Resources.Messages.UPDATING_STOCK, this);

                    if (Concepto.OidPartida != 0)
                    {
                        BatchInfo partida = BatchInfo.Get(Concepto.OidPartida, true);
                        PgMng.Grow();

                        if (partida.IsKit)
                        {
                            DeleteKit(partida);
                        }
                        PgMng.Grow();
                    }

                    _entity.Conceptos.Remove(Concepto, true);
                    _entity.CalculateTotal();
                    PgMng.Grow();
                }
                else
                {
                    long oidPedido = Concepto.OidPedido;

                    _entity.Conceptos.Remove(Concepto, true);
                    _entity.CalculateTotal();

                    bool free_pedido = true;

                    foreach (OutputDeliveryLine item in _entity.Conceptos)
                    {
                        if (item.OidPedido == Concepto.OidPedido)
                        {
                            free_pedido = false;
                        }
                    }

                    //Actualizamos la lista de pedidos disponibles
                    if (free_pedido)
                    {
                        _pedidos.AddItem(_pedidos_cliente.GetItem(oidPedido));
                    }
                }

                ControlsMng.UpdateBinding(Lines_BS);
                ControlsMng.UpdateBinding(Datos);
                PgMng.FillUp();
            }

            Serie_BT.Enabled = (_entity.Conceptos.Count > 0);
        }
        protected override void NuevoConceptoAction()
        {
            if (_entity.OidSerie == 0)
            {
                PgMng.ShowInfoException(Resources.Messages.NO_SERIE_SELECTED);
                return;
            }

            if (_entity.OidCliente == 0)
            {
                PgMng.ShowInfoException(Resources.Messages.NO_CLIENT_SELECTED);
                return;
            }

            _cliente = Datos_Cliente.Current as ClienteInfo;
            BudgetLineAddForm form = new BudgetLineAddForm(ETipoProducto.Almacen, _entity, _serie, _cliente, this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _entity.CalculaTotal();

                if (_entity.Conceptos.Count > 0)
                {
                    Serie_BT.Enabled = false;
                }

                RefreshConceptos();
                ControlsMng.UpdateBinding(Datos);

                HideComponentes();
            }
        }
        protected override void EliminarConceptoAction()
        {
            if (Datos_Concepto.Current == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                PgMng.Reset(5, 1, Store.Resources.Messages.UPDATING_STOCK, this);

                BatchInfo pexp = BatchInfo.Get(Line.OidPartida, true);
                PgMng.Grow();

                if (pexp.IsKit)
                {
                    DeleteKit(pexp);
                }
                PgMng.Grow();

                _entity.Conceptos.Remove(Line);
                _entity.CalculaTotal();
                PgMng.Grow();

                RefreshConceptos();
                ControlsMng.UpdateBinding(Datos);
                PgMng.FillUp();
            }

            Serie_BT.Enabled = (_entity.Conceptos.Count > 0);
        }
예제 #8
0
        protected virtual void LoadPartidasAction()
        {
            try
            {
                if (Cache.Instance.Get(typeof(BatchList)) != null)
                {
                    return;
                }

                PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);
                PgMng.Grow();

                Batch_BS.DataSource = BatchList.GetByProductList(EntityInfo.Oid, false);
                Cache.Instance.Save(typeof(BatchList), Batch_BS.DataSource as BatchList);
                PgMng.Grow();

                HideComponentes(Partidas_TP);

                ControlsMng.UpdateBinding(Batch_BS);
            }
            finally
            {
                PgMng.FillUp();
            }
        }
        protected override void SelectEstadoLineaAction()
        {
            if (Lineas_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }

            LineaPedido item = (LineaPedido)Lineas_DGW.CurrentRow.DataBoundItem;

            if (item == null)
            {
                return;
            }

            EEstado[] list = { EEstado.Anulado, EEstado.Abierto, EEstado.Solicitado, EEstado.Closed };

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            form.SetDataSource(Library.Common.EnumText <EEstado> .GetList(list));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource estado = form.Selected as ComboBoxSource;

                item.Estado = estado.Oid;

                ControlsMng.UpdateBinding(Datos_Lineas);
            }
        }
예제 #10
0
        protected override void DeleteLineAction()
        {
            if (Lines_BS.Current == null)
            {
                return;
            }

            if (PgMng.ShowDeleteConfirmation() == DialogResult.Yes)
            {
                if (Line.OidPedido == 0)
                {
                    PgMng.Reset(4, 1, Resources.Messages.UPDATING_STOCK, this);

                    BatchInfo partida = BatchInfo.Get(Line.OidPartida, true);
                    PgMng.Grow();

                    if (partida.IsKit)
                    {
                        DeleteKit(partida);
                    }
                    PgMng.Grow();

                    _entity.Conceptos.Remove(Line, true);
                    _entity.CalculateTotal();
                    PgMng.Grow();
                }
                else
                {
                    long oidPedido = Line.OidPedido;

                    _entity.Conceptos.Remove(Line, true);
                    _entity.CalculateTotal();

                    bool free_pedido = true;

                    foreach (InputDeliveryLine item in _entity.Conceptos)
                    {
                        if (item.OidPedido == Line.OidPedido)
                        {
                            free_pedido = false;
                        }
                    }

                    //Actualizamos la lista de pedidos disponibles
                    if (free_pedido)
                    {
                        _orders.AddItem(_provider_orders.GetItem(oidPedido));
                    }
                }


                ControlsMng.UpdateBinding(Lines_BS);
                ControlsMng.UpdateBinding(Datos);
                PgMng.FillUp();
            }

            Serie_BT.Enabled = (_entity.Conceptos.Count == 0);
        }
예제 #11
0
        protected override void UpdateDeliveryAction()
        {
            InputDeliveryLine item     = Lines_BS.Current as InputDeliveryLine;
            ProductInfo       producto = ProductInfo.Get(item.OidProducto, false, true);

            _entity.CalculateTotal();

            ControlsMng.UpdateBinding(Lines_BS);
        }
예제 #12
0
        protected void ReCalculatePayrolls()
        {
            foreach (Payroll item in _entity.Nominas)
            {
                item.CalculateValues(_employees.GetItem(item.OidEmpleado), _entity.Fecha);
            }

            ControlsMng.UpdateBinding(Payrolls_BS);
        }
예제 #13
0
        protected override void UpdateWorkReportAction()
        {
            _entity.CalculateTotal();

            ControlsMng.UpdateBinding(Lines_BS);
            Lines_DGW.Refresh();

            DisableColumns();
        }
        protected override void UpdateFacturaAction()
        {
            InputInvoiceLine item    = Datos_Lineas.Current as InputInvoiceLine;
            ProductInfo      product = ProductInfo.Get(item.OidProducto, false, true);

            item.BalanceQuantity(_entity, product);
            _entity.CalculateTotal();

            ControlsMng.UpdateBinding(Datos_Lineas);
        }
        protected override void UpdatePedidoAction()
        {
            LineaPedido item     = Datos_Lineas.Current as LineaPedido;
            ProductInfo producto = ProductInfo.Get(item.OidProducto, false, true);

            item.AjustaCantidad(producto);
            _entity.CalculateTotal();

            ControlsMng.UpdateBinding(Datos_Lineas);
        }
        protected virtual void SelectAlmacenAction()
        {
            AlmacenSelectForm form = new AlmacenSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                SetAlmacen((StoreInfo)form.Selected);
                //_entity.SetAlmacen(_almacen);
                ControlsMng.UpdateBinding(Lines_BS);
            }
        }
        protected override void UpdateDeliveryAction()
        {
            OutputDeliveryLine item     = Lines_BS.Current as OutputDeliveryLine;
            ProductInfo        producto = ProductInfo.Get(item.OidProducto, false, false);
            BatchInfo          partida  = BatchInfo.Get(item.OidPartida, false, false);

            item.AjustaCantidad(producto, (partida.Oid == 0) ? null : partida);
            _entity.CalculateTotal();

            ControlsMng.UpdateBinding(Lines_BS);
        }
예제 #18
0
        protected override void CalculatePayrollAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Payrolls_DGW))
            {
                return;
            }

            Payroll item = ControlsMng.GetCurrentItem(Payrolls_DGW) as Payroll;

            item.CalculateValues(_employees.GetItem(item.OidEmpleado), _entity.Fecha);

            ControlsMng.UpdateBinding(Payrolls_BS);
        }
        protected override void NuevoProductoAction()
        {
            ProductSelectForm form = new ProductSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ProductInfo item = form.Selected as ProductInfo;

                _entity.Productos.NewItem(_entity, item);

                ControlsMng.UpdateBinding(Datos_ProductoCliente);
            }
        }
        protected override void NewLineAction()
        {
            if (_entity.OidSerie == 0)
            {
                PgMng.ShowInfoException(Resources.Messages.NO_SERIE_SELECTED);
                return;
            }

            switch (_entity.EHolderType)
            {
            case ETipoEntidad.WorkReport:

                if (_work_report == null)
                {
                    PgMng.ShowInfoException(Resources.Messages.NO_WORK_REPORT_SELECTED);
                    return;
                }
                break;

            case ETipoEntidad.Cliente:

                if (_entity.OidHolder == 0)
                {
                    PgMng.ShowInfoException(Resources.Messages.NO_CLIENT_SELECTED);
                    return;
                }

                _cliente = Client_BS.Current as ClienteInfo;

                break;
            }

            DeliveryLinenAddForm form = new DeliveryLinenAddForm(ETipoProducto.Almacen, _entity, _serie, _cliente, this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _entity.CalculateTotal();

                if (_entity.Conceptos.Count > 0)
                {
                    Serie_BT.Enabled = false;
                }

                ControlsMng.UpdateBinding(Datos);

                HideComponentes();

                AddCacheItem(form.Entity);
            }
        }
        protected override void UpdateInvoiceAction()
        {
            try
            {
                OutputInvoiceLine item     = Lines_DGW.CurrentRow.DataBoundItem as OutputInvoiceLine;
                BatchInfo         batch    = BatchInfo.Get(item.OidPartida, false, true);
                ProductInfo       producto = ProductInfo.Get(item.OidProducto, false, false);

                item.AjustaCantidad(producto, batch);
                _entity.CalculateTotal();

                ControlsMng.UpdateBinding(Lines_BS);
            }
            catch { }
        }
예제 #22
0
        protected override void UpdatePayroll()
        {
            if (!ControlsMng.IsCurrentItemValid(Payrolls_DGW))
            {
                return;
            }

            Payroll item = ControlsMng.GetCurrentItem(Payrolls_DGW) as Payroll;

            item.CalculateNeto(_employees.GetItem(item.OidEmpleado).EPayrollMethod);
            ControlsMng.UpdateBinding(Payrolls_BS);

            UpdateTotalRemesa();

            ControlsMng.UpdateBinding(Datos);
        }
예제 #23
0
        protected override void SelectTipoAyudaPeriodoAction()
        {
            AyudaPeriodo item = Periodos_DGW.CurrentRow.DataBoundItem as AyudaPeriodo;

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            form.SetDataSource(Library.Common.EnumText <ETipoDescuento> .GetList(false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource tipo = form.Selected as ComboBoxSource;
                item.ETipoDescuento = (ETipoDescuento)tipo.Oid;

                ControlsMng.UpdateBinding(Datos_Periodos);
            }
        }
        protected override void SelectTipoDescuentoLineaAction()
        {
            ProductoProveedor item = Productos_DGW.CurrentRow.DataBoundItem as ProductoProveedor;

            SelectEnumInputForm form = new SelectEnumInputForm(true);

            form.SetDataSource(moleQule.Common.Structs.EnumText <ETipoDescuento> .GetList(false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ComboBoxSource tipo = form.Selected as ComboBoxSource;
                item.ETipoDescuento = (ETipoDescuento)tipo.Oid;

                ControlsMng.UpdateBinding(Datos_Productos);
            }
        }
예제 #25
0
        protected virtual void LoadComponentsAction()
        {
            try
            {
                PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);
                PgMng.Grow();

                EntityInfo.LoadChilds(typeof(Kit), false);
                Datos_Components.DataSource = EntityInfo.Components;
                PgMng.Grow();

                ControlsMng.UpdateBinding(Datos_Components);
            }
            finally
            {
                PgMng.FillUp();
            }
        }
        protected override void SelectAlmacenLineaAction()
        {
            if (Datos_Lineas.Current == null)
            {
                return;
            }

            LineaPedido item = Datos_Lineas.Current as LineaPedido;

            AlmacenSelectForm form = new AlmacenSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                StoreInfo source = (StoreInfo)form.Selected;

                item.OidAlmacen = source.Oid;
                item.Almacen    = source.Nombre;

                ControlsMng.UpdateBinding(Lineas_DGW);
            }
        }
        protected override void SelectExpedienteLineaAction()
        {
            if (Datos_Lineas.Current == null)
            {
                return;
            }

            LineaPedido item = Datos_Lineas.Current as LineaPedido;

            ExpedienteSelectForm form = new ExpedienteSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ExpedientInfo source = (ExpedientInfo)form.Selected;

                item.OidExpediente = source.Oid;
                item.Expediente    = source.Codigo;

                ControlsMng.UpdateBinding(Lineas_DGW);
            }
        }
        protected override void SelectImpuestoLineaAction()
        {
            if (Datos_Lineas.Current == null)
            {
                return;
            }

            LineaPedido item = Datos_Lineas.Current as LineaPedido;

            ImpuestoSelectForm form = new ImpuestoSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ImpuestoInfo source = (ImpuestoInfo)form.Selected;

                item.OidImpuesto = source.Oid;
                item.PImpuestos  = source.Porcentaje;
                _entity.CalculateTotal();

                ControlsMng.UpdateBinding(Lineas_DGW);
            }
        }
예제 #29
0
 protected override void NewPeriodoAction()
 {
     _entity.Periodos.NewItem(_entity);
     ControlsMng.UpdateBinding(Datos_Periodos);
 }