Combine layouts

This commit is contained in:
2012-12-24 21:18:41 -05:00
parent c1944f6262
commit 05d1ae4ec6
83 changed files with 845 additions and 1210 deletions
+1
View File
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using MileageTraker.Web.Attributes;
using MileageTraker.Web.Utility;
namespace MileageTraker.Web.ViewModels.Account
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using AutoMapper;
using MileageTraker.Web.Attributes;
using MileageTraker.Web.DAL;
using MileageTraker.Web.Models;
using MileageTraker.Web.Utility;
@@ -0,0 +1,36 @@
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using AutoMapper;
namespace MileageTraker.Web.ViewModels.User
{
public class CreateUserViewModel
{
[Required]
[DataType(DataType.EmailAddress)]
[RegularExpression(@"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}", ErrorMessage = "Must be an email address")]
public string Email { get; set; }
[Required]
[StringLength(50, MinimumLength = 2)]
public string FirstName { get; set; }
[Required]
[StringLength(50, MinimumLength = 2)]
public string LastName { get; set; }
public MultiSelectList Roles { get; set; }
static CreateUserViewModel()
{
Mapper.CreateMap<CreateUserViewModel, Models.User>();
}
public Models.User CloneToUser()
{
var user = new Models.User();
Mapper.Map(this, user);
return user;
}
}
}
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
namespace MileageTraker.Web.ViewModels.User
{
public class UserDetailsViewModel
{
public string Username { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string[] Roles { get; set; }
[DisplayFormat(DataFormatString = @"{0:MM/dd/yyyy}")]
public DateTime LastActivityDate { get; set; }
[DisplayFormat(DataFormatString = @"{0:MM/dd/yyyy}")]
public DateTime CreateDate { get; set; }
public bool IsLockedOut { get; set; }
[DisplayFormat(DataFormatString = @"{0:MM/dd/yyyy}")]
public DateTime LastLockoutDate { get; set; }
}
}