EF7 npgsql => ko aux clients => inutile en lib [obsdnx]

This commit is contained in:
2018-05-04 17:04:19 +02:00
parent 4ae095ccb3
commit 4e3845755b
495 changed files with 206 additions and 10500 deletions

View File

@ -0,0 +1,20 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.Models.Account { 
public class ChangePasswordBindingModel {
[Required]
[DataType(DataType.Password)]
public string OldPassword { get; set; }
[Required]
[DataType(DataType.Password)]
public string NewPassword { get; set; }
}
public class SetPasswordBindingModel {
[Required]
[DataType(DataType.Password)]
public string NewPassword { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Account
{
public class ExternalLoginConfirmationViewModel
{
[Required]
public string Name { get; set; }
[Required]
[EmailAddress]
public string Email { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Account
{
public class ForgotPasswordViewModel
{
[Required]
[StringLength(512)]
public string LoginOrEmail { get; set; }
}
}

View File

@ -0,0 +1,54 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNet.Http.Authentication;
namespace Yavsc.ViewModels.Account
{
public class SignInViewModel
{
/// <summary>
/// Local user's name.
/// </summary>
/// <returns></returns>
[Required]
public string UserName { get; set; }
/// <summary>
/// Local user's password .
/// </summary>
/// <returns></returns>
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
/// <summary>
/// When true, asks for a two-factor identification
/// </summary>
/// <returns></returns>
[Display(Name = "Se souvenir de moi?")]
public bool RememberMe { get; set; }
/// <summary>
/// Indicates the authentication provider'name chosen to authenticate,
/// contains "LOCAL" to choose the local application identity
/// and user password credentials.
/// </summary>
/// <returns></returns>
public string Provider { get; set; }
/// <summary>
/// This value does NOT indicate the OAuth client method recieving the code,
/// but the one called once authorized.
/// </summary>
/// <returns></returns>
public string ReturnUrl { get; set; }
/// <summary>
/// Lists external identity provider descriptions.
/// </summary>
/// <returns>an enumeration of the descriptions.</returns>
public IEnumerable<AuthenticationDescription> ExternalProviders { get; set; }
}
}

View File

@ -0,0 +1,39 @@
namespace Yavsc.Models.Auth
{
public class Me : IApplicationUser {
public Me(ApplicationUser user)
{
Id = user.Id;
UserName = user.UserName;
EMail = user.Email;
Avatar = user.Avatar;
PostalAddress = user.PostalAddress;
DedicatedGoogleCalendar = user.DedicatedGoogleCalendar;
}
public string Id { get; set; }
public string UserName { get; set; }
public string EMail { get; set; }
public string[] Roles { get; set; }
/// <summary>
/// Known as profile, could point to an avatar
/// </summary>
/// <returns></returns>
public string Avatar { get; set; }
public IAccountBalance AccountBalance
{
get; set;
}
public string DedicatedGoogleCalendar
{
get; set;
}
public ILocation PostalAddress
{
get; set;
}
}
}

View File

@ -0,0 +1,36 @@
using System.ComponentModel.DataAnnotations;
using Yavsc.Attributes.Validation;
namespace Yavsc.ViewModels.Account
{
public class RegisterViewModel
{
// ErrorMessage = "",
[Display(ResourceType = typeof(RegisterViewModel), Name = "UserName")]
[StringLength(102)]
[YaRegularExpression(@"[a-zA-Z0-9 .'_-]+", ErrorMessageResourceName="InvalidUserName", ErrorMessageResourceType = typeof(RegisterViewModel))]
public string UserName { get; set; }
[YaRequired()]
// [EmailAddress]
[Display(Name = "Email")]
public string Email { get; set; }
[StringLength(100, MinimumLength = 6)]
[DataType(DataType.Password)]
// ErrorMessage = "Les mots de passe doivent contenir au moins un caractère spécial, qui ne soit ni une lettre ni un chiffre.")]
[Display(ResourceType = typeof(RegisterViewModel), Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(ResourceType = typeof(RegisterViewModel), Name = "PasswordConfirm")]
[Compare("Password", ErrorMessageResourceName = "PassAndConfirmDontMach", ErrorMessageResourceType = typeof(RegisterViewModel) )]
public string ConfirmPassword { get; set; }
public string GoogleRegId { get; set; }
}
}

View File

@ -0,0 +1,23 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Account
{
public class ResetPasswordViewModel
{
[Required]
[EmailAddress]
public string Email { get; set; }
[Required]
[StringLength(100, ErrorMessage = "Le {0} doit être long d'au moins {2} caractères.", MinimumLength = 6)]
[DataType(DataType.Password)]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirmer le mot de passe")]
[Compare("Password", ErrorMessage = "Le mot de passe et sa confirmation ne sont pas les mêmes.")]
public string ConfirmPassword { get; set; }
public string Code { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System.Collections.Generic;
using Microsoft.AspNet.Mvc.Rendering;
namespace Yavsc.ViewModels.Account
{
public class SendCodeViewModel
{
public string SelectedProvider { get; set; }
public ICollection<SelectListItem> Providers { get; set; }
public string ReturnUrl { get; set; }
public bool RememberMe { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace Yavsc.ViewModels.Account
{
public class ShortUserInfo
{
public string Avatar { get; set; }
public string UserName { get; set; }
public string UserId { get; set; }
}
}

View File

@ -0,0 +1,8 @@
namespace Yavsc.ViewModels.Account
{
public class UnregisterViewModel
{
public string ReturnUrl { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Account
{
public class VerifyCodeViewModel
{
[Required]
public string Provider { get; set; }
[Required]
public string Code { get; set; }
public string ReturnUrl { get; set; }
[Display(Name = "Se souvenir de ce navigateur?")]
public bool RememberBrowser { get; set; }
[Display(Name = "Se souvenir de moi?")]
public bool RememberMe { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace Yavsc.ViewModels.Administration {
public class AdminViewModel {
public RoleInfo [] Roles { get; set; }
public int AdminCount { get; set; }
public bool YouAreAdmin { get; set; }
public int UserCount { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using System.Linq;
using Microsoft.AspNet.Identity.EntityFramework;
namespace Yavsc.ViewModels.Administration
{
public class RoleInfo
{
public RoleInfo ()
{
}
public RoleInfo ( IdentityRole role)
{
Name = role.Name;
Id = role.Id;
Users = role.Users.Select(u => u.UserId).ToArray();
}
public string Id { get; set; }
public string Name { get; set; }
public string[] Users { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using Yavsc.Models.Auth;
namespace Yavsc.ViewModels.Administration
{
public class RoleUserCollection
{
public RoleUserCollection()
{
}
public string Id { get; set; }
public string Name { get; set; }
public UserInfo[] Users { get; set; }
}
}

View File

@ -0,0 +1,10 @@
namespace Yavsc.Models.Auth
{
public class AuthorisationView { 
public Scope[] Scopes { get; set; }
public string Message { get; set; }
}
}

View File

@ -0,0 +1,10 @@
namespace Yavsc {
public static class YavscClaimTypes {
public const string GoogleUserId = "GoogleUserId";
}
}

View File

@ -0,0 +1,11 @@
using Microsoft.AspNet.Authorization;
namespace Yavsc.ViewModels.Auth
{
public class EditRequirement : IAuthorizationRequirement
{
public EditRequirement()
{
}
}
}

View File

@ -0,0 +1,25 @@
using System.IO;
using Microsoft.AspNet.Authorization;
using Yavsc.Models.Blog;
namespace Yavsc.ViewModel.Auth {
public class FileSpotInfo : IAuthorizationRequirement
{
public DirectoryInfo PathInfo { get; private set; }
public FileSpotInfo(string path, BlogPost b) {
PathInfo = new DirectoryInfo(path);
AuthorId = b.AuthorId;
BlogEntryId = b.Id;
}
public string AuthorId { get; private set; }
public long BlogEntryId { get; private set; }
}
}

View File

@ -0,0 +1,9 @@
using Microsoft.AspNet.Authorization;
namespace Yavsc.ViewModels.Auth
{
public class ModerationRequirement : IAuthorizationRequirement
{
public ModerationRequirement() {}
}
}

View File

@ -0,0 +1,8 @@
using Microsoft.AspNet.Authorization;
namespace Yavsc.ViewModels.Auth
{
public class PrivateChatEntryRequirement : IAuthorizationRequirement
{
}
}

View File

@ -0,0 +1,11 @@
using Microsoft.AspNet.FileProviders;
namespace Yavsc.ViewModels.Auth
{
public class ViewFileContext
{
public string UserName { get; set; }
public IFileInfo File { get; set; }
public string Path { get; set; }
}
}

View File

@ -0,0 +1,11 @@
using Microsoft.AspNet.Authorization;
namespace Yavsc.ViewModels.Auth
{
public class ViewRequirement : IAuthorizationRequirement
{
public ViewRequirement()
{
}
}
}

View File

@ -0,0 +1,8 @@
namespace Yavsc.ViewModels
{
public class BasketView
{
public long HairCutActiveQueryCount { get; set; }
}
}

View File

@ -0,0 +1,31 @@
namespace Yavsc.ViewModels.Blogspot
{
public class BlogIndexKey
{
public string AuthorId { get; set; }
public string Title { get; set; }
// override object.Equals
public override bool Equals (object obj)
{
//
// See the full list of guidelines at
// http://go.microsoft.com/fwlink/?LinkID=85237
// and also the guidance for operator== at
// http://go.microsoft.com/fwlink/?LinkId=85238
//
if (obj == null || GetType() != obj.GetType())
{
return false;
}
var blogindexkey = (BlogIndexKey)obj;
return Title == blogindexkey.Title && AuthorId == blogindexkey.AuthorId;
}
// override object.GetHashCode
public override int GetHashCode()
{
return Title.GetHashCode() * AuthorId.GetHashCode();
}
}
}

View File

@ -0,0 +1,19 @@
using System;
using Yavsc.Models.Calendar;
namespace Yavsc.ViewModels.Calendar
{
public class DateTimeChooserViewModel
{
public string InputId { get; set; }
public DateTime MinDate { get; set; }
public DateTime MaxDate { get; set; }
public Period [] Busy { get; set; }
public Period [] Free { get; set; }
public string [] FreeDates { get ; set; }
public string [] BusyDates { get ; set; }
}
}

View File

@ -0,0 +1,15 @@
using Google.Apis.Calendar.v3.Data;
namespace Yavsc.ViewModels.Calendar
{
public class SetGoogleCalendarViewModel
{
public string GoogleCalendarId { get; set; }
public string ReturnUrl { get; set; }
public CalendarList Calendars { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace Yavsc.ViewModels.Calendar {
public class UpcomingEventsViewModel {
}
}

View File

@ -0,0 +1,31 @@
using System.Collections.Generic;
using Yavsc.Models.Chat;
namespace Yavsc.ViewModels.Chat { 
public class ChatUserInfo : IChatUserInfo
{
public List<ChatConnection> Connections { get; set; }
public string UserId { get; set; }
public string UserName { get; set; }
public string Avatar { get; set; }
public string[] Roles { get; set; }
}
public interface IChatUserInfo
{
List<ChatConnection> Connections { get; set; }
string UserId { get; set; }
string UserName { get; set; }
string Avatar { get; set; }
string[] Roles { get; set; }
}
}

View File

@ -0,0 +1,10 @@
namespace Yavsc.ViewModels.Controls
{
public class AjaxCheckBoxInfo
{
public string Text { get; set; }
public string Value { get; set; }
public bool Checked { get; set; }
}
}

View File

@ -0,0 +1,13 @@
namespace Yavsc.ViewModels.FrontOffice
{
public class FrontOfficeIndexViewModel
{
public int EstimateToProduceCount { get; set; }
public int EstimateToSignAsProCount { get; set; }
public int EstimateToSignAsCliCount { get; set; }
public int BillToSignAsProCount { get; set; }
public int BillToSignAsCliCount { get; set; }
public int NewPayementsCount { get; set; }
}
}

View File

@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNet.Mvc.Rendering;
namespace Yavsc.ViewModels.Gen
{
public class PdfGenerationViewModel
{
[Required]
public string TeXSource { get; set; }
[Required]
public string BaseFileName { get; set; }
[Required]
public string DestDir { get; set; }
public bool Generated { get; set; }
public HtmlString GenerationErrorMessage { get; set; }
public string Temp { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace Yavsc.ViewModels.Haircut
{
public class HaircutAdminViewModel
{
}
}

View File

@ -0,0 +1,7 @@
namespace Yavsc.ViewModels.Haircut
{
public class HaircutClientView
{
}
}

View File

@ -0,0 +1,7 @@
namespace Yavsc.ViewModels.Haircut
{
public class HaircutProviderView
{
}
}

View File

@ -0,0 +1,12 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Manage
{
public class AddPhoneNumberViewModel
{
[Required]
[Phone]
[Display(Name = "Phone number")]
public string PhoneNumber { get; set; }
}
}

View File

@ -0,0 +1,23 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Manage
{
public class ChangePasswordViewModel
{
[Required]
[DataType(DataType.Password)]
[Display(Name = "Current password")]
public string OldPassword { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Manage
{
public class ChangeUserNameViewModel
{
[Required]
[Display(Name = "New user name"),RegularExpression(Constants.UserNameRegExp)]
public string NewUserName { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System.Collections.Generic;
using Microsoft.AspNet.Mvc.Rendering;
namespace Yavsc.ViewModels.Manage
{
public class ConfigureTwoFactorViewModel
{
public string SelectedProvider { get; set; }
public ICollection<SelectListItem> Providers { get; set; }
}
}

View File

@ -0,0 +1,35 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Manage
{
public class DoDirectCreditViewModel {
[Required]
public string PaymentType  { get; set;}
[Required]
public string PayerName  { get; set;}
[Required]
public string FirstName  { get; set;}
[Required]
public string LastName  { get; set;}
[Required]
public string CreditCardNumber  { get; set;}
public string CreditCardType  { get; set;}
public string Cvv2Number  { get; set;}
public string CardExpiryDate  { get; set;}
public string IpnNotificationUrl { get; set; }
[Required]
public string Street1 { get; set; }
public string Street2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
[Required]
public string PostalCode { get; set; }
public string Phone { get; set; }
[Required]
public string CurrencyCode { get; set; }
[Required]
public string Amount { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace Yavsc.ViewModels.Manage
{
public class FactorViewModel
{
public string Purpose { get; set; }
}
}

View File

@ -0,0 +1,55 @@
using System.Collections.Generic;
using Microsoft.AspNet.Identity;
namespace Yavsc.ViewModels.Manage
{
using Models.Bank;
using Models;
using Models.Workflow;
public class IndexViewModel
{
public string UserName {get; set; }
public string Avatar { get; set; }
public bool HasPassword { get; set; }
public IList<UserLoginInfo> Logins { get; set; }
public string PhoneNumber { get; set; }
public bool TwoFactor { get; set; }
public bool BrowserRemembered { get; set; }
public List<UserActivity> Activity { get; set; }
public bool HaveProfessionalSettings { get; set; }
public bool HaveActivityToConfigure { get; set; }
public long PostsCounter { get; set; }
public AccountBalance Balance { get; set; }
public long ActiveCommandCount { get; set; }
public bool HasDedicatedCalendar { get; set; }
public IEnumerable<string> Roles { get; set; }
public string FullName { get; set; }
public string PostalAddress { get; set; }
public BankIdentity BankInfo { get; set; }
public long DiskQuota { get; set; }
public long DiskUsage { get; set; }
public string DedicatedCalendarId { get; set; }
public string EMail { get; set; }
public bool EmailConfirmed { get; set; }
public bool AllowMonthlyEmail { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using System.Collections.Generic;
using Microsoft.AspNet.Http.Authentication;
using Microsoft.AspNet.Identity;
namespace Yavsc.ViewModels.Manage
{
public class ManageLoginsViewModel
{
public IList<UserLoginInfo> CurrentLogins { get; set; }
public IList<AuthenticationDescription> OtherLogins { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using Yavsc.Models;
namespace Yavsc.ViewModels.Manage
{
public class ProfileEMailUsageViewModel
{
public bool Allow { get; set; }
public ProfileEMailUsageViewModel()
{
}
public ProfileEMailUsageViewModel(ApplicationUser user=null)
{
Allow = user.AllowMonthlyEmail;
}
}
}

View File

@ -0,0 +1,8 @@
namespace Yavsc.ViewModels.Manage
{
public class RemoveLoginViewModel
{
public string LoginProvider { get; set; }
public string ProviderKey { get; set; }
}
}

View File

@ -0,0 +1,9 @@
using Yavsc.Models.Workflow;
namespace Yavsc.ViewModels.Manage
{
public class SetActivityViewModel : PerformerProfile
{
}
}

View File

@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Manage
{
public class SetAddressViewModel
{
[Required]
public string Street1 { get; set; }
public string Street2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
[Required]
public string PostalCode { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Manage
{
public class SetPasswordViewModel
{
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Manage
{
public class VerifyPhoneNumberViewModel
{
[Required]
public string Code { get; set; }
[Required]
[Phone]
[Display(Name = "Phone number")]
public string PhoneNumber { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace Yavsc.ViewModels
{
public enum OutputFormat {
Html,
LaTeX,
Pdf
}
}

View File

@ -0,0 +1,14 @@
using PayPal.PayPalAPIInterfaceService.Model;
using Yavsc.Models.Payment;
namespace Yavsc.ViewModels.PayPal
{
public class PaymentInfo
{
public PayPalPayment DbContent { get; set; }
public virtual GetExpressCheckoutDetailsResponseType DetailsFromPayPal { get; set; }
}
}

View File

@ -0,0 +1,13 @@
namespace Yavsc.ViewModels.Relationship
{
public class CirclesViewModel
{
public CirclesViewModel(ICircleAuthorized resource)
{
Target = resource;
TargetTypeName = resource.GetType().Name;
}
public ICircleAuthorized Target { get; set; }
public string TargetTypeName { get; set; }
}
}

View File

@ -0,0 +1,9 @@
using System;
namespace Yavsc.ViewModels.Test
{
public class CalendarViewModel
{
public DateTime EventDate { get; set;}
}
}

View File

@ -0,0 +1,11 @@
using Yavsc.Models.Billing;
namespace Yavsc.ViewModels.Workflow
{
public class EstimateEdition
{
public Estimate Data { get; set; }
}
}

View File

@ -0,0 +1,11 @@
using Yavsc.Models.Workflow;
namespace Yavsc.ViewModels.Workflow
{
public class UserActivityViewModel
{
public UserActivity Declaration { get; set; }
public bool NeedsSettings { get; set; }
public ISpecializationSettings Settings { get; set; }
}
}