// construct the file internal ImportFile(BulkImportViewModel model, int fileId, string name, string title, string description) { _Model = model; _Proxy = _Model._Proxy; _MaxPreview = _Model.MaxPreview; _Description = string.IsNullOrWhiteSpace(description) ? string.Empty : description; if (!string.IsNullOrEmpty(_Description)) { if (_Description.Contains("{70}")) { _PreviousStatus = JobStatus.AllDone; _Description = _Description.Replace("{70}", ""); } if (_Description.Contains("{75}")) { _PreviousStatus = JobStatus.AllDoneError; _Description = _Description.Replace("{75}", ""); } } _Name = name; Title = title; _TitleUpper = Title.ToUpperInvariant(); _FileId = fileId; _ProgressPercent = 0; _IsShowAllEnabled = false; _ShowAll = false; _RepairOrders = new ObservableCollection <RepairOrder>(); _LoadedAll = false; _JobStatus = JobStatus.Load; _IsImportEnabled = false; _Status = String.Empty + _JobStatus; _LongStatus = _Status; _Stopwatch = new Stopwatch(); _ProgressTimer = new Stopwatch(); }
// construct the file internal ImportFile(BulkImportViewModel model, int fileId, string name, string title, string description) { _Model = model; _Proxy = _Model._Proxy; _MaxPreview = _Model.MaxPreview; _Description = string.IsNullOrWhiteSpace(description) ? string.Empty : description; if (!string.IsNullOrEmpty(_Description)) { if (_Description.Contains("{70}")) { _PreviousStatus = JobStatus.AllDone; _Description = _Description.Replace("{70}", ""); } if (_Description.Contains("{75}")) { _PreviousStatus = JobStatus.AllDoneError; _Description = _Description.Replace("{75}", ""); } } _Name = name; Title = title; _TitleUpper = Title.ToUpperInvariant(); _FileId = fileId; _ProgressPercent = 0; _IsShowAllEnabled = false; _ShowAll = false; _RepairOrders = new ObservableCollection<RepairOrder>(); _LoadedAll = false; _JobStatus = JobStatus.Load; _IsImportEnabled = false; _Status = String.Empty + _JobStatus; _LongStatus = _Status; _Stopwatch = new Stopwatch(); _ProgressTimer = new Stopwatch(); }
/// <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; } }
// initialize control private void InitializeControl(Proxy proxy) { _Model = new BulkImportViewModel(proxy, this); _DefaultFile = new ImportFile(_Model, 0, string.Empty, string.Empty, string.Empty); _LastSelectionTime = new Stopwatch(); _LastSelectionTime.Restart(); _PreviousIndex = -1; _PreviousFile = _DefaultFile; this.Loaded += MainWindow_Loaded; }
internal void _InitializedControl(BulkImportViewModel bulkImportViewModel) { _Model = bulkImportViewModel; }