internal CheckResult(int errorNo, Dictionary <int, string> warningMessage, string gotoUrl, string functionName, int errorAtStep) { c_IsPass = false; c_ErrorNo = errorNo; c_ErrorMessage = ErrorMessageProvider.GetErrorMessage(errorNo); c_WarningMessage = warningMessage; c_GotoUrl = gotoUrl; c_StepName = FunctionStepNameProvider.GetStepName(functionName); c_ErrorAtStep = errorAtStep; }
public CheckMachineConditionResult CheckMachineCondition(MachineInfo machineInfo) { Stopwatch functionTimer = new Stopwatch(); functionTimer.Start(); DatabaseAccess db = new DatabaseAccess(); DatabaseAccessObject dbObject = new DatabaseAccessObject(); int stepCount = 1; Dictionary <int, string> WarningMessage = new Dictionary <int, string>(); if (machineInfo == null) { functionTimer.Stop(); SaveFunctionLog("CheckMachineCondition", functionTimer.ElapsedMilliseconds, DateTime.Now); return(new CheckMachineConditionResult(6, WarningMessage, "www.google.com", stepCount)); } stepCount += 1; if (machineInfo.IsDisable) { functionTimer.Stop(); SaveFunctionLog("CheckMachineCondition", functionTimer.ElapsedMilliseconds, DateTime.Now); return(new CheckMachineConditionResult(7, WarningMessage, "www.google.com", stepCount)); } if (machineInfo.MachineState == null) { functionTimer.Stop(); SaveFunctionLog("CheckMachineCondition", functionTimer.ElapsedMilliseconds, DateTime.Now); return(new CheckMachineConditionResult(25, WarningMessage, "www.google.com", stepCount)); } if (machineInfo.MachineState.OnlineState == 0) { functionTimer.Stop(); SaveFunctionLog("CheckMachineCondition", functionTimer.ElapsedMilliseconds, DateTime.Now); return(new CheckMachineConditionResult(23, WarningMessage, "www.google.com", stepCount)); } if (machineInfo.MachineState.OnlineState == 2) { functionTimer.Stop(); SaveFunctionLog("CheckMachineCondition", functionTimer.ElapsedMilliseconds, DateTime.Now); return(new CheckMachineConditionResult(24, WarningMessage, "www.google.com", stepCount)); } if (machineInfo.MachineState.RunState == 3) { functionTimer.Stop(); SaveFunctionLog("CheckMachineCondition", functionTimer.ElapsedMilliseconds, DateTime.Now); return(new CheckMachineConditionResult(21, WarningMessage, "www.google.com", stepCount)); } stepCount += 1; if (machineInfo.MachineState.QcState == 1) { functionTimer.Stop(); SaveFunctionLog("CheckMachineCondition", functionTimer.ElapsedMilliseconds, DateTime.Now); return(new CheckMachineConditionResult(8, WarningMessage, "www.google.com", stepCount)); } if (machineInfo.MachineState.QcState == 2) { WarningMessage.Add(stepCount, ErrorMessageProvider.GetErrorMessage(9)); } functionTimer.Stop(); SaveFunctionLog("CheckMachineCondition", functionTimer.ElapsedMilliseconds, DateTime.Now); return(new CheckMachineConditionResult(WarningMessage)); }