public AcceptTeamLeaderCallResponse AcceptTeamLeaderCall(AcceptTeamLeaderCallRequest acceptTeamLeaderCall) { var response = new AcceptTeamLeaderCallResponse { Succeeded = true, Error = string.Empty }; UAFConnector uafConnector = null; try { uafConnector = new UAFConnector(acceptTeamLeaderCall.User, acceptTeamLeaderCall.Password); } catch (Exception e) { response.Succeeded = false; response.Error = e.Message; return(response); } var uafResponse = uafConnector.CallCommand <DABAcceptTeamLeaderCall, DABAcceptTeamLeaderCall.Response>(new DABAcceptTeamLeaderCall { Id = acceptTeamLeaderCall.CallId, TeamLeader = acceptTeamLeaderCall.User }); if (!uafResponse.Succeeded) { response.Succeeded = false; response.Error = $"Errore {uafResponse.Error.ErrorCode}: {uafResponse.Error.ErrorMessage}"; return(response); } CallHub.Static_TeamLeaderCallAccepted(acceptTeamLeaderCall.Equipment, acceptTeamLeaderCall.CallId.ToString()); //SmartWatchConnector.TeamLeaderComing(acceptTeamLeaderCall.Equipment); return(response); }
public SendMaterialCallResponse SendMaterialCall(SendMaterialCallRequest materialCall) { var response = new SendMaterialCallResponse { Succeeded = true, Error = string.Empty }; UAFConnector uafConnector = null; try { uafConnector = new UAFConnector(materialCall.User, materialCall.Password); } catch (Exception e) { response.Succeeded = false; response.Error = e.Message; return(response); } var uafResponse = uafConnector.CallCommand <DABCreateMaterialCall, DABCreateMaterialCall.Response>(new DABCreateMaterialCall { Equipment = materialCall.Equipment, WorkArea = materialCall.WorkArea, Operatore = materialCall.User, MaterialDefinition = string.Empty, Operation = " ", WorkOrder = " " }); if (!uafResponse.Succeeded) { response.Succeeded = false; response.Error = $"Errore {uafResponse.Error.ErrorCode}: {uafResponse.Error.ErrorMessage}"; return(response); } response.Id = uafResponse.Id.Value; //SmartWatchConnector.SendMaterialCall(materialCall.WorkArea, materialCall.Equipment, materialCall.SerialNumber, uafResponse.Id.Value); CallHub.Static_SendMaterialCall(materialCall.WorkArea, materialCall.Equipment); return(response); }
public SendTeamLeaderCallResponse SendTeamLeaderCall(SendTeamLeaderCallRequest teamLeaderCall) { var response = new SendTeamLeaderCallResponse { Succeeded = true, Error = string.Empty }; UAFConnector uafConnector = null; try { uafConnector = new UAFConnector(teamLeaderCall.User, teamLeaderCall.Password); } catch (Exception e) { response.Succeeded = false; response.Error = e.Message; return(response); } var uafResponse = uafConnector.CallCommand <DABCreateTeamLeaderCall, DABCreateTeamLeaderCall.Response>(new DABCreateTeamLeaderCall { Equipment = teamLeaderCall.Equipment, WorkArea = teamLeaderCall.WorkArea, Operatore = teamLeaderCall.User }); if (!uafResponse.Succeeded) { response.Succeeded = false; response.Error = $"Errore {uafResponse.Error.ErrorCode}: {uafResponse.Error.ErrorMessage}"; return(response); } response.Id = uafResponse.Id.Value; //SmartWatchConnector.SendTeamLeaderlCall(teamLeaderCall.WorkArea, teamLeaderCall.Equipment, uafResponse.Id.Value); CallHub.Static_SendTeamLeaderCall(teamLeaderCall.WorkArea, teamLeaderCall.Equipment); return(response); }
public void RefreshSerials(string workArea) { CallHub.Static_SendOperatorCall(workArea, workArea); //SmartWatchConnector.RefreshSerials(workArea); }
public StartSerialResponse StartSerial(StartSerialRequest startSerialRequest) { var response = new StartSerialResponse { Succeeded = true, Error = string.Empty }; UAFConnector uafConnector = null; try { uafConnector = new UAFConnector(startSerialRequest.User, startSerialRequest.Password); } catch (Exception e) { response.Succeeded = false; response.Error = e.Message; return(response); } if (startSerialRequest.Status == "Active") { var uafResponse = uafConnector.CallCommand <DABCompleteSerial, DABCompleteSerial.Response>(new DABCompleteSerial { //EquipmentNId = startSerialRequest.Equipment, //MaterialDefinitionNId = startSerialRequest.ProductCode, //SerialNumber = startSerialRequest.SerialNumber, //WorkOrderOperationNId = startSerialRequest.Operation CompleteSerializedWoOpParameterList = new List <CompleteSerializedParameterType> { new CompleteSerializedParameterType { EquipmentNId = startSerialRequest.Equipment, NId = startSerialRequest.Operation, Id = startSerialRequest.OperationId, ActualProducedMaterials = new List <MaterialItemParameterType> { new MaterialItemParameterType { EquipmentNId = startSerialRequest.Equipment, MaterialDefinitionNId = startSerialRequest.ProductCode, SerialNumber = startSerialRequest.SerialNumber, NId = startSerialRequest.SerialNumber } } } } }); if (!uafResponse.Succeeded) { response.Succeeded = false; response.Error = $"Errore {uafResponse.Error.ErrorCode}: {uafResponse.Error.ErrorMessage}"; return(response); } } else { var uafResponse = uafConnector.CallCommand <DABStartSerial, DABStartSerial.Response>(new DABStartSerial { //EquipmentNId = startSerialRequest.Equipment, //MaterialDefinitionNId = startSerialRequest.ProductCode, //SerialNumber = startSerialRequest.SerialNumber, //WorkOrderOperationNId = startSerialRequest.Operation StartWOOperationSerializedParameterTypeList = new List <StartSerializedParameterType> { new StartSerializedParameterType { EquipmentNId = startSerialRequest.Equipment, NId = startSerialRequest.Operation, Id = startSerialRequest.OperationId, //EquipmentName = startSerialRequest.Equipment, ToBeProducedMaterials = new List <MaterialItemParameterType> { new MaterialItemParameterType { EquipmentNId = startSerialRequest.Equipment, MaterialDefinitionNId = startSerialRequest.ProductCode, SerialNumber = startSerialRequest.SerialNumber, NId = startSerialRequest.SerialNumber } } } } }); if (!uafResponse.Succeeded) { response.Succeeded = false; response.Error = $"Errore {uafResponse.Error.ErrorCode}: {uafResponse.Error.ErrorMessage}"; return(response); } } if (response.Succeeded == true) { CallHub.Static_SendOperatorCall(startSerialRequest.WorkArea, startSerialRequest.SerialNumber); //SmartWatchConnector.RefreshSerials(startSerialRequest.WorkArea); } return(response); }
private void dependency_OnChange(object sender, SqlNotificationEventArgs e) { CallHub.Show(); }