コード例 #1
0
        public StartSerialResponse StartSerial(StartSerialRequest startSerialRequest)
        {
            var response = new StartSerialResponse
            {
                Succeeded = true,
                Error     = string.Empty
            };

            return(response);
        }
コード例 #2
0
        private static StartSerialResponse StartSerial(SerialInfo serial, string user, string passsword, string equipment, string workarea)
        {
            IOTService service = GetOTService();
            var        request = new StartSerialRequest
            {
                Equipment    = equipment,
                Operation    = serial.Operation,
                SerialNumber = serial.SerialNumber,
                Password     = passsword,
                OperationId  = serial.OperationId,
                Order        = serial.Order,
                ProductCode  = serial.ProductCode,
                Status       = serial.Status,
                User         = user
            };

            return(service.StartSerial(request));
        }
コード例 #3
0
        public StartSerialResponse StartSerial(StartSerialRequest startSerialRequest)
        {
            var response = new StartSerialResponse
            {
                Succeeded = true,
                Error     = string.Empty
            };

            if (string.IsNullOrEmpty(startSerialRequest.Equipment) ||
                string.IsNullOrEmpty(startSerialRequest.Operation) ||
                string.IsNullOrEmpty(startSerialRequest.Order) ||
                string.IsNullOrEmpty(startSerialRequest.WorkArea) ||
                string.IsNullOrEmpty(startSerialRequest.ProductCode) ||
                string.IsNullOrEmpty(startSerialRequest.Status) ||
                string.IsNullOrEmpty(startSerialRequest.SerialNumber) ||
                string.IsNullOrEmpty(startSerialRequest.User) ||
                string.IsNullOrEmpty(startSerialRequest.Password) ||
                (startSerialRequest.OperationId == 0))
            {
                response.Succeeded = false;
                response.Error     = "Errore";
            }
            return(response);
        }
コード例 #4
0
ファイル: OTService.svc.cs プロジェクト: MSarbia/DAB-Mestrino
        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);
        }