Example #1
0
 // construct the view model
 internal OrderManagementViewModel(Proxy proxy, OrderManagementControl control)
 {
     _Control        = control;
     _Proxy          = proxy;
     _Filter         = String.Empty;
     _FilterUpper    = string.Empty;
     _IsExpanded     = true;
     _ParentList     = new ObservableCollection <SalesOrderViewModel>();
     _FileList       = new ListCollectionView(ParentList);
     FileList.Filter = FileList_Filter;
     using (FileList.DeferRefresh())
     {
         _AddSortDescription();
     }
     _LoadedAvailableItems         = false;
     _AvailableItems               = new ObservableCollection <SalesItemViewModel>();
     _AvailableItemsFiltered       = new ListCollectionView(_AvailableItems);
     AvailableItemsFiltered.Filter = AvailableItemsFilter;
     using (AvailableItemsFiltered.DeferRefresh())
     {
         ItemsAddSortDescription();
     }
     ItemsFilter = "";
     _Proxy._InitializedControl(this);
     _DefaultFile = new SalesOrderViewModel(this, 0, string.Empty, string.Empty, string.Empty);
 }
Example #2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="inDesignMode">Flag which indicates if the control is being drawn on the Workspace Designer. (Use this flag to determine if code should perform any logic on the workspace record)</param>
        /// <param name="RecordContext">The current workspace record context.</param>
        public WorkspaceAddIn(bool inDesignMode, IRecordContext recordContext, IGlobalContext globalContext, string version)
        {
            // do nothing so framework won't throw exception once it gets to GetControl
            if (!ConfigurationSetting.configVerbPerfect && ConfigurationSetting.loginUserIsAdmin)
            {
                // do nothing
            }
            else
            {
                _gContext           = globalContext;
                _recordContext      = recordContext;
                bulkImportControl   = new OrderManagementControl(new Proxy(this));
                _Model              = bulkImportControl._Model;
                _Model.InDesignMode = inDesignMode;
                _Model.Version      = version;
                var elementHost = new ElementHost
                {
                    Dock  = DockStyle.Fill,
                    Child = bulkImportControl,
                };

                Controls.Add(elementHost);
                if (inDesignMode)
                {
                    return;
                }

                //Get configuration
                ConfigurationSetting instance = ConfigurationSetting.Instance(globalContext);
                _usr    = ConfigurationSetting.username;
                _pwd    = ConfigurationSetting.password;
                _client = ConfigurationSetting.client;
                _rnSrv  = ConfigurationSetting.rnSrv;

                Accelerator.EBS.SharedServices.Order.ServiceProvider = ConfigurationSetting.EBSProvider;
                Accelerator.EBS.SharedServices.Order.GetOrderURL     = ConfigurationSetting.GetOrder_WSDL;
                Accelerator.EBS.SharedServices.Order.OrderInboundURL = ConfigurationSetting.OrderInboundURL_WSDL;
                Accelerator.EBS.SharedServices.Order.InitEBSProvider();

                _Model.EbsOwnerId = ConfigurationSetting.ebsDefaultSrOwnerId;

                _recordContext.DataLoaded += _rContext_DataLoaded;
                _recordContext.Closing    += _recordContext_Closing;
                _recordContext.Saving     += _recordContext_Saving;
                _gContext.AutomationContext.CurrentEditorTabChanged += AutomationContext_CurrentEditorTabChanged;
            }
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="inDesignMode">Flag which indicates if the control is being drawn on the Workspace Designer. (Use this flag to determine if code should perform any logic on the workspace record)</param>
        /// <param name="RecordContext">The current workspace record context.</param>
        public WorkspaceAddIn(bool inDesignMode, IRecordContext recordContext, IGlobalContext globalContext, string version)
        {
            // do nothing so framework won't throw exception once it gets to GetControl
            if (!ConfigurationSetting.configVerbPerfect && ConfigurationSetting.loginUserIsAdmin)
            {
                // do nothing
            }
            else
            {
                _gContext = globalContext;
                _recordContext = recordContext;
                bulkImportControl = new OrderManagementControl(new Proxy(this));
                _Model = bulkImportControl._Model;
                _Model.InDesignMode = inDesignMode;
                _Model.Version = version;
                var elementHost = new ElementHost
                {
                    Dock = DockStyle.Fill,
                    Child = bulkImportControl,
                };

                Controls.Add(elementHost);
                if (inDesignMode)
                {
                    return;
                }

                //Get configuration
                ConfigurationSetting instance = ConfigurationSetting.Instance(globalContext);
                _usr = ConfigurationSetting.username;
                _pwd = ConfigurationSetting.password;
                _client = ConfigurationSetting.client;
                _rnSrv = ConfigurationSetting.rnSrv;

                Accelerator.EBS.SharedServices.Order.ServiceProvider = ConfigurationSetting.EBSProvider;
                Accelerator.EBS.SharedServices.Order.GetOrderURL = ConfigurationSetting.GetOrder_WSDL;
                Accelerator.EBS.SharedServices.Order.OrderInboundURL = ConfigurationSetting.OrderInboundURL_WSDL;
                Accelerator.EBS.SharedServices.Order.InitEBSProvider();

                _Model.EbsOwnerId = ConfigurationSetting.ebsDefaultSrOwnerId;

                _recordContext.DataLoaded += _rContext_DataLoaded;
                _recordContext.Closing += _recordContext_Closing;
                _recordContext.Saving += _recordContext_Saving;
                _gContext.AutomationContext.CurrentEditorTabChanged += AutomationContext_CurrentEditorTabChanged;
            }
        }
     // construct the view model
 internal OrderManagementViewModel(Proxy proxy, OrderManagementControl control)
 {
     _Control = control;
     _Proxy = proxy;
     _Filter = String.Empty;
     _FilterUpper = string.Empty;
     _IsExpanded = true;
     _ParentList = new ObservableCollection<SalesOrderViewModel>();
     _FileList = new ListCollectionView(ParentList);
     FileList.Filter = FileList_Filter;
     using (FileList.DeferRefresh())
     {
         _AddSortDescription();
     }
     _LoadedAvailableItems = false;
     _AvailableItems = new ObservableCollection<SalesItemViewModel>();
     _AvailableItemsFiltered = new ListCollectionView(_AvailableItems);
     AvailableItemsFiltered.Filter = AvailableItemsFilter;
     using (AvailableItemsFiltered.DeferRefresh())
     {
         ItemsAddSortDescription();
     }
     ItemsFilter = "";
     _Proxy._InitializedControl(this);
     _DefaultFile = new SalesOrderViewModel(this, 0, string.Empty, string.Empty, string.Empty);
 }