yavsc/Yavsc.Server/Models/HairCut/Views/HaircutQueryInfo.cs

74 lines
2.4 KiB
C#

7 years ago
//
// HaircutQueryInfo.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 - 2017 Paul Schneider
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
8 years ago
using System;
8 years ago
using System.ComponentModel.DataAnnotations;
6 years ago
using Yavsc.Abstract.Identity;
8 years ago
using Yavsc.Models.Relationship;
namespace Yavsc.Models.Haircut.Views
{
public class HaircutQueryProviderInfo : HaircutQueryComonInfo {
public HaircutQueryProviderInfo(HairCutQuery query) : base (query)
{
7 years ago
ClientInfo = new UserInfo(query.Client.Id, query.Client.UserName, query.Client.Avatar);
8 years ago
}
public UserInfo ClientInfo { get; set; }
}
public class HaircutQueryClientInfo : HaircutQueryComonInfo {
public HaircutQueryClientInfo(HairCutQuery query) : base (query)
{
7 years ago
var user = query.PerformerProfile.Performer;
ProviderInfo = new UserInfo(user.Id, user.UserName, user.Avatar);
8 years ago
}
7 years ago
public UserInfo ProviderInfo { get; set; }
8 years ago
}
public class HaircutQueryComonInfo
{
public HaircutQueryComonInfo(HairCutQuery query)
{
Id = query.Id;
Prestation = query.Prestation;
Status = query.Status;
Location = query.Location;
EventDate = query.EventDate;
8 years ago
AdditionalInfo = query.AdditionalInfo;
8 years ago
}
public long Id { get; set; }
public HairPrestation Prestation { get; set; }
public QueryStatus Status { get; set; }
public virtual Location Location { get; set; }
public DateTime? EventDate
{
get;
set;
}
8 years ago
[Display(Name="Informations complémentaires")]
public string AdditionalInfo { get; set; }
8 years ago
}
}