public DeleteGPSendingResponseDto DeleteGPSendingMasterAndDetails(DeleteGPSendingRequestDto deleteGPSendingRequestDto)
        {
            DeleteGPSendingResponseDto response = new DeleteGPSendingResponseDto();

            try
            {
                response = businessGatePass.DeleteGPSendingMasterAndDetails(deleteGPSendingRequestDto);
                response.ServiceResponseStatus = 1;
            }
            catch (SSException applicationException)
            {
                response = new DeleteGPSendingResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorMessage          = applicationException.Message,
                    ErrorCode             = applicationException.ExceptionCode
                };
            }
            catch (Exception exception)
            {
                response = new DeleteGPSendingResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorCode             = ExceptionAttributes.ExceptionCodes.InternalServerError,
                    ErrorMessage          = exception.Message
                };
            }

            return(response);
        }
示例#2
0
        public DeleteGPSendingResponseDto DeleteGPSendingMasterAndDetails(DeleteGPSendingRequestDto deleteGPSendingRequestDto)
        {
            DeleteGPSendingResponseDto response = new DeleteGPSendingResponseDto();

            var deleteGPSendingDetailsItems = new List <DeleteGPSendingDetailsCM>();

            var deleteGPSendingCM = new DeleteGPSendingCM();

            foreach (var dcItems in deleteGPSendingRequestDto.DeleteGPSendingDetails)
            {
                var deleteDcDetails = new DeleteGPSendingDetailsCM
                {
                    GPNumber        = dcItems.GPNumber,
                    GPSerialNo      = dcItems.GPSerialNo,
                    UpdatedBy       = new Guid("783F190B-9B66-42AC-920B-E938732C1C01"), //Later needs to be remove
                    UpdatedDateTime = System.DateTime.UtcNow
                };

                deleteGPSendingDetailsItems.Add(deleteDcDetails);
            }

            deleteGPSendingCM.GPNumber                 = deleteGPSendingRequestDto.GPNumber;
            deleteGPSendingCM.IsDeleteFrom             = deleteGPSendingRequestDto.IsDeleteFrom;
            deleteGPSendingCM.DeleteGPSendingDetailsCM = deleteGPSendingDetailsItems;

            gatePassRepository.DeleteGPSendingMasterAndDetails(deleteGPSendingCM);

            return(response);
        }