Esempio n. 1
0
        protected override void GridView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            base.GridView_CellValueChanged(sender, e);
            ProposalEntities entity     = (ProposalEntities)(this.Screen.Module as BaseModuleERP).CurrentModuleEntity;
            ARProposalsInfo  mainObject = (ARProposalsInfo)entity.MainObject;

            if (entity.ProposalItemList.CurrentIndex >= 0)
            {
                ARProposalItemsInfo item = entity.ProposalItemList[entity.ProposalItemList.CurrentIndex];
                if (item != null)
                {
                    if (e.Column.FieldName == "ARProposalItemDiscountAmount")
                    {
                        item.ARProposalItemDiscountPercent = item.ARProposalItemDiscountAmount / (item.ARProposalItemPrice * item.ARProposalItemQty) * 100;
                        entity.UpdateTotalAmountProposalItemList(mainObject.FK_GECurrencyID);
                    }
                    else if (e.Column.FieldName == "ARProposalItemTaxAmount")
                    {
                        item.ARProposalItemTaxPercent = item.ARProposalItemTaxAmount / (item.ARProposalItemPrice * item.ARProposalItemQty - item.ARProposalItemDiscountAmount) * 100;
                        entity.UpdateTotalAmountProposalItemList(mainObject.FK_GECurrencyID);
                    }
                    else
                    {
                        ((ProposalModule)Screen.Module).ChangeItemFromProposalItemsList();
                    }
                }
            }
        }
Esempio n. 2
0
        public void ChangeItemFromProposalItemsList()
        {
            if (Toolbar.IsNullOrNoneAction())
            {
                return;
            }

            ProposalEntities entity     = (ProposalEntities)CurrentModuleEntity;
            ARProposalsInfo  mainObject = (ARProposalsInfo)CurrentModuleEntity.MainObject;

            if (entity.ProposalItemList.CurrentIndex < 0)
            {
                return;
            }

            ARProposalItemsInfo objProposalItemsInfo = entity.ProposalItemList[entity.ProposalItemList.CurrentIndex];

            if (objProposalItemsInfo == null)
            {
                return;
            }

            entity.UpdateTotalAmountProposalItemList(mainObject.FK_GECurrencyID);
            UpdateTotalAmount();
            entity.ProposalItemList.GridControl.RefreshDataSource();
            entity.UpdateMainObjectBindingSource();
        }