예제 #1
0
        public UpdateJobCardMaintanceResponseDto UpdateJobCardMaintance(GetJobCardMaintanceResponseDto getJobCardMaintanceResponseDto)
        {
            UpdateJobCardMaintanceResponseDto response = new UpdateJobCardMaintanceResponseDto();

            try
            {
                response = bJobCardProvider.UpdateJobCardMaintance(getJobCardMaintanceResponseDto);
                response.ServiceResponseStatus = 1;
            }
            catch (SSException applicationException)
            {
                response = new UpdateJobCardMaintanceResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorMessage          = applicationException.Message,
                    ErrorCode             = applicationException.ExceptionCode
                };
            }
            catch (Exception exception)
            {
                response = new UpdateJobCardMaintanceResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorCode             = ExceptionAttributes.ExceptionCodes.InternalServerError,
                    ErrorMessage          = exception.Message
                };
            }

            return(response);
        }
        public UpdateJobCardMaintanceResponseDto UpdateJobCardMaintance(GetJobCardMaintanceResponseDto getJobCardMaintanceResponseDto)
        {
            UpdateJobCardMaintanceResponseDto response = new UpdateJobCardMaintanceResponseDto();
            UpdateJobCardMaintanceCM          updateJobCardMaintanceCM   = new UpdateJobCardMaintanceCM();
            GetJobCardMaintanceDetails        getJobCardMaintanceDetails = new GetJobCardMaintanceDetails();
            UpdateJobCardDetails updateJobCardDetails = new UpdateJobCardDetails();
            var updateJobCardDetailsList = new List <UpdateJobCardDetails>();

            #region Update JobCard Master

            foreach (var master in getJobCardMaintanceResponseDto.GetJobCardMaintanceResponseList)
            {
                updateJobCardMaintanceCM.PartCode          = master.PartCode;
                updateJobCardMaintanceCM.SequenceNumber    = master.SequenceNumber;
                updateJobCardMaintanceCM.SerialNo          = master.SerialNo;
                updateJobCardMaintanceCM.ActualRunningTime = master.ActualRunningTime;
                updateJobCardMaintanceCM.ActualSettingTime = master.ActualSettingTime;
                updateJobCardMaintanceCM.OperationDate     = master.OperationDate;
                updateJobCardMaintanceCM.Shift             = master.Shift;
                updateJobCardMaintanceCM.EmployeeCode      = master.EmployeeCode;

                foreach (var details in master.getJobCardMaintanceDetails)
                {
                    updateJobCardDetails = new UpdateJobCardDetails
                    {
                        SerialNo             = details.SerialNo,
                        PartCode             = details.PartCode,
                        SequenceNumber       = details.SequenceNumber,
                        Serial               = details.Serial,
                        DimensionActual      = details.DimensionActual,
                        DatumDimensionActual = details.DatumDimesionActual,
                        UpdatedBy            = new Guid("783F190B-9B66-42AC-920B-E938732C1C01"), //Later needs to be remove,
                        UpdatedDateTime      = System.DateTime.UtcNow
                    };

                    updateJobCardDetailsList.Add(updateJobCardDetails);
                }
                ;
            }
            ;

            updateJobCardMaintanceCM.GetUpdateJobCardDetails = updateJobCardDetailsList;

            jobCardGenerationRepository.UpdateJobCardMaintance(updateJobCardMaintanceCM);

            #endregion

            #region Update JobCard Details

            #endregion

            return(response);
        }