public DeleteDcResponseDto DeleteDcDetails(DeleteDcRequestDto deleteDcRequestDto) { DeleteDcResponseDto response = new DeleteDcResponseDto(); try { response = bDeliveryChallanProvider.DeleteDcDetails(deleteDcRequestDto); response.ServiceResponseStatus = 1; } catch (SSException applicationException) { response = new DeleteDcResponseDto { ServiceResponseStatus = 0, ErrorMessage = applicationException.Message, ErrorCode = applicationException.ExceptionCode }; } catch (Exception exception) { response = new DeleteDcResponseDto { ServiceResponseStatus = 0, ErrorCode = ExceptionAttributes.ExceptionCodes.InternalServerError, ErrorMessage = exception.Message }; } return(response); }
public DeleteDcResponseDto DeleteDcDetails(DeleteDcRequestDto deleteDcRequestDto) { DeleteDcResponseDto response = new DeleteDcResponseDto(); var deleteDcDetailsItems = new List <DeleteDcDetailsItems>(); var deleteDcResponse = new DeleteDcDetailsCM(); foreach (var dcItems in deleteDcRequestDto.DcDetailsList) { var deleteDcDetails = new DeleteDcDetailsItems { 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); } deleteDcResponse.DcNumer = deleteDcRequestDto.DcNumer; deleteDcResponse.WoNumber = deleteDcRequestDto.WoNumber; deleteDcResponse.IsDeleteFrom = deleteDcRequestDto.IsDeleteFrom; deleteDcResponse.dcDetailsListItems = deleteDcDetailsItems; deliveryChallanRepository.DeleteDcDetails(deleteDcResponse); return(response); }