162 lines
5.0 KiB
C#
162 lines
5.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Globalization;
|
|
using System.Web.Mvc;
|
|
using System.Web.Security;
|
|
using GODATA.RoleServices;
|
|
|
|
namespace GODATA.Models
|
|
{
|
|
|
|
public class LogOnModel
|
|
{
|
|
[Required]
|
|
[Display(Name = "User name")]
|
|
public string UserName { get; set; }
|
|
|
|
[Required]
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Password")]
|
|
public string Password { get; set; }
|
|
|
|
[Display(Name = "Remember me?")]
|
|
public bool RememberMe { get; set; }
|
|
}
|
|
|
|
public class RegisterModel
|
|
{
|
|
[Required]
|
|
[Display(Name = "User name")]
|
|
public string UserName { get; set; }
|
|
|
|
[Required]
|
|
//[DataType(DataType.EmailAddress)]
|
|
[Display(Name = "Email address")]
|
|
[RegularExpression("^[A-Za-z0-9._+\\-\\']+@[A-Za-z0-9.\\-]+\\.[A-Za-z]{2,}$", ErrorMessage = "Please enter correct email address.")]
|
|
public string Email { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Password")]
|
|
public string Password { get; set; }
|
|
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Confirm password")]
|
|
//[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
|
|
public string ConfirmPassword { get; set; }
|
|
|
|
[Required]
|
|
[Display(Name = "Role")]
|
|
public string Role { get; set; }
|
|
}
|
|
|
|
public class ForgotPasswordModel
|
|
{
|
|
[Required]
|
|
[DataType(DataType.EmailAddress)]
|
|
[Display(Name = "Email address")]
|
|
public string EmailAddress { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// This class will create new user
|
|
/// </summary>
|
|
public class CreateUserModel
|
|
{
|
|
[Required]
|
|
[Display(Name = "User name")]
|
|
public string UserName { get; set; }
|
|
|
|
[Required]
|
|
//[DataType(DataType.EmailAddress)]
|
|
[Display(Name = "Email address")]
|
|
[RegularExpression("^[A-Za-z0-9._+\\-\\']+@[A-Za-z0-9.\\-]+\\.[A-Za-z]{2,}$", ErrorMessage = "Please enter correct email address.")]
|
|
public string EmailId { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Password")]
|
|
public string Password { get; set; }
|
|
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Confirm password")]
|
|
[System.ComponentModel.DataAnnotations.Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
|
|
public string ConfirmPassword { get; set; }
|
|
|
|
[Required]
|
|
[Display(Name = "Role")]
|
|
public string RoleName { get; set; }
|
|
|
|
[Required]
|
|
public string UserId { get; set; }
|
|
|
|
[Display(Name = "Designation")]
|
|
public string Designation { get; set; }
|
|
|
|
[Display(Name = "Dealer ID")]
|
|
public string ObjectId { get; set; }
|
|
|
|
[Display(Name = "Organization ID")]
|
|
public string OrganizationId { get; set; }
|
|
|
|
[Display(Name = "City")]
|
|
public string City { get; set; }
|
|
|
|
[Display(Name = "State")]
|
|
public string State { get; set; }
|
|
|
|
[Display(Name = "Region")]
|
|
public string Region { get; set; }
|
|
|
|
[Display(Name = "Language")]
|
|
public string Language { get; set; }
|
|
|
|
[Display(Name = "Time Zone")]
|
|
public string TimeZoneId { get; set; }
|
|
|
|
}
|
|
|
|
public class ChangePasswordModel
|
|
{
|
|
[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")]
|
|
[System.ComponentModel.DataAnnotations.Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
|
|
public string ConfirmPassword { get; set; }
|
|
}
|
|
|
|
|
|
|
|
public class ResetPasswordModel
|
|
{
|
|
|
|
[Required(ErrorMessage="*")]
|
|
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "New password")]
|
|
public string ResetNewPassword { get; set; }
|
|
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Confirm new password")]
|
|
[System.ComponentModel.DataAnnotations.Compare("ResetNewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
|
|
public string ResetConfirmPassword { get; set; }
|
|
|
|
public string UserName { get; set; }
|
|
|
|
public string ObjectId { get; set; }
|
|
}
|
|
}
|