protected override void DeleteWorkReportAction()
        {
            if (WorkReport_DGW.CurrentRow == null)
            {
                return;
            }
            if (WorkReport_DGW.CurrentRow.Index < 0)
            {
                return;
            }
            if (WorkReport_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }

            if (PgMng.ShowDeleteConfirmation() == DialogResult.Yes)
            {
                WorkReportInfo item = (WorkReportInfo)WorkReport_DGW.CurrentRow.DataBoundItem;
                WorkReport.Delete(item.Oid);
                _work_reports.Remove(item);

                WorkReport_BS.ResetBindings(false);
                UpdateWorkReportsTotals();
                LoadCategoriesExpenses(true);
            }
        }
        protected override void DeleteWorkAction()
        {
            if (Works_DGW.CurrentRow == null)
            {
                return;
            }
            if (Works_DGW.CurrentRow.Index < 0)
            {
                return;
            }
            if (Works_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }

            if (PgMng.ShowDeleteConfirmation() == DialogResult.Yes)
            {
                ExpedientInfo item = (ExpedientInfo)Works_DGW.CurrentRow.DataBoundItem;

                Relation exp = _entity.Relations.GetRelationChild(item);
                if (exp != null)
                {
                    _entity.Relations.Remove(exp);
                }

                LoadData(true);
            }
        }
        protected override void DeleteREAAction()
        {
            if (ExpedienteREA_DGW.CurrentRow == null)
            {
                return;
            }
            if (ExpedienteREA_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }

            if (PgMng.ShowDeleteConfirmation() == DialogResult.No)
            {
                return;
            }

            REAExpedient item = ExpedienteREA_DGW.CurrentRow.DataBoundItem as REAExpedient;

            try
            {
                _entity.ExpedientesREA.RemoveItem(item, _entity);
            }
            catch (iQException ex)
            {
                PgMng.ShowInfoException(ex);
            }
        }
Пример #4
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);
        }
        protected override void DeleteProductoAction()
        {
            if (Datos_Productos.Current == null)
            {
                return;
            }

            if (PgMng.ShowDeleteConfirmation() == DialogResult.Yes)
            {
                ProductoProveedor pp = (ProductoProveedor)Datos_Productos.Current;
                _entity.Productos.Remove(pp.Oid);

                Datos_Productos.ResetBindings(false);
            }
        }
        protected override void RemoveStockAction()
        {
            if (Stock_DGW.CurrentRow == null)
            {
                return;
            }

            Stock stock = (Stock)Stock_DGW.CurrentRow.DataBoundItem;

            if ((stock.OidAlbaran != 0) || (stock.Inicial))
            {
                PgMng.ShowInfoException(Resources.Messages.STOCK_FACTURADO);
                return;
            }

            if (PgMng.ShowDeleteConfirmation() == DialogResult.No)
            {
                return;
            }

            _entity.RemoveStock(stock);
            ActualizaBindings();
        }