| | | 1 | | using System; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using System.ComponentModel.DataAnnotations; |
| | | 4 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 5 | | using System.Linq; |
| | | 6 | | using System.Numerics; |
| | | 7 | | using System.Text; |
| | | 8 | | using System.Threading.Tasks; |
| | | 9 | | |
| | | 10 | | namespace OzonDomains.Models |
| | | 11 | | { |
| | | 12 | | public class Transaction : ITransaction |
| | | 13 | | { |
| | 271 | 14 | | public int Id { get; set; } |
| | | 15 | | |
| | | 16 | | [Display(Name = "Тип транзакции")] |
| | 167 | 17 | | public TransactionType? Type { get; set; } |
| | | 18 | | |
| | | 19 | | [Display(Name = "Список заказав в транзакции")] |
| | 204 | 20 | | public virtual ICollection<Order> Orders { get; set; } = new List<Order>(); |
| | | 21 | | |
| | | 22 | | |
| | | 23 | | [Display(Name = "Пользователь провевший транзакцию")] |
| | | 24 | | [MaxLength(50)] |
| | 159 | 25 | | public string? CreateBy { get; set; } |
| | | 26 | | |
| | | 27 | | [Display(Name = "Дата создания транзакции")] |
| | 260 | 28 | | public DateTime? CreatedDateTime { get; set; } |
| | | 29 | | public string FormattedCreatedDate |
| | | 30 | | { |
| | 35 | 31 | | get { return OrderDateDisplay.FormatTableDate(CreatedDateTime); } |
| | | 32 | | } |
| | | 33 | | |
| | | 34 | | public string FormattedCreatedTime |
| | | 35 | | { |
| | | 36 | | get |
| | | 37 | | { |
| | 35 | 38 | | return CreatedDateTime.HasValue ? $"{CreatedDateTime.Value.ToString("HH:mm:ss")}" : ""; |
| | | 39 | | } |
| | | 40 | | } |
| | | 41 | | |
| | | 42 | | [NotMapped] |
| | | 43 | | public string FormattedCreatedTimeDateTime |
| | | 44 | | { |
| | | 45 | | get |
| | | 46 | | { |
| | 0 | 47 | | return CreatedDateTime.HasValue ? $"{CreatedDateTime.Value.ToString("dd.MM.yyyy HH:mm")}" : ""; |
| | | 48 | | } |
| | | 49 | | } |
| | | 50 | | |
| | | 51 | | [Display(Name = "Комментарий")] |
| | | 52 | | [Column(TypeName = "longtext")] |
| | 150 | 53 | | public string? Comment { get; set; } |
| | | 54 | | } |
| | | 55 | | } |