/// <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 BulkImportAddin(bool inDesignMode, IRecordContext recordContext, IGlobalContext globalContext) { // 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 BulkImportControl(new Proxy(this)); _Model = bulkImportControl._Model; _Model.InDesignMode = inDesignMode; 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.Contact.ServiceProvider = ConfigurationSetting.EBSProvider; Accelerator.EBS.SharedServices.Contact.ListLookupURL = ConfigurationSetting.LookupContactList_WSDL; Accelerator.EBS.SharedServices.Contact.ServiceUsername = String.IsNullOrEmpty(_usr) ? "ebusiness" : _usr; Accelerator.EBS.SharedServices.Contact.ServicePassword = String.IsNullOrEmpty(_pwd) ? "password" : _pwd; Accelerator.EBS.SharedServices.Contact.InitEBSProvider(); Accelerator.EBS.SharedServices.RepairOrder.ServiceProvider = ConfigurationSetting.EBSProvider; Accelerator.EBS.SharedServices.RepairOrder.ListLookupURL = ConfigurationSetting.LookupRepairList_WSDL; Accelerator.EBS.SharedServices.RepairOrder.ListURL = ConfigurationSetting.RepairOrderList_WSDL; Accelerator.EBS.SharedServices.RepairOrder.LookupURL = ConfigurationSetting.LookupRepair_WSDL; Accelerator.EBS.SharedServices.RepairOrder.CreateURL = ConfigurationSetting.CreateRepair_WSDL; Accelerator.EBS.SharedServices.RepairOrder.UpdateURL = ConfigurationSetting.UpdateRepair_WSDL; Accelerator.EBS.SharedServices.RepairOrder.ServiceUsername = ConfigurationSetting.username; Accelerator.EBS.SharedServices.RepairOrder.ServicePassword = ConfigurationSetting.password; Accelerator.EBS.SharedServices.RepairOrder.ServiceClientTimeout = ConfigurationSetting.EBSServiceTimeout; Accelerator.EBS.SharedServices.RepairOrder.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 BulkImportAddin(bool inDesignMode, IRecordContext recordContext, IGlobalContext globalContext) { // 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 BulkImportControl(new Proxy(this)); _Model = bulkImportControl._Model; _Model.InDesignMode = inDesignMode; 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.ContactModel.ServiceProvider = ConfigurationSetting.EBSProvider; Accelerator.EBS.SharedServices.ContactModel.ListLookupURL = ConfigurationSetting.LookupContactList_WSDL; Accelerator.EBS.SharedServices.ContactModel.ServiceUsername = String.IsNullOrEmpty(_usr) ? "ebusiness" : _usr; Accelerator.EBS.SharedServices.ContactModel.ServicePassword = String.IsNullOrEmpty(_pwd) ? "password" : _pwd; Accelerator.EBS.SharedServices.ContactModel.InitEBSProvider(); Accelerator.EBS.SharedServices.RepairOrder.ServiceProvider = ConfigurationSetting.EBSProvider; Accelerator.EBS.SharedServices.RepairOrder.ListLookupURL = ConfigurationSetting.LookupRepairList_WSDL; Accelerator.EBS.SharedServices.RepairOrder.ListURL = ConfigurationSetting.RepairOrderList_WSDL; Accelerator.EBS.SharedServices.RepairOrder.LookupURL = ConfigurationSetting.LookupRepair_WSDL; Accelerator.EBS.SharedServices.RepairOrder.CreateURL = ConfigurationSetting.CreateRepair_WSDL; Accelerator.EBS.SharedServices.RepairOrder.UpdateURL = ConfigurationSetting.UpdateRepair_WSDL; Accelerator.EBS.SharedServices.RepairOrder.ServiceUsername = ConfigurationSetting.username; Accelerator.EBS.SharedServices.RepairOrder.ServicePassword = ConfigurationSetting.password; Accelerator.EBS.SharedServices.RepairOrder.ServiceClientTimeout = ConfigurationSetting.EBSServiceTimeout; Accelerator.EBS.SharedServices.RepairOrder.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 BulkImportViewModel(Proxy proxy, BulkImportControl control) { _Control = control; _Proxy = proxy; _Filter = String.Empty; _FilterUpper = string.Empty; _IsExpanded = true; _ImportFileList = new ObservableCollection <ImportFile>(); _FileList = new ListCollectionView(ImportFileList); FileList.Filter = FileList_Filter; using (FileList.DeferRefresh()) { _AddSortDescription(); } _Proxy._InitializedControl(this); }
// construct the view model internal BulkImportViewModel(Proxy proxy, BulkImportControl control) { _Control = control; _Proxy = proxy; _Filter = String.Empty; _FilterUpper = string.Empty; _IsExpanded = true; _ImportFileList = new ObservableCollection<ImportFile>(); _FileList = new ListCollectionView(ImportFileList); FileList.Filter = FileList_Filter; using (FileList.DeferRefresh()) { _AddSortDescription(); } _Proxy._InitializedControl(this); }