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); }
public void DeleteDcDetails(DeleteDcDetailsCM deleteDcDetailsCM) { using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new DcDeleteCommand { Connection = connection }; command.Execute(deleteDcDetailsCM.dcDetailsListItems.ToDataTableWithNull(), deleteDcDetailsCM.DcNumer, deleteDcDetailsCM.WoNumber, deleteDcDetailsCM.IsDeleteFrom); } }