yavsc/Yavsc/Helpers/EventHelpers.cs

27 lines
933 B
C#
Raw Normal View History

2016-05-17 18:22:18 +02:00
using Microsoft.Extensions.Localization;
using Yavsc.Models.Booking;
using Yavsc.Models.Messaging;
namespace Yavsc.Helpers
{
public static class EventHelpers
{
public static BookQueryEvent CreateEvent(this BookQuery query,
2016-05-17 18:22:18 +02:00
IStringLocalizer SR)
{
var yaev = new BookQueryEvent
2016-05-17 18:22:18 +02:00
{
2016-07-21 12:17:23 +02:00
Title = query.Client.UserName + " "+ SR["is asking you for a date"]+".",
2016-05-17 18:22:18 +02:00
Comment = (query.Previsional != null) ?
SR["Deposit"] + string.Format(": {0:00}",
query.Previsional) : SR["No deposit."],
Description = SR["Address"] + ": " + query.Location.Address + "\n" +
SR["Date"] + ": " + query.EventDate.ToString("D"),
StartDate = query.EventDate,
Location = query.Location,
CommandId = query.Id
2016-05-17 18:22:18 +02:00
};
return yaev;
}
}
}