|
9 | 9 | using EstateManagement.DataTransferObjects; |
10 | 10 | using EstateManagement.DataTransferObjects.Requests; |
11 | 11 | using EstateManagement.DataTransferObjects.Responses; |
| 12 | +using Microsoft.VisualBasic; |
12 | 13 | using Newtonsoft.Json; |
13 | 14 | using SecurityService.Client; |
14 | 15 | using SecurityService.DataTransferObjects.Responses; |
@@ -694,12 +695,20 @@ private ProductType GetProductType(String operatorName){ |
694 | 695 | } |
695 | 696 |
|
696 | 697 | private DateTime GetTransactionDateTime(DateTime dateTime){ |
697 | | - // Generate the time |
698 | | - Int32 hours = this.r.Next(0, 23); |
699 | | - Int32 minutes = this.r.Next(0, 59); |
700 | | - Int32 seconds = this.r.Next(0, 59); |
701 | 698 |
|
702 | | - return dateTime.AddHours(hours).AddMinutes(minutes).AddSeconds(seconds); |
| 699 | + if (dateTime.Hour != 0 && dateTime.Minute != 0 && dateTime.Second != 0){ |
| 700 | + // Already have a time only change the seconds |
| 701 | + Int32 seconds = this.r.Next(0, 59); |
| 702 | + return dateTime.AddSeconds(seconds); |
| 703 | + } |
| 704 | + else{ |
| 705 | + // Generate the time |
| 706 | + Int32 hours = this.r.Next(0, 23); |
| 707 | + Int32 minutes = this.r.Next(0, 59); |
| 708 | + Int32 seconds = this.r.Next(0, 59); |
| 709 | + |
| 710 | + return dateTime.AddHours(hours).AddMinutes(minutes).AddSeconds(seconds); |
| 711 | + } |
703 | 712 | } |
704 | 713 | private Int32 GetTransactionNumber(){ |
705 | 714 | this.TransactionNumber++; |
|
0 commit comments