public UpdateCaseMessage(String caseId, CaseUpdateEnum type, CaseType caseType) { m_CaseId = caseId; m_Type = type; m_CaseType = caseType; m_Filename = String.Empty; m_File = new MemoryStream(); m_AttachFileType = AttachFileTypeEnum.Unknown; m_ObjectId = String.Empty; m_WorkstationResult = null; m_UserName = String.Empty; m_CreateTime = CreateTime; }
private void Tab1DecisionButton_Click(object sender, RoutedEventArgs e) { WorkstationResult awsResult = new WorkstationResult(); awsResult.Comment = Tab1CommentTextBox.Text; if (Tab1DecisionComboBox.SelectedItem.ToString().Contains("Clear")) { awsResult.Decision = WorkstationDecision.Clear; } else if (Tab1DecisionComboBox.SelectedItem.ToString().Contains("Reject")) { awsResult.Decision = WorkstationDecision.Reject; } else if (Tab1DecisionComboBox.SelectedItem.ToString().Contains("Unknown")) { awsResult.Decision = WorkstationDecision.Unknown; } else { awsResult.Decision = WorkstationDecision.Caution; } if (Tab1ReasonComboBox.SelectedItem.ToString().Contains("Not Applicable")) { awsResult.Reason = WorkstationReason.NotApplicable; } else if (Tab1ReasonComboBox.SelectedItem.ToString().Contains("Too Complex")) { awsResult.Reason = WorkstationReason.TooComplex; } else if (Tab1ReasonComboBox.SelectedItem.ToString().Contains("Too Dense")) { awsResult.Reason = WorkstationReason.TooDense; } else { awsResult.Reason = WorkstationReason.AnomalyIdentified; } awsResult.UserName = Tab1UsernameTextBox.Text; awsResult.WorkstationId = m_AWSId; awsResult.CaseId = m_ActiveCase; try { //m_AWSCommEndPoint1.Decision(awsResult); Tab1LogListBox.Items.Add("Result: Successed"); } catch (Exception ex) { Tab1LogListBox.Items.Add("Result: Failed | ErrorMessage: " + ex.Message); } }
public virtual void TipResult (string tipFile, WorkstationResult workstationResult) { throw new NotImplementedException(ErrorMessages.INVALID_FUNCTION); }
public void TipResult(WorkstationResult workstationResult) { if (workstationResult.CaseType == L3.Cargo.Communications.Interfaces.CaseType.FTICase) { string fileName = FindFileByAssignment(workstationResult.WorkstationId); if (!String.IsNullOrWhiteSpace(fileName)) { m_EndPoint.TipResult(fileName.Remove(fileName.Length - 4), workstationResult); DeleteFTIFile(fileName); } } else if (workstationResult.CaseType == L3.Cargo.Communications.Interfaces.CaseType.CTICase) { string caseId = FindCaseByAssignment(workstationResult.WorkstationId); if (!String.IsNullOrWhiteSpace(caseId)) { string fileName = GetPXEFromCase(caseId); if (!String.IsNullOrWhiteSpace(fileName)) { m_EndPoint.TipResult(fileName.Remove(fileName.Length - 4), workstationResult); } DeleteCTICase(caseId); } } }
public override void UpdateCase(UpdateCaseMessage message) { if (caseList.AssignedId(message.CaseId) == message.WorkstationId) { if (message.Type == CaseUpdateEnum.ReleaseCase) { try { m_CargoHostEndPoint.ReleaseCase(message.CaseId); SetLoadBalancecaseRequestedCurrently(message.WorkstationId, false); if (m_TIPManagerComm != null) { m_TIPManagerComm.ProcessedCase(message.CaseId); } } catch (Exception exp) { throw new FaultException(new FaultReason(exp.Message)); } } else if (message.Type == CaseUpdateEnum.CloseCase && message.CaseType != L3.Cargo.Communications.Interfaces.CaseType.FTICase) { lock (_updateCaseAssignmentLock) { base.ClearAssignment(message.CaseId); CaseListUpdateEvent(message.CaseId, string.Empty, string.Empty, true); if (message.CaseType == L3.Cargo.Communications.Interfaces.CaseType.CTICase) { m_TIPManagerComm.RemoveCTICaseAssignment(message.CaseId); CaseListUpdateEvent(message.CaseId, String.Empty, String.Empty, false); base.caseList.Delete(message.CaseId); } } } else if (message.Type == CaseUpdateEnum.CloseCase && message.CaseType == L3.Cargo.Communications.Interfaces.CaseType.FTICase) { WorkstationResult result = new WorkstationResult(); TimeSpan analysisTime = DateTime.Now.Subtract(DateTime.Parse(message.CreateTime)); result.AnalysisTime = (uint)analysisTime.TotalSeconds; result.CaseId = message.CaseId; result.CaseType = message.CaseType; result.Comment = string.Empty; result.CreateTime = message.CreateTime; result.Decision = WorkstationDecision.Unknown; result.Reason = WorkstationReason.NotApplicable; result.UserName = message.UserName; result.WorkstationId = message.WorkstationId; m_TIPManagerComm.TipResult(result); } else if (message.Type == CaseUpdateEnum.Result) { try { if (message.CaseType == L3.Cargo.Communications.Interfaces.CaseType.CTICase || message.CaseType == L3.Cargo.Communications.Interfaces.CaseType.FTICase) { if (message.workstationResult.CaseType == L3.Cargo.Communications.Interfaces.CaseType.CTICase) { lock (_updateCaseAssignmentLock) { CaseListUpdateEvent(message.CaseId, String.Empty, String.Empty, false); base.caseList.Delete(message.CaseId); } } m_TIPManagerComm.TipResult(message.workstationResult); } else { l3.cargo.corba.Result result = new l3.cargo.corba.Result(); result.mAnalysisTime = message.workstationResult.AnalysisTime.ToString(); result.mComment = message.workstationResult.Comment; result.mCreateTime = message.workstationResult.CreateTime; if (message.workstationResult.Decision == WorkstationDecision.Unknown) result.mDecision = l3.cargo.corba.ResultDecision.RESULT_UNKNOWN; else if (message.workstationResult.Decision == WorkstationDecision.Reject) result.mDecision = l3.cargo.corba.ResultDecision.REJECT; else if (message.workstationResult.Decision == WorkstationDecision.Clear) result.mDecision = l3.cargo.corba.ResultDecision.CLEAR; else result.mDecision = l3.cargo.corba.ResultDecision.CAUTION; result.mReason = message.workstationResult.Reason.ToString(); result.mStationType = message.workstationResult.WorkstationType; result.mUserName = message.workstationResult.UserName; m_CargoHostEndPoint.SetResult(message.CaseId, result); } } catch (Exception exp) { throw new FaultException(new FaultReason(exp.Message)); } } else if (message.CaseType == L3.Cargo.Communications.Interfaces.CaseType.FTICase || message.CaseType == L3.Cargo.Communications.Interfaces.CaseType.CTICase) { //Do Nothing } else if (message.Type == CaseUpdateEnum.AttachFile) { String TempDirectory = ConfigurationManager.AppSettings["hostTempDirectory"]; try { if (!Directory.Exists(TempDirectory)) { Directory.CreateDirectory(TempDirectory); } using (FileStream stream = new FileStream(Path.Combine(TempDirectory, message.Filename), FileMode.OpenOrCreate)) { message.File.CopyTo(stream); } m_CargoHostEndPoint.AddAttachment(message.CaseId, Path.Combine(TempDirectory, message.Filename), message.AttachFileType.ToString(), message.UserName, message.CreateTime); } catch (Exception exp) { throw new FaultException(new FaultReason(exp.Message)); } } else if (message.Type == CaseUpdateEnum.ObjectID) { try { m_CargoHostEndPoint.SetContainerID(message.CaseId, message.ObjectId); } catch (Exception exp) { throw new FaultException(new FaultReason(exp.Message)); } } } }
public void UpdateCase(String sourceAlias, String caseId, CaseUpdateEnum type, String filename, Stream file, AttachFileTypeEnum attachFileType, WorkstationResult result, String ContainerNum, String UserName, String CreateTime, L3.Cargo.Communications.Interfaces.CaseType caseType) { m_CaseSourceManager.UpdateCase(sourceAlias, caseId, type, filename, file, attachFileType, result, ContainerNum, UserName, CreateTime, caseType); }
public void TipResult(WorkstationResult workstationResult) { TIPClient tipClient = FindClientByWorkstationId(workstationResult.WorkstationId); try { if (tipClient != null) { tipClient.TipResult(workstationResult); } } catch (Exception) { tipClient.Dispose(); m_TIPManagers.Remove(tipClient); } }