Esempio n. 1
0
        public DeleteScSendingResponseDto DeleteScSendingDetails(DeleteScSendingRequestDto deleteScSendingRequestDto)
        {
            DeleteScSendingResponseDto response = new DeleteScSendingResponseDto();
            var deleteDcDetailsItems            = new List <DeleteScDetailsItems>();

            var deleteScResponse = new DeleteScDetailsCM();

            foreach (var dcItems in deleteScSendingRequestDto.ScSendingDetailsList)
            {
                var deleteDcDetails = new DeleteScDetailsItems
                {
                    WoNumber        = dcItems.WoNumber,
                    SerialNo        = dcItems.SerialNo,
                    WoSerial        = dcItems.WoSerial,
                    UpdatedBy       = new Guid("783F190B-9B66-42AC-920B-E938732C1C01"), //Later needs to be remove
                    UpdatedDateTime = System.DateTime.UtcNow
                };

                deleteDcDetailsItems.Add(deleteDcDetails);
            }

            deleteScResponse.ScNumer            = deleteScSendingRequestDto.ScDcNumer;
            deleteScResponse.WoNumber           = deleteScSendingRequestDto.WoNumber;
            deleteScResponse.IsDeleteFrom       = deleteScSendingRequestDto.IsDeleteFrom;
            deleteScResponse.scDetailsListItems = deleteDcDetailsItems;

            subContractRepository.DeleteScSendingDetails(deleteScResponse);

            return(response);
        }
        public DeleteScSendingResponseDto DeleteScSendingDetails(DeleteScSendingRequestDto deleteScSendingRequestDto)
        {
            DeleteScSendingResponseDto response = new DeleteScSendingResponseDto();

            try
            {
                response = bSubContractProvider.DeleteScSendingDetails(deleteScSendingRequestDto);
                response.ServiceResponseStatus = 1;
            }
            catch (SSException applicationException)
            {
                response = new DeleteScSendingResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorMessage          = applicationException.Message,
                    ErrorCode             = applicationException.ExceptionCode
                };
            }
            catch (Exception exception)
            {
                response = new DeleteScSendingResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorCode             = ExceptionAttributes.ExceptionCodes.InternalServerError,
                    ErrorMessage          = exception.Message
                };
            }

            return(response);
        }