| | | 1 | | using System; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using System.Diagnostics.Eventing.Reader; |
| | | 4 | | using System.Linq; |
| | | 5 | | using System.Threading.Tasks; |
| | | 6 | | using SVETA.Api.Helpers; |
| | | 7 | | using WinSolutions.Sveta.Server.Data.DataModel.Kinds; |
| | | 8 | | |
| | | 9 | | namespace SVETA.Api.Data.Domain |
| | | 10 | | { |
| | | 11 | | public class MovementParam |
| | | 12 | | { |
| | | 13 | | /// <summary> |
| | | 14 | | /// Идентификтор документа |
| | | 15 | | /// </summary> |
| | 0 | 16 | | public long Id { get; set; } |
| | | 17 | | /// <summary> |
| | | 18 | | /// Идентификатор заказчика - контрагент |
| | | 19 | | /// </summary> |
| | 3 | 20 | | public long CustomerId { get; set; } |
| | | 21 | | /// <summary> |
| | | 22 | | /// Идентификатор получателя - департамент |
| | | 23 | | /// </summary> |
| | 0 | 24 | | public long ReceiverId { get; set; } |
| | | 25 | | /// <summary> |
| | | 26 | | /// Идентификатор поставщика - контрагент |
| | | 27 | | /// </summary> |
| | 0 | 28 | | public long SupplierId { get; set; } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Идентификатор склада |
| | | 32 | | /// </summary> |
| | 0 | 33 | | public long SenderId { get; set; } |
| | | 34 | | /// <summary> |
| | | 35 | | /// Дата начала отборки |
| | | 36 | | /// </summary> |
| | 0 | 37 | | public DateTime FromDate { get; set; } |
| | | 38 | | /// <summary> |
| | | 39 | | /// Дата окончания отборки |
| | | 40 | | /// </summary> |
| | 0 | 41 | | public DateTime ToDate { get; set; } |
| | | 42 | | /// <summary> |
| | | 43 | | /// Тип документов для отбора |
| | | 44 | | /// </summary> |
| | 8 | 45 | | public MovementKind Kind { get; set; } |
| | | 46 | | /// <summary> |
| | | 47 | | /// Состояние записей документов для отборки |
| | | 48 | | /// </summary> |
| | 0 | 49 | | public long StateId { get; set; } |
| | | 50 | | /// <summary> |
| | | 51 | | /// Статус документа для отборки |
| | | 52 | | /// </summary> |
| | 7 | 53 | | public long StatusId { get; set; } |
| | | 54 | | /// <summary> |
| | | 55 | | /// текущая страница отборки |
| | | 56 | | /// </summary> |
| | 0 | 57 | | public int Page { get; set; } |
| | | 58 | | /// <summary> |
| | | 59 | | /// Лимит отборки 1 -100 |
| | | 60 | | /// </summary> |
| | 6 | 61 | | public int Limit { get; set; } |
| | | 62 | | /// <summary> |
| | | 63 | | /// Тип сортировки умолчанию по id - id|desc,created_on,created_on|desc,state,state|desc,status,status|desc,cust |
| | | 64 | | /// </summary> |
| | 0 | 65 | | public string Sort { get; set; } |
| | | 66 | | /// <summary> |
| | | 67 | | /// Номер документа |
| | | 68 | | /// </summary> |
| | 0 | 69 | | public string DocumentNumber { get; set; } |
| | | 70 | | /// <summary> |
| | | 71 | | /// Статусы недоступные для пользователя |
| | | 72 | | /// </summary> |
| | 4 | 73 | | public long[] ExcludedStatuses { get; set; } |
| | | 74 | | |
| | | 75 | | /// <summary> |
| | | 76 | | /// Поиск контрагента покупателя |
| | | 77 | | /// </summary> |
| | 3 | 78 | | public string СontragentBuyerFilter { get; set; } |
| | | 79 | | |
| | | 80 | | /// <summary> |
| | | 81 | | /// Показывать анонимные заявки |
| | | 82 | | /// </summary> |
| | 4 | 83 | | public string ShowAnonym { get; set; } |
| | | 84 | | |
| | | 85 | | /// <summary> |
| | | 86 | | /// Выгрузка результата в excel |
| | | 87 | | /// </summary> |
| | 0 | 88 | | public bool GenerateExcel { get; set; } |
| | | 89 | | |
| | 6 | 90 | | public MovementParam() { } |
| | | 91 | | |
| | 0 | 92 | | public MovementParam(long id, long customerId, long receiverId, long supplierId, long senderId, DateTime fromDat |
| | 0 | 93 | | long stateId, long statusId, string documentNumber, int page, int limit, string sort, string contragentBuyer |
| | 0 | 94 | | string showAnonym = "nonanonymous", bool generateExcel = false) |
| | 0 | 95 | | { |
| | 0 | 96 | | Id = id; |
| | 0 | 97 | | CustomerId = customerId; |
| | 0 | 98 | | ReceiverId = receiverId; |
| | 0 | 99 | | SupplierId = supplierId; |
| | 0 | 100 | | SenderId = senderId; |
| | 0 | 101 | | FromDate = fromDate; |
| | 0 | 102 | | ToDate = toDate; |
| | 0 | 103 | | Kind = kind; |
| | 0 | 104 | | StateId = stateId; |
| | 0 | 105 | | StatusId = statusId; |
| | 0 | 106 | | Page = page; |
| | 0 | 107 | | Limit = limit < 1 ? 1 : limit > 100 && !generateExcel ? 100 : limit; |
| | 0 | 108 | | Sort = sort; |
| | 0 | 109 | | DocumentNumber = documentNumber; |
| | 0 | 110 | | СontragentBuyerFilter = contragentBuyerFilter; |
| | 0 | 111 | | ShowAnonym = showAnonym == default ? "nonanonymous" : showAnonym; |
| | 0 | 112 | | GenerateExcel = generateExcel; |
| | 0 | 113 | | } |
| | 0 | 114 | | public MovementParam(long customerId, long receiverId, long supplierId, long senderId, DateTime fromDate, DateTi |
| | 0 | 115 | | MovementKind kind, long stateId, long statusId, string documentNumber, string сontragentBuyerFilter = defaul |
| | 0 | 116 | | string showAnonym = "nonanonymous", bool generateExcel = false) |
| | 0 | 117 | | { |
| | 0 | 118 | | CustomerId = customerId; |
| | 0 | 119 | | ReceiverId = receiverId; |
| | 0 | 120 | | SupplierId = supplierId; |
| | 0 | 121 | | SenderId = senderId; |
| | 0 | 122 | | FromDate = fromDate; |
| | 0 | 123 | | ToDate = toDate; |
| | 0 | 124 | | Kind = kind; |
| | 0 | 125 | | StateId = stateId; |
| | 0 | 126 | | StatusId = statusId; |
| | 0 | 127 | | DocumentNumber = documentNumber; |
| | 0 | 128 | | СontragentBuyerFilter = сontragentBuyerFilter; |
| | 0 | 129 | | ShowAnonym = showAnonym == default ? "nonanonymous" : showAnonym; |
| | 0 | 130 | | GenerateExcel = generateExcel; |
| | 0 | 131 | | } |
| | | 132 | | } |
| | | 133 | | } |