Exemple #1
0
        private void AssignBudget_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e)
        {
            bool     err = true;
            ListView lv  = ((ListView)View);

            if (lv.CollectionSource is PropertyCollectionSource)
            {
                PropertyCollectionSource collectionSource = (PropertyCollectionSource)lv.CollectionSource;
                if (collectionSource.MasterObject != null)
                {
                    if (!ObjectSpace.IsNewObject(collectionSource.MasterObject))
                    {
                        err = false;
                    }
                }
            }
            IObjectSpace os = Application.CreateObjectSpace();
            DetailView   dv = Application.CreateDetailView(os, os.CreateObject <BudgetParameters>(), true);

            ((BudgetParameters)dv.CurrentObject).IsErr         = err;
            ((BudgetParameters)dv.CurrentObject).ActionMessage = "Plesae save the record before Assign Budget.";
            dv.ViewEditMode = DevExpress.ExpressApp.Editors.ViewEditMode.Edit;

            e.View = dv;
        }
 protected override void OnActivated()
 {
     base.OnActivated();
     if (!IsAdmininstator(SecuritySystem.CurrentUserId))
     {
         if (View.IsRoot)
         {
             FilterActivities(CriteriaOperator.Parse("Employees[Oid = ?]", SecuritySystem.CurrentUserId));
         }
     }
     if (!View.IsRoot)
     {
         PropertyCollectionSource propertyCollectionSource = View.CollectionSource as PropertyCollectionSource;
         if (propertyCollectionSource != null)
         {
             propertyCollectionSource.MasterObjectChanged += propertyCollectionSource_MasterObjectChanged;
             UpdateMasterDetailViewEmployee(propertyCollectionSource);
         }
     }
     schedulerListEditorCore = ((ListView)View).Editor as SchedulerListEditorBase;
     if (schedulerListEditorCore != null)
     {
         schedulerListEditorCore.ResourceDataSourceCreated += schedulerListEditorCore_ResourceDataSourceCreated;
     }
 }
        protected override void OnActivated()
        {
            base.OnActivated();

            PropertyCollectionSource cs = this.View.CollectionSource as PropertyCollectionSource;

            this.Frame.GetController <DeleteObjectsViewController>().DeleteAction.Active[this.Name] = cs == null || (cs.MemberInfo.IsManyToMany && cs.MemberInfo.IsAggregated) || ((this.View.Model as IModelAllowDeleteOnNonAggregatedCollections).AllowDeleteNonAggregatedObject && (Application.Model.Options as IModelDefaultAllowDeleteOnNonAggregatedCollections).AllowDeleteNonAggregatedObjects) || ((this.View.Model as IModelAllowDeleteOnNonAggregatedCollections).HasValue("AllowDeleteNonAggregatedObject") && (this.View.Model as IModelAllowDeleteOnNonAggregatedCollections).AllowDeleteNonAggregatedObject);
        }
Exemple #4
0
 void ViewController1_ObjectCreated(object sender, ObjectCreatedEventArgs e)
 {
     if (e.CreatedObject is ViewFilterObject)
     {
         ViewFilterObject         newViewFilterObject = (ViewFilterObject)e.CreatedObject;
         PropertyCollectionSource pcs = (PropertyCollectionSource)View.CollectionSource;
         newViewFilterObject.ObjectType = ((ViewFilterContainer)pcs.MasterObject).ObjectType;
     }
 }
Exemple #5
0
        protected override void OnDeactivated()
        {
            PropertyCollectionSource collectionSource = View.CollectionSource as PropertyCollectionSource;

            if (collectionSource != null)
            {
                collectionSource.MasterObjectChanged -= OnMasterObjectChanged;
            }
            base.OnDeactivated();
        }
Exemple #6
0
        private void AssignBudget_Execute(object sender, PopupWindowShowActionExecuteEventArgs e)
        {
            BudgetParameters p = (BudgetParameters)e.PopupWindow.View.CurrentObject;

            if (p.IsErr)
            {
                return;
            }
            if (p.Amount <= 0)
            {
                return;
            }
            if (p.ParamYear >= 2010 && p.ParamYear <= 2099)
            {
            }
            else
            {
                return;
            }

            Budgets  currentobject = (Budgets)View.CurrentObject;
            ListView lv            = ((ListView)View);

            if (lv.CollectionSource is PropertyCollectionSource)
            {
                PropertyCollectionSource collectionSource = (PropertyCollectionSource)lv.CollectionSource;
                if (collectionSource.MasterObject != null)
                {
                    if (collectionSource.MasterObjectType == typeof(BudgetMasters))
                    {
                        BudgetMasters masterobject = (BudgetMasters)collectionSource.MasterObject;
                        if (p.IsYearly)
                        {
                            Budgets budget = ObjectSpace.CreateObject <Budgets>();
                            budget.DateFrom = new DateTime(p.ParamYear, 1, 1);
                            budget.DateTo   = new DateTime(p.ParamYear, 12, 31);
                            budget.Amount   = p.Amount;
                            masterobject.Budget.Add(budget);
                        }
                        else
                        {
                            for (int x = 1; x <= 12; x++)
                            {
                                Budgets budget = ObjectSpace.CreateObject <Budgets>();
                                budget.DateFrom = new DateTime(p.ParamYear, x, 1);
                                budget.DateTo   = budget.DateFrom.AddMonths(1).AddDays(-1);
                                budget.Amount   = p.Amount;
                                masterobject.Budget.Add(budget);
                            }
                        }
                    }
                }
            }
        }
Exemple #7
0
        private void SalesOrderLines_Execute(object sender, PopupWindowShowActionExecuteEventArgs e)
        {
            PropertyCollectionSource collectionSource = (PropertyCollectionSource)((ListView)View).CollectionSource;

            collectionSource.ObjectSpace.CommitChanges();
            collectionSource.ObjectSpace.Refresh();
            e.PopupWindow.View.ObjectSpace.CommitChanges();
            //  ((ListView)View).CollectionSource.Reload();
            View.ObjectSpace.Refresh();
            View.Refresh();
        }
        /// <summary>
        /// This method adds imported objects into the required ListView.
        /// </summary>
        /// <typeparam name="T">Any persistent object type supporting the IXPSimpleObject interface.</typeparam>
        /// <param name="count">The count of of objects to be imported.</param>
        /// <param name="importDataDelegate">A function of the ImportDataDelegate type that can create persistent objects.</param>
        /// <param name="customValidateDataDelegate">A function of the ValidateDataDelegate type that can be used to additionally validated created persistent objects. Note that by default, the created objects are already validated using the XAF's Validation system. So, you can set this parameter to null or Nothing in VB.NET</param>
        /// <param name="targetListView">A ListView to which objects will be imported.</param>
        /// <returns>The real count of imported objects.</returns>
        /// Dennis: This method reuses the UnitOfWork/NestedUnitOfWork classes, but it's also correct to use independent (that doesn't belong to a View) ObjectSpace/NestedObjectSpace classes here.
        public int ImportData <T>(int count, ImportDataDelegate <T> importDataDelegate, ValidateDataDelegate <T> customValidateDataDelegate, ListView targetListView) where T : IXPSimpleObject
        {
            if (targetListView == null)
            {
                throw new ArgumentNullException("targetlistView");
            }
            IObjectSpace importObjectSpace = null;
            int          countOK           = 0;

            try {
                importObjectSpace = Application.CreateObjectSpace(targetListView.CollectionSource.ObjectTypeInfo.Type);
                for (int i = 0; i < count; i++)
                {
                    using (IObjectSpace nestedImportObjectSpace = importObjectSpace.CreateNestedObjectSpace()) {
                        PropertyCollectionSource pcs = targetListView.CollectionSource as PropertyCollectionSource;
                        object masterObject          = pcs != null?nestedImportObjectSpace.GetObjectByKey(pcs.MasterObjectType, nestedImportObjectSpace.GetKeyValue(pcs.MasterObject)) : null;

                        T obj = importDataDelegate(nestedImportObjectSpace, masterObject, i);
                        if (obj != null)
                        {
                            bool isValid = false;
                            try {
                                RuleSetValidationResult validationResult = Validator.RuleSet.ValidateTarget(null, obj, new ContextIdentifiers(DefaultContexts.Save.ToString()));
                                isValid = validationResult.State != ValidationState.Invalid && (customValidateDataDelegate != null ? customValidateDataDelegate(obj, masterObject, i) : true);
                                if (isValid)
                                {
                                    nestedImportObjectSpace.CommitChanges();
                                }
                            } catch (Exception) {
                                isValid = false;
                            } finally {
                                if (isValid)
                                {
                                    countOK++;
                                }
                            }
                        }
                    }
                }
                importObjectSpace.CommitChanges();
                targetListView.ObjectSpace.Refresh();
            } catch (Exception commitException) {
                try {
                    importObjectSpace.Rollback();
                } catch (Exception rollBackException) {
                    throw new Exception(String.Format("An exception of type {0} was encountered while attempting to roll back the transaction while importing the data of the {1} type.\nError Message:{2}\nStackTrace:{3}", rollBackException.GetType(), typeof(T), rollBackException.Message, rollBackException.StackTrace), rollBackException);
                }
                throw new UserFriendlyException(String.Format("Importing can't be finished!\nAn exception of type {0} was encountered while importing the data of the {1} type.\nError message = {2}\nStackTrace:{3}\nNo records were imported.", commitException.GetType(), typeof(T), commitException.Message, commitException.StackTrace));
            } finally {
                importObjectSpace.Dispose();
                importObjectSpace = null;
            }
            return(countOK);
        }
        private void UpdateMasterDetailViewEmployee(PropertyCollectionSource propertyCollectionSource)
        {
            if (propertyCollectionSource == null)
            {
                return;
            }
            Employee masterDetailViewEmployee = propertyCollectionSource.MasterObject as Employee;

            if (masterDetailViewEmployee != null)
            {
                masterDetailViewEmployeeIdCore = masterDetailViewEmployee.Oid;
                FilterActivities(GetActivitiesFilter(masterDetailViewEmployee));
            }
        }
Exemple #10
0
        protected override void OnActivated()
        {
            base.OnActivated();
            PropertyCollectionSource collectionSource = View.CollectionSource as PropertyCollectionSource;

            if (collectionSource != null)
            {
                collectionSource.MasterObjectChanged += OnMasterObjectChanged;
                if (collectionSource.MasterObject != null)
                {
                    UpdateMasterObject(collectionSource.MasterObject);
                }
            }
        }
 protected override void OnDeactivated()
 {
     if (schedulerListEditorCore != null)
     {
         schedulerListEditorCore.ResourceDataSourceCreated -= schedulerListEditorCore_ResourceDataSourceCreated;
     }
     if (!View.IsRoot)
     {
         PropertyCollectionSource propertyCollectionSource = View.CollectionSource as PropertyCollectionSource;
         if (propertyCollectionSource != null)
         {
             propertyCollectionSource.MasterObjectChanged -= propertyCollectionSource_MasterObjectChanged;
         }
     }
     base.OnDeactivated();
 }
Exemple #12
0
        private void popupWindowShowAction1_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e)
        {
            TargetViewId = "SODetails_DetailView_NewLine";
            View.ObjectSpace.CommitChanges();



            IObjectSpace objectSpace = Application.CreateObjectSpace();
            SODetails    SOD         = objectSpace.CreateObject <SODetails>();

            PropertyCollectionSource collectionSource = (PropertyCollectionSource)((ListView)View).CollectionSource;
            SOHeader header = (SOHeader)collectionSource.MasterObject;

            SOD.SalesOrder = objectSpace.GetObject <SOHeader>(header);
            e.View         = Application.CreateDetailView(objectSpace, TargetViewId, true, SOD);
        }
        protected override void OnActivated()
        {
            base.OnActivated();
            var attribute = View.ObjectTypeInfo.FindAttribute <AddItemClassAttribute>();// TargetObjectType.GetCustomAttributes(typeof(AddItemClassAttribute), false);

            if (attribute != null)
            {
                ///if (TargetObjectType.GetInterfaces().Contains(typeof(IAddItems))){
                collectionSource = View.CollectionSource as PropertyCollectionSource;
                if (collectionSource != null)
                {
                    collectionSource.MasterObjectChanged += OnMasterObjectChanged;
                    if (collectionSource.MasterObject != null)
                    {
                        UpdateMasterObject(collectionSource.MasterObject);
                        actAddItems.Enabled["Test"] = MasterObject.Shop != null;
                    }
                }
            }
        }
        protected virtual void ImportData(SingleChoiceActionExecuteEventArgs e)
        {
            ChoiceActionItem  activeItem    = e.SelectedChoiceActionItem;
            ListView          lv            = (ListView)View;
            ImportDataManager importManager = new ImportDataManager(Application);

            switch (activeItem.Data.ToString())
            {
            case "Person_ListView":
                importManager.ImportData <Person>(MaxImportedRecordsCount, ImportDataLogic.CreateCoolPersonImportDataFromXmlFileDelegate(), null, lv, true);
                //Dennis: This line won't be executed unless you handle the exception thrown from the previus ImportData call.
                //ImportDataManager.ImportData<Person>(MaxImportedRecordsCount, ImportDataLogic.CreateDummyPersonImportDataDelegate(), ImportDataLogic.CreateDummyPersonValidateDataDelegate(), lv, true);
                break;

            case "Party_PhoneNumbers_ListView":
                PropertyCollectionSource pcs = lv.CollectionSource as PropertyCollectionSource;
                if (pcs != null)
                {
                    importManager.ImportData <PhoneNumber>(MaxImportedRecordsCount, ImportDataLogic.CreateDummyPhoneNumberImportDataDelegate(), ImportDataLogic.CreateDummyPhoneNumberValidateDataDelegate(), lv, true);
                }
                break;
            }
        }
        protected override void OnActivated()
        {
            base.OnActivated();

            //http://documentation.devexpress.com/#xaf/CustomDocument3161
            propertyCollectionSource = View.CollectionSource as PropertyCollectionSource;

            if (propertyCollectionSource != null)
            {
                propertyCollectionSource.MasterObjectChanged += OnMasterObjectChanged;

                if (propertyCollectionSource.MasterObject != null)
                {
                    UpdateMasterObject(propertyCollectionSource.MasterObject);
                }
            }

            Frame.GetController<ListViewProcessCurrentObjectController>().CustomProcessSelectedItem +=
                new EventHandler<CustomProcessListViewSelectedItemEventArgs>(FileAttachmentViewController_CustomProcessSelectedItem);
        }
        private void Controller_ObjectCreated(object sender, ObjectCreatedEventArgs e)
        {
            ListView lv = ((ListView)View);

            if (lv.CollectionSource is PropertyCollectionSource)
            {
                PropertyCollectionSource collectionSource = (PropertyCollectionSource)lv.CollectionSource;
                if (collectionSource.MasterObject != null)
                {
                    int minvalue     = -1;
                    int comparevalue = 0;
                    if (View.ObjectTypeInfo.Type == typeof(ClaimTrxDetails))
                    {
                        if (collectionSource.MasterObjectType == typeof(ClaimTrxs))
                        {
                            ClaimTrxs       masterobject  = (ClaimTrxs)collectionSource.MasterObject;
                            ClaimTrxDetails currentobject = (ClaimTrxDetails)e.CreatedObject;
                            if (masterobject.Currency != null)
                            {
                                currentobject.Currency = currentobject.Session.GetObjectByKey <Currencies>(masterobject.Currency.Oid);
                            }
                            currentobject.FCRate = masterobject.FCRate;

                            #region assign oid
                            if (masterobject.ClaimTrxDetail.Count > 0)
                            {
                                comparevalue = masterobject.ClaimTrxDetail.Min(pp => pp.Oid);
                            }
                            if (comparevalue <= minvalue)
                            {
                                minvalue = comparevalue - 1;
                            }
                            currentobject.Oid = minvalue;
                            #endregion
                        }
                    }
                    if (View.ObjectTypeInfo.Type == typeof(ClaimTrxDetailNotes))
                    {
                        if (collectionSource.MasterObjectType == typeof(ClaimTrxDetails))
                        {
                            ClaimTrxDetails     masterobject  = (ClaimTrxDetails)collectionSource.MasterObject;
                            ClaimTrxDetailNotes currentobject = (ClaimTrxDetailNotes)e.CreatedObject;
                            if (masterobject.Currency != null)
                            {
                                currentobject.Currency = currentobject.Session.GetObjectByKey <Currencies>(masterobject.Currency.Oid);
                                currentobject.FCRate   = masterobject.FCRate;
                            }
                            else if (masterobject.ClaimTrx != null && masterobject.ClaimTrx.Currency != null)
                            {
                                currentobject.Currency = currentobject.Session.GetObjectByKey <Currencies>(masterobject.ClaimTrx.Currency.Oid);
                                currentobject.FCRate   = masterobject.ClaimTrx.FCRate;
                            }
                            else
                            {
                                currentobject.FCRate = masterobject.FCRate;
                            }

                            #region assign oid
                            if (masterobject.ClaimTrxDetailNote.Count > 0)
                            {
                                comparevalue = masterobject.ClaimTrxDetailNote.Min(pp => pp.Oid);
                            }
                            if (comparevalue <= minvalue)
                            {
                                minvalue = comparevalue - 1;
                            }
                            currentobject.Oid = (masterobject.Oid < 0? masterobject.Oid * 100: masterobject.Oid * -100) + minvalue;
                            #endregion
                        }
                    }
                    if (View.ObjectTypeInfo.Type == typeof(ClaimTrxItems))
                    {
                        if (collectionSource.MasterObjectType == typeof(ClaimTrxs))
                        {
                            ClaimTrxs     masterobject  = (ClaimTrxs)collectionSource.MasterObject;
                            ClaimTrxItems currentobject = (ClaimTrxItems)e.CreatedObject;
                            if (masterobject.Currency != null)
                            {
                                currentobject.Currency = currentobject.Session.GetObjectByKey <Currencies>(masterobject.Currency.Oid);
                            }
                            currentobject.FCRate = masterobject.FCRate;

                            #region assign oid
                            if (masterobject.ClaimTrxItem.Count > 0)
                            {
                                comparevalue = masterobject.ClaimTrxItem.Min(pp => pp.Oid);
                            }
                            if (comparevalue <= minvalue)
                            {
                                minvalue = comparevalue - 1;
                            }
                            currentobject.Oid = minvalue;
                            #endregion
                        }
                    }
                    if (View.ObjectTypeInfo.Type == typeof(ClaimTrxMileages))
                    {
                        if (collectionSource.MasterObjectType == typeof(ClaimTrxs))
                        {
                            ClaimTrxs        masterobject  = (ClaimTrxs)collectionSource.MasterObject;
                            ClaimTrxMileages currentobject = (ClaimTrxMileages)e.CreatedObject;

                            #region assign oid
                            if (masterobject.ClaimTrxMileage.Count > 0)
                            {
                                comparevalue = masterobject.ClaimTrxMileage.Min(pp => pp.Oid);
                            }
                            if (comparevalue <= minvalue)
                            {
                                minvalue = comparevalue - 1;
                            }
                            currentobject.Oid = minvalue;
                            #endregion
                        }
                    }
                    if (View.ObjectTypeInfo.Type == typeof(ClaimTrxPostDetails))
                    {
                        if (collectionSource.MasterObjectType == typeof(ClaimTrxs))
                        {
                            ClaimTrxs           masterobject  = (ClaimTrxs)collectionSource.MasterObject;
                            ClaimTrxPostDetails currentobject = (ClaimTrxPostDetails)e.CreatedObject;

                            #region assign oid
                            if (masterobject.ClaimTrxPostDetail.Count > 0)
                            {
                                comparevalue = masterobject.ClaimTrxPostDetail.Min(pp => pp.Oid);
                            }
                            if (comparevalue <= minvalue)
                            {
                                minvalue = comparevalue - 1;
                            }
                            currentobject.Oid = minvalue;
                            #endregion
                        }
                    }
                }
            }
        }
Exemple #17
0
        private void Controller_ObjectCreated(object sender, ObjectCreatedEventArgs e)
        {
            ListView lv = ((ListView)View);

            if (lv.CollectionSource is PropertyCollectionSource)
            {
                PropertyCollectionSource collectionSource = (PropertyCollectionSource)lv.CollectionSource;
                if (collectionSource.MasterObject != null)
                {
                    int minvalue    = 0;
                    int maxvisorder = 0;

                    if (collectionSource.MasterObjectType == typeof(StockTransferRequest) && e.CreatedObject.GetType() == typeof(StockTransferRequestDetail))
                    {
                        StockTransferRequest       masterobject  = (StockTransferRequest)collectionSource.MasterObject;
                        StockTransferRequestDetail currentobject = (StockTransferRequestDetail)e.CreatedObject;

                        copyCon.GetStockDetailClassVisOrder(masterobject, ref minvalue, ref maxvisorder);

                        currentobject.Oid      = minvalue;
                        currentobject.VisOrder = maxvisorder;

                        if (sDtlS != null)
                        {
                            copyCon.copyClassStockTransferDocumentDetail(sDtlS, currentobject, e.ObjectSpace);
                        }
                    }
                    else if (collectionSource.MasterObjectType == typeof(PurchaseOrder))
                    {
                        PurchaseOrder       masterobject  = (PurchaseOrder)collectionSource.MasterObject;
                        PurchaseOrderDetail currentobject = (PurchaseOrderDetail)e.CreatedObject;

                        copyCon.GetDetailClassVisOrder(masterobject, ref minvalue, ref maxvisorder);

                        currentobject.Oid      = minvalue;
                        currentobject.VisOrder = maxvisorder;
                        currentobject.DocCur   = currentobject.Session.GetObjectByKey <vwCurrency>(masterobject.DocCur.BoKey);

                        if (sDtl != null)
                        {
                            copyCon.copyClassDocumentDetail(sDtl, currentobject, e.ObjectSpace);
                        }
                    }
                    else if (collectionSource.MasterObjectType == typeof(PurchaseRequest))
                    {
                        PurchaseRequest       masterobject  = (PurchaseRequest)collectionSource.MasterObject;
                        PurchaseRequestDetail currentobject = (PurchaseRequestDetail)e.CreatedObject;

                        copyCon.GetDetailClassVisOrder(masterobject, ref minvalue, ref maxvisorder);

                        currentobject.Oid      = minvalue;
                        currentobject.VisOrder = maxvisorder;

                        if (masterobject.DocCur != null)
                        {
                            currentobject.DocCur = currentobject.Session.GetObjectByKey <vwCurrency>(masterobject.DocCur.BoKey);
                        }

                        if (sDtl != null)
                        {
                            copyCon.copyClassDocumentDetail(sDtl, currentobject, e.ObjectSpace);
                        }
                    }
                    else if (collectionSource.MasterObjectType == typeof(PurchaseDelivery))
                    {
                        PurchaseDelivery       masterobject  = (PurchaseDelivery)collectionSource.MasterObject;
                        PurchaseDeliveryDetail currentobject = (PurchaseDeliveryDetail)e.CreatedObject;

                        copyCon.GetDetailClassVisOrder(masterobject, ref minvalue, ref maxvisorder);

                        currentobject.Oid      = minvalue;
                        currentobject.VisOrder = maxvisorder;

                        if (masterobject.DocCur != null)
                        {
                            currentobject.DocCur = currentobject.Session.GetObjectByKey <vwCurrency>(masterobject.DocCur.BoKey);
                        }

                        if (sDtl != null)
                        {
                            copyCon.copyClassDocumentDetail(sDtl, currentobject, e.ObjectSpace);
                        }
                    }
                    else if (collectionSource.MasterObjectType == typeof(PurchaseReturn))
                    {
                        PurchaseReturn       masterobject  = (PurchaseReturn)collectionSource.MasterObject;
                        PurchaseReturnDetail currentobject = (PurchaseReturnDetail)e.CreatedObject;

                        copyCon.GetDetailClassVisOrder(masterobject, ref minvalue, ref maxvisorder);

                        currentobject.Oid      = minvalue;
                        currentobject.VisOrder = maxvisorder;

                        if (masterobject.DocCur != null)
                        {
                            currentobject.DocCur = currentobject.Session.GetObjectByKey <vwCurrency>(masterobject.DocCur.BoKey);
                        }

                        if (sDtl != null)
                        {
                            copyCon.copyClassDocumentDetail(sDtl, currentobject, e.ObjectSpace);
                        }
                    }
                    else if (collectionSource.MasterObjectType == typeof(PurchaseQuotation))
                    {
                        PurchaseQuotation       masterobject  = (PurchaseQuotation)collectionSource.MasterObject;
                        PurchaseQuotationDetail currentobject = (PurchaseQuotationDetail)e.CreatedObject;

                        copyCon.GetDetailClassVisOrder(masterobject, ref minvalue, ref maxvisorder);

                        currentobject.Oid      = minvalue;
                        currentobject.VisOrder = maxvisorder;

                        if (masterobject.DocCur != null)
                        {
                            currentobject.DocCur = currentobject.Session.GetObjectByKey <vwCurrency>(masterobject.DocCur.BoKey);
                        }

                        if (sDtl != null)
                        {
                            copyCon.copyClassDocumentDetail(sDtl, currentobject, e.ObjectSpace);
                        }
                    }
                }
            }

            sDtl  = null;
            sDtlS = null;
        }