This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sortTableByColorSets() { | |
// store an empty object to contain all colors | |
var holdingCell = {}; | |
// loop over the colors in the predfined colors array. | |
for (var color in colors) { | |
// get the color value and create a stub for it in the object. e.g object.colorname | |
colorValue = colors[color]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<component id="FormsAuthenticationService" lifestyle="PerWebRequest" service="ExampleProject1.Services.Interfaces.IFormsAuthenticationService, ExampleProject1" type="ExampleProject1.Services.FormsAuthenticationService, ExampleProject1"></component> | |
<component id="MembershipService" lifestyle="PerWebRequest" service="ExampleProject1.Services.Interfaces.IMembershipService, ExampleProject1" type="ExampleProject1.Services.MembershipService, ExampleProject1"></component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<add namespace="ExampleProject1.Models.Account" /> | |
<add namespace="ExampleProject1.Models.Account.Validation" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AccountController : Controller | |
{ | |
private readonly IFormsAuthenticationService formsService; | |
private readonly IMembershipService membershipService; | |
public AccountController(IFormsAuthenticationService formsService, IMembershipService membershipService) | |
{ | |
this.formsService = formsService; | |
this.membershipService = membershipService; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MembershipService : IMembershipService | |
{ | |
private readonly MembershipProvider _provider; | |
public MembershipService() | |
: this(null) | |
{ | |
} | |
public MembershipService(MembershipProvider provider) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FormsAuthenticationService : IFormsAuthenticationService | |
{ | |
public void SignIn(string userName, bool createPersistentCookie) | |
{ | |
if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.", "userName"); | |
FormsAuthentication.SetAuthCookie(userName, createPersistentCookie); | |
} | |
public void SignOut() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IMembershipService | |
{ | |
int MinPasswordLength { get; } | |
bool ValidateUser(string userName, string password); | |
MembershipCreateStatus CreateUser(string userName, string password, string email); | |
bool ChangePassword(string userName, string oldPassword, string newPassword); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IFormsAuthenticationService | |
{ | |
void SignIn(string userName, bool createPersistentCookie); | |
void SignOut(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[PropertiesMustMatch("Password", "ConfirmPassword", ErrorMessage = "The password and confirmation password do not match.")] | |
public class RegisterModel | |
{ | |
[Required] | |
[DisplayName("User name")] | |
public string UserName { get; set; } | |
[Required] | |
[DataType(DataType.EmailAddress)] | |
[DisplayName("Email address")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LogOnModel | |
{ | |
[Required] | |
[DisplayName("User name")] | |
public string UserName { get; set; } | |
[Required] | |
[DataType(DataType.Password)] | |
[DisplayName("Password")] | |
public string Password { get; set; } |