* CalendarController.cs:

* Web.csproj:
* Global.asax.cs:
* instdb.sql:
* TemplateException.cs:
* ValidateAjaxAttribute.cs:
* TemplateException.cs:
* WorkFlowController.cs:
* NFCircle.cs:
* Circle.cs:
* NFEventPub.cs:
* Period.cs:
* OpenDay.cs:
* NFUserPrefs.cs:
* YaEvent.cs:
* WeekDay.cs:
* Position.cs:
* EventPub.cs:
* Resources.Designer.cs:
* Schedule.cs:
* Period.cs:
* NFEvent.cs:
* EventType.cs:
* WeekDay.cs:
* OpenDay.cs:
* FrontOfficeApiController.cs:
* UserPrefs.cs:
* Position.cs:
* Schedule.cs:
* Publishing.cs:
* EventType.cs:
* Periodicity.cs:
* Publishing.cs:
* Periodicity.cs:
* ProvidedEvent.cs:
* ProvidedEvent.cs:
* NightFlashController.cs:
* EstablishmentType.cs:
* ProviderPublicInfo.cs:
* EstablishmentType.cs:
* PositionAndKeyphrase.cs:
* ProviderPublicInfo.cs:
* PositionAndKeyphrase.cs: refactoring
This commit is contained in:
Paul Schneider 2015-05-16 00:50:11 +02:00
commit 04304ac0c3
25 changed files with 387 additions and 149 deletions

View file

@ -0,0 +1,35 @@
//
// NightFlashController.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
class Circle
{
public string Title { get; set; }
string [] Users { get; set; }
}
}

View file

@ -0,0 +1,62 @@
//
// NFEvent.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// Establishment type.
/// </summary>
public enum EstablishmentType
{
/// <summary>
/// The discotheque.
/// </summary>
Discotheque,
/// <summary>
/// The piano bar.
/// </summary>
PianoBar,
/// <summary>
/// The bar.
/// </summary>
Bar,
/// <summary>
/// The place publique.
/// </summary>
PlacePublique,
/// <summary>
/// The maison privee.
/// </summary>
MaisonPrivee,
/// <summary>
/// The domaine publique.
/// </summary>
DomainePublique,
/// <summary>
/// The domaine prive.
/// </summary>
DomainePrive
}
}

View file

@ -0,0 +1,35 @@
//
// NightFlashController.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
using Yavsc.ApiControllers.Calendar.Model;
namespace Yavsc.ApiControllers.Calendar.Model
{
class EventPub: YaEvent
{
Circle[] Circles { get; set; }
}
}

View file

@ -0,0 +1,71 @@
//
// EventType.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// Event type.
/// </summary>
public enum EventType
{
/// <summary>
/// The concert gratuit.
/// </summary>
ConcertGratuit,
/// <summary>
/// The concert prive.
/// </summary>
ConcertPrive,
/// <summary>
/// The distraciton.
/// </summary>
Distraciton,
/// <summary>
/// The rencontre.
/// </summary>
Rencontre,
/// <summary>
/// The assemblee.
/// </summary>
Assemblee,
/// <summary>
/// The reunion.
/// </summary>
Reunion,
/// <summary>
/// The bureau.
/// </summary>
Bureau,
/// <summary>
/// The manifestation.
/// </summary>
Manifestation,
/// <summary>
/// The zone de danger.
/// </summary>
ZoneDeDanger
}
}

View file

@ -0,0 +1,61 @@
//
// OpenDay.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// Open day.
/// </summary>
public class OpenDay {
/// <summary>
/// The day.
/// </summary>
[Required]
public WeekDay Day;
/// <summary>
/// Gets or sets the s.
/// </summary>
/// <value>The s.</value>
public TimeSpan S { get; set; }
// ASSERT Start <= End
/// <summary>
/// Gets or sets the start hour.
/// </summary>
/// <value>The start.</value>
[Required]
public TimeSpan Start { get; set; }
/// <summary>
/// Gets or sets the end hour
/// (from the next day if lower than the Start).
/// </summary>
/// <value>The end.</value>
[Required]
public TimeSpan End { get; set; }
}
}

View file

@ -0,0 +1,46 @@
//
// Period.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// Hollydays.
/// </summary>
public class Period {
/// <summary>
/// Gets or sets the start.
/// </summary>
/// <value>The start.</value>
[Required]
public DateTime Start { get; set; }
/// <summary>
/// Gets or sets the end.
/// </summary>
/// <value>The end.</value>
[Required]
public DateTime End { get; set; }
}
}

View file

@ -0,0 +1,58 @@
//
// Periodicity.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// Periodicity.
/// </summary>
public enum Periodicity {
/// <summary>
/// The daily.
/// </summary>
Daily,
/// <summary>
/// The weekly.
/// </summary>
Weekly,
/// <summary>
/// The monthly.
/// </summary>
Monthly,
/// <summary>
/// The three m.
/// </summary>
ThreeM,
/// <summary>
/// The six m.
/// </summary>
SixM,
/// <summary>
/// The yearly.
/// </summary>
Yearly
}
}

View file

@ -0,0 +1,44 @@
//
// Position.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// Position.
/// </summary>
public class Position
{
/// <summary>
/// The longitude.
/// </summary>
public double Longitude { get; set; }
/// <summary>
/// The latitude.
/// </summary>
public double Latitude { get; set; }
}
}

View file

@ -0,0 +1,42 @@
//
// PositionAndKeyphrase.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// Position and keyphrase.
/// </summary>
public class PositionAndKeyphrase {
/// <summary>
/// The phrase.
/// </summary>
public string phrase;
/// <summary>
/// The position.
/// </summary>
public Position pos;
}
}

View file

@ -0,0 +1,40 @@
//
// ProvidedEvent.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// Provided event.
/// </summary>
public class ProvidedEvent : YaEvent {
/// <summary>
/// The privacy.
/// </summary>
[Required]
public Publishing Privacy;
}
}

View file

@ -0,0 +1,73 @@
//
// ProviderPublicInfo.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// Provider public info.
/// </summary>
public class ProviderPublicInfo {
/// <summary>
/// Gets or sets the display name.
/// </summary>
/// <value>The display name.</value>
[Required]
public string DisplayName { get; set; }
/// <summary>
/// Gets or sets the type of the location.
/// </summary>
/// <value>The type of the location.</value>
[Required]
public string LocationType { get; set; }
/// <summary>
/// Gets or sets the location.
/// </summary>
/// <value>The location.</value>
[Required]
public Position Location { get; set; }
/// <summary>
/// Gets or sets the logo image locator.
/// </summary>
/// <value>The logo image locator.</value>
public string LogoImgLocator { get; set; }
/// <summary>
/// Gets or sets the description.
/// </summary>
/// <value>The description.</value>
[Required]
public string Description { get; set;}
/// <summary>
/// Gets or sets the web page.
/// </summary>
/// <value>The web page.</value>
public string WebPage { get; set; }
/// <summary>
/// Gets or sets the calendar.
/// </summary>
/// <value>The calendar.</value>
public Schedule Calendar { get; set; }
}
}

View file

@ -0,0 +1,43 @@
//
// Publishing.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// Publishing.
/// </summary>
public enum Publishing {
/// <summary>
/// The private.
/// </summary>
Private,
/// <summary>
/// The public.
/// </summary>
Public
}
}

View file

@ -0,0 +1,52 @@
//
// Schedule.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// Schedule.
/// </summary>
public class Schedule {
/// <summary>
/// Gets or sets the period.
/// </summary>
/// <value>The period.</value>
public Periodicity Period { get; set; }
/// <summary>
/// Gets or sets the schedule of an open week.
/// One item by bay in the week,
/// </summary>
/// <value>The weekly workdays.</value>
public OpenDay [] WeekDays { get; set; }
/// <summary>
/// Gets or sets the hollydays.
/// </summary>
/// <value>The hollydays.</value>
[Required]
public Period [] Validity { get; set; }
}
}

View file

@ -0,0 +1,34 @@
//
// NightFlashController.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;
namespace Yavsc.ApiControllers.Calendar.Model
{
class UserPrefs
{
Circle [] Circles { get; set ; }
Dictionary<string,double> MusicTypeRatings { get; set; }
Dictionary<string,double> LocationTypeRatings { get; set; }
}
}

View file

@ -0,0 +1,62 @@
//
// WeekDay.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// Week day.
/// </summary>
public enum WeekDay:int {
/// <summary>
/// The monday (0).
/// </summary>
Monday=0,
/// <summary>
/// The tuesday.
/// </summary>
Tuesday,
/// <summary>
/// The wednesday.
/// </summary>
Wednesday,
/// <summary>
/// The thursday.
/// </summary>
Thursday,
/// <summary>
/// The friday.
/// </summary>
Friday,
/// <summary>
/// The saturday.
/// </summary>
Saturday,
/// <summary>
/// The sunday.
/// </summary>
Sunday
}
}

View file

@ -0,0 +1,101 @@
//
// NFEvent.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model
{
/// <summary>
/// NF event.
/// </summary>
public class YaEvent
{
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.ApiControllers.Calendar.Model.YaEvent"/> class.
/// </summary>
public YaEvent()
{
this.EstabType = EstablishmentType.DomainePublique;
this.NFEvType = EventType.Distraciton;
}
/// <summary>
/// Gets or sets the type of the NF ev.
/// </summary>
/// <value>The type of the NF ev.</value>
[Required]
public EventType NFEvType { get; set; }
/// <summary>
/// Gets or sets the type of the estab.
/// </summary>
/// <value>The type of the estab.</value>
[Required(ErrorMessage="Please, choose an establisment type.")]
public EstablishmentType EstabType { get; set; }
/// <summary>
/// The title.
/// </summary>
[Required(ErrorMessage="Please, choose a .")]
public string Title { get; set; }
/// <summary>
/// The description.
/// </summary>
[Required(ErrorMessage="Please, choose a Description.")] public string Description { get; set; }
/// <summary>
/// The location.
/// </summary>
[Required(ErrorMessage="Please, choose a Location.")] public Position Location { get; set; }
/// <summary>
/// The start date.
/// </summary>
[Required(ErrorMessage="Please, choose a Start Date.")] public DateTime StartDate { get; set; }
/// <summary>
/// Gets or sets the end date.
/// </summary>
/// <value>The end date.</value>
[Required(ErrorMessage="Please, choose an End Date.")] public DateTime EndDate { get; set; }
/// <summary>
/// The name of the NF provider.
/// </summary>
[Required(ErrorMessage="Please, choose a Nigth Flash Provider Name.")] public string NFProviderName { get; set; }
/// <summary>
/// The NF provider identifier.
/// </summary>
[Required(ErrorMessage="Please, choose a Night Flash Provider Identifier.")] public string NFProviderId { get; set; }
/// <summary>
/// The promotion code.
/// </summary>
public string PromotionCode { get; set; }
/// <summary>
/// The event web page.
/// </summary>
public string EventWebPage { get; set; }
/// <summary>
/// The image locator.
/// </summary>-
public string ImgLocator { get; set; }
}
}