48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
// Copyright (c) 2023 schick Informatik
|
|
// Description: Data model for search filters
|
|
//
|
|
|
|
using BreCalClient.misc.Model;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace BreCalClient
|
|
{
|
|
internal class SearchFilterModel
|
|
{
|
|
public SearchFilterModel() { }
|
|
|
|
#region Properties
|
|
|
|
public DateTime? EtaFrom { get; set; }
|
|
|
|
public DateTime? EtaTo { get; set; }
|
|
|
|
public List<ShipcallType> Categories { get; set; } = new();
|
|
|
|
public List<int> Agencies { get; set; } = new();
|
|
|
|
public List<int> Berths { get; set; } = new();
|
|
|
|
public string? SearchString { get; set; }
|
|
|
|
public double? ShipLengthFrom { get; set; }
|
|
|
|
public double? ShipLengthTo { get; set; }
|
|
|
|
#endregion
|
|
|
|
public static SearchFilterModel? Deserialize(string json)
|
|
{
|
|
return (SearchFilterModel?) JsonConvert.DeserializeObject(json, typeof(SearchFilterModel));
|
|
}
|
|
|
|
public string Serialize()
|
|
{
|
|
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
|
}
|
|
|
|
}
|
|
}
|