PIbd-21_CourseWork_Polyclin.../Polyclinic/PolyclinicContracts/BindingModels/ReportBindingModel.cs

34 lines
946 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using static System.Net.Mime.MediaTypeNames;
using System.Reflection;
namespace PolyclinicContracts.BindingModels
{
public class ReportBindingModel
{
public string? FileName { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
public string GetPeriodString()
{
string txt = "";
if (DateFrom == null && DateTo == null)
{
txt = "за все время";
}
else if (DateFrom == null)
{
txt = $"по {DateTo?.ToShortDateString()}";
}
else if (DateTo == null)
{
txt = $"с {DateFrom?.ToShortDateString()}";
}
else
{
txt = $"с {DateFrom?.ToShortDateString()} по {DateTo?.ToShortDateString()}";
}
return txt;
}
}
}