Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renaming everything to BoC (except the foldes, perhaps I'll do those …
…also some time soon )
- Loading branch information
Showing
24 changed files
with
301 additions
and
180 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@inherits System.Web.Mvc.WebViewPage<BoC.Security.Mvc.ViewModels.RegisterModel> | ||
|
||
@{ | ||
ViewBag.Title = "Register"; | ||
} | ||
|
||
<h2>Create a New Account</h2> | ||
<p> | ||
Use the form below to create a new account. | ||
</p> | ||
<p> | ||
Passwords are required to be a minimum of @ViewBag.PasswordLength characters in length. | ||
</p> | ||
haaaaaai | ||
@using (Html.BeginForm()) { | ||
@Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.") | ||
<div> | ||
<fieldset> | ||
<legend>Account Information</legend> | ||
|
||
<div class="editor-label"> | ||
@Html.LabelFor(m => m.UserName) | ||
</div> | ||
<div class="editor-field"> | ||
@Html.TextBoxFor(m => m.UserName) | ||
@Html.ValidationMessageFor(m => m.UserName) | ||
</div> | ||
|
||
<div class="editor-label"> | ||
@Html.LabelFor(m => m.Email) | ||
</div> | ||
<div class="editor-field"> | ||
@Html.TextBoxFor(m => m.Email) | ||
@Html.ValidationMessageFor(m => m.Email) | ||
</div> | ||
|
||
<div class="editor-label"> | ||
@Html.LabelFor(m => m.Password) | ||
</div> | ||
<div class="editor-field"> | ||
@Html.PasswordFor(m => m.Password) | ||
@Html.ValidationMessageFor(m => m.Password) | ||
</div> | ||
|
||
<div class="editor-label"> | ||
@Html.LabelFor(m => m.ConfirmPassword) | ||
</div> | ||
<div class="editor-field"> | ||
@Html.PasswordFor(m => m.ConfirmPassword) | ||
@Html.ValidationMessageFor(m => m.ConfirmPassword) | ||
</div> | ||
|
||
<p> | ||
<input type="submit" value="Register" /> | ||
</p> | ||
</fieldset> | ||
</div> | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Web.Mvc; | ||
|
||
namespace BoC.Web.Mvc.Binders | ||
{ | ||
public class DecimalModelBinder : DefaultModelBinder | ||
{ | ||
public override object BindModel( | ||
ControllerContext controllerContext, | ||
ModelBindingContext bindingContext) | ||
{ | ||
var valueProviderResult = bindingContext.ValueProvider.GetValue(bindingContext.ModelName); | ||
if (valueProviderResult.AttemptedValue.Equals("N.aN") || valueProviderResult.AttemptedValue.Equals("NaN") || valueProviderResult.AttemptedValue.Equals("Infini.ty") || valueProviderResult.AttemptedValue.Equals("Infinity")) | ||
return 0m; | ||
return valueProviderResult == null ? base.BindModel(controllerContext, bindingContext) : Convert.ToDecimal(valueProviderResult.AttemptedValue); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.