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

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

            if ((s.OidAlbaran != 0) ||
                ((s.OidAlbaran == 0) && (s.Observaciones == Library.Store.Resources.Defaults.STOCK_INICIAL)))
            {
                PgMng.ShowInfoException(Resources.Messages.STOCK_FACTURADO);
                return;
            }

            EditStockActionForm form = new EditStockActionForm(s, _entity);

            form.ShowDialog(this);

            Stock_BS.ResetBindings(false);
        }
        protected override void DeleteStockAction()
        {
            if (Stock_DGW.CurrentRow == null)
            {
                return;
            }
            if (Stock_DGW.CurrentRow.Index < 0)
            {
                return;
            }
            if (Stock_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }

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

            if ((st.OidAlbaran != 0) || (st.Inicial))
            {
                return;
            }

            RemoveStock(st);

            Stock_BS.ResetBindings(false);
        }
示例#3
0
        protected virtual void UpdateBindings()
        {
            Stock_BS.ResetBindings(false);
            Stock_DGW.Refresh();

            Batchs_BS.ResetBindings(false);
            Benefits_DGW.Refresh();

            ExpensesInvoices_BS.ResetBindings(true);
            ExpensesInvoices_DGW.Refresh();
        }
        protected override void AddStockAction()
        {
            if (_entity.Partidas.Count == 0)
            {
                PgMng.ShowInfoException(Resources.Messages.NO_PRODUCTS_ASSOC);
                return;
            }

            AddStockInputForm form = new AddStockInputForm(_entity);

            form.ShowDialog(this);

            Stock_BS.ResetBindings(false);
        }
        protected override void SelectStockAction(ProductInfo producto)
        {
            if (_entity.ETipoExpediente == moleQule.Store.Structs.ETipoExpediente.Almacen)
            {
                if (producto == null)
                {
                    return;
                }

                FCriteria criteria = new FCriteria <long>("OidProducto", producto.Oid, Operation.Equal);
                Stock_BS.DataSource = _entity.Stocks.GetSubList(criteria);
            }
            else
            {
                Stock_BS.DataSource = _entity.Stocks;
            }

            Stock_BS.ResetBindings(true);
        }