diff --git a/src/UI/Web/App_Data/GiveIT.mdf b/src/UI/Web/App_Data/GiveIT.mdf new file mode 100644 index 0000000..5e3876c Binary files /dev/null and b/src/UI/Web/App_Data/GiveIT.mdf differ diff --git a/src/UI/Web/App_Data/GiveIT_log.ldf b/src/UI/Web/App_Data/GiveIT_log.ldf new file mode 100644 index 0000000..d61e277 Binary files /dev/null and b/src/UI/Web/App_Data/GiveIT_log.ldf differ diff --git a/src/UI/Web/App_Data/aspnet-GiveIT.UI.Web-20130520184752.mdf b/src/UI/Web/App_Data/aspnet-GiveIT.UI.Web-20130520184752.mdf index 25d11af..af0737c 100644 Binary files a/src/UI/Web/App_Data/aspnet-GiveIT.UI.Web-20130520184752.mdf and b/src/UI/Web/App_Data/aspnet-GiveIT.UI.Web-20130520184752.mdf differ diff --git a/src/UI/Web/App_Data/aspnet-GiveIT.UI.Web-20130520184752_log.ldf b/src/UI/Web/App_Data/aspnet-GiveIT.UI.Web-20130520184752_log.ldf index de7a182..1cc707b 100644 Binary files a/src/UI/Web/App_Data/aspnet-GiveIT.UI.Web-20130520184752_log.ldf and b/src/UI/Web/App_Data/aspnet-GiveIT.UI.Web-20130520184752_log.ldf differ diff --git a/src/UI/Web/Controllers/AccountController.cs b/src/UI/Web/Controllers/AccountController.cs index f7b4360..b024c77 100644 --- a/src/UI/Web/Controllers/AccountController.cs +++ b/src/UI/Web/Controllers/AccountController.cs @@ -8,13 +8,11 @@ using DotNetOpenAuth.AspNet; using Microsoft.Web.WebPages.OAuth; using WebMatrix.WebData; -using GiveIT.UI.Web.Filters; using GiveIT.UI.Web.Models; namespace GiveIT.UI.Web.Controllers { [Authorize] - [InitializeSimpleMembership] public class AccountController : Controller { // @@ -264,14 +262,14 @@ public ActionResult ExternalLoginConfirmation(RegisterExternalLoginModel model, if (ModelState.IsValid) { // Insert a new user into the database - using (UsersContext db = new UsersContext()) + using (UIWebDbContext db = new UIWebDbContext()) { - UserProfile user = db.UserProfiles.FirstOrDefault(u => u.UserName.ToLower() == model.UserName.ToLower()); + User user = db.Users.FirstOrDefault(u => u.UserName.ToLower() == model.UserName.ToLower()); // Check if user already exists if (user == null) { // Insert name into the profile table - db.UserProfiles.Add(new UserProfile { UserName = model.UserName }); + db.Users.Add(new User { UserName = model.UserName }); db.SaveChanges(); OAuthWebSecurity.CreateOrUpdateAccount(provider, providerUserId, model.UserName); diff --git a/src/UI/Web/Controllers/CharityRegisterController.cs b/src/UI/Web/Controllers/CharityRegisterController.cs new file mode 100644 index 0000000..ef8f6fa --- /dev/null +++ b/src/UI/Web/Controllers/CharityRegisterController.cs @@ -0,0 +1,133 @@ +using GiveIT.UI.Web.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using System.Web.Security; +using WebMatrix.WebData; + +namespace GiveIT.UI.Web.Controllers +{ + public class CharityRegisterController : Controller + { + UIWebDbContext db = new UIWebDbContext(); + + + // + // GET: /CharityRegister/RegisterC + [AllowAnonymous] + public ActionResult RegisterC() + { + return View(); + } + + // + // POST: /CharityRegister/RegisterC + + [HttpPost] + [AllowAnonymous] + [ValidateAntiForgeryToken] + public ActionResult RegisterC(CharityRegister model) + { + + if (ModelState.IsValid) + { + // Attempt to register the charity and store charity info to database + try + { + + WebSecurity.CreateUserAndAccount(model.CharityName, model.Password, + propertyValues: new + { + ContactFirstName = model.ContactFirstName, + ContactLastName = model.ContactLastName, + Title = model.Title, + PhoneNumber = model.PhoneNumber, + PhoneNoExtension = model.PhoneNoExtension, + EmailAddress = model.EmailAddress + }); + + db.Charities.Add(new Charity + { + CharityName = model.CharityName, + MissionAndLocation = model.MissionAndLocation, + EIN = model.EIN, + StreetAddress = model.StreetAddress, + StreetAddress2 = model.StreetAddress2, + City = model.City, + State = model.State, + ZipCode = model.ZipCode + }); + + db.SaveChanges(); + + WebSecurity.Login(model.CharityName, model.Password); + + + ///////////////-Just test page, need to redirect to somewhere + return RedirectToAction("Index", "Home"); + // return RedirectToAction("Detail", "RegisterC"); + } + catch (MembershipCreateUserException e) + { + ModelState.AddModelError("", ErrorCodeToString(e.StatusCode)); + } + } + + // If we got this far, something failed, redisplay form + return View(model); + } + + + #region Helpers + private static string ErrorCodeToString(MembershipCreateStatus createStatus) + { + // See http://go.microsoft.com/fwlink/?LinkID=177550 for + // a full list of status codes. + switch (createStatus) + { + case MembershipCreateStatus.DuplicateUserName: + return "User name already exists. Please enter a different user name."; + + case MembershipCreateStatus.DuplicateEmail: + return "A user name for that e-mail address already exists. Please enter a different e-mail address."; + + case MembershipCreateStatus.InvalidPassword: + return "The password provided is invalid. Please enter a valid password value."; + + case MembershipCreateStatus.InvalidEmail: + return "The e-mail address provided is invalid. Please check the value and try again."; + + case MembershipCreateStatus.InvalidAnswer: + return "The password retrieval answer provided is invalid. Please check the value and try again."; + + case MembershipCreateStatus.InvalidQuestion: + return "The password retrieval question provided is invalid. Please check the value and try again."; + + case MembershipCreateStatus.InvalidUserName: + return "The user name provided is invalid. Please check the value and try again."; + + case MembershipCreateStatus.ProviderError: + return "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator."; + + case MembershipCreateStatus.UserRejected: + return "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator."; + + default: + return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator."; + } + } + #endregion + + protected override void Dispose(bool disposing) + { + if (db != null) + { + db.Dispose(); + } + base.Dispose(disposing); + } + + } +} \ No newline at end of file diff --git a/src/UI/Web/Controllers/HomeController.cs b/src/UI/Web/Controllers/HomeController.cs index 1f83dbb..2a31450 100644 --- a/src/UI/Web/Controllers/HomeController.cs +++ b/src/UI/Web/Controllers/HomeController.cs @@ -1,4 +1,5 @@ -using System; +using GiveIT.UI.Web.Models; +using System; using System.Collections.Generic; using System.Linq; using System.Web; @@ -8,16 +9,15 @@ namespace GiveIT.UI.Web.Controllers { public class HomeController : Controller { + public ActionResult Index() { - ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application."; - return View(); } - public ActionResult HowItWorks() + public ActionResult About() { - //ViewBag.Message = "Your app description page."; + ViewBag.Message = "Your app description page."; return View(); } @@ -28,5 +28,7 @@ public ActionResult Contact() return View(); } + + } } diff --git a/src/UI/Web/Filters/InitializeSimpleMembershipAttribute.cs b/src/UI/Web/Filters/InitializeSimpleMembershipAttribute.cs deleted file mode 100644 index 79c4c0c..0000000 --- a/src/UI/Web/Filters/InitializeSimpleMembershipAttribute.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Data.Entity; -using System.Data.Entity.Infrastructure; -using System.Threading; -using System.Web.Mvc; -using WebMatrix.WebData; -using GiveIT.UI.Web.Models; - -namespace GiveIT.UI.Web.Filters -{ - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] - public sealed class InitializeSimpleMembershipAttribute : ActionFilterAttribute - { - private static SimpleMembershipInitializer _initializer; - private static object _initializerLock = new object(); - private static bool _isInitialized; - - public override void OnActionExecuting(ActionExecutingContext filterContext) - { - // Ensure ASP.NET Simple Membership is initialized only once per app start - LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock); - } - - private class SimpleMembershipInitializer - { - public SimpleMembershipInitializer() - { - Database.SetInitializer(null); - - try - { - using (var context = new UsersContext()) - { - if (!context.Database.Exists()) - { - // Create the SimpleMembership database without Entity Framework migration schema - ((IObjectContextAdapter)context).ObjectContext.CreateDatabase(); - } - } - - WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true); - } - catch (Exception ex) - { - throw new InvalidOperationException("The ASP.NET Simple Membership database could not be initialized. For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588", ex); - } - } - } - } -} diff --git a/src/UI/Web/Global.asax.cs b/src/UI/Web/Global.asax.cs index 0a42c20..3f8dbe5 100644 --- a/src/UI/Web/Global.asax.cs +++ b/src/UI/Web/Global.asax.cs @@ -6,6 +6,7 @@ using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; +using WebMatrix.WebData; namespace GiveIT.UI.Web { @@ -16,6 +17,7 @@ public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { + WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true); AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); diff --git a/src/UI/Web/Images/howItWorks.png b/src/UI/Web/Images/howItWorks.png deleted file mode 100644 index 26bf181..0000000 Binary files a/src/UI/Web/Images/howItWorks.png and /dev/null differ diff --git a/src/UI/Web/Migrations/201307041906449_InitialCreate.Designer.cs b/src/UI/Web/Migrations/201307041906449_InitialCreate.Designer.cs new file mode 100644 index 0000000..5b26bc6 --- /dev/null +++ b/src/UI/Web/Migrations/201307041906449_InitialCreate.Designer.cs @@ -0,0 +1,27 @@ +// +namespace GiveIT.UI.Web.Migrations +{ + using System.Data.Entity.Migrations; + using System.Data.Entity.Migrations.Infrastructure; + using System.Resources; + + public sealed partial class InitialCreate : IMigrationMetadata + { + private readonly ResourceManager Resources = new ResourceManager(typeof(InitialCreate)); + + string IMigrationMetadata.Id + { + get { return "201307041906449_InitialCreate"; } + } + + string IMigrationMetadata.Source + { + get { return null; } + } + + string IMigrationMetadata.Target + { + get { return Resources.GetString("Target"); } + } + } +} diff --git a/src/UI/Web/Migrations/201307041906449_InitialCreate.cs b/src/UI/Web/Migrations/201307041906449_InitialCreate.cs new file mode 100644 index 0000000..a808af0 --- /dev/null +++ b/src/UI/Web/Migrations/201307041906449_InitialCreate.cs @@ -0,0 +1,53 @@ +namespace GiveIT.UI.Web.Migrations +{ + using System; + using System.Data.Entity.Migrations; + + public partial class InitialCreate : DbMigration + { + public override void Up() + { + CreateTable( + "dbo.UserProfile", + c => new + { + UserId = c.Int(nullable: false, identity: true), + UserName = c.String(), + ContactFirstName = c.String(), + ContactLastName = c.String(), + PhoneNumber = c.String(), + PhoneNoExtension = c.String(), + EmailAddress = c.String(), + }) + .PrimaryKey(t => t.UserId); + + CreateTable( + "dbo.Charity", + c => new + { + UserId = c.Int(nullable: false), + CharityId = c.Int(nullable: false, identity: true), + CharityName = c.String(), + MissionAndLocation = c.String(), + EIN = c.String(), + StreetAddress = c.String(), + StreetAddress2 = c.String(), + City = c.String(), + State = c.String(), + ZipCode = c.String(), + }) + .PrimaryKey(t => t.UserId) + .ForeignKey("dbo.UserProfile", t => t.UserId) + .Index(t => t.UserId); + + } + + public override void Down() + { + DropIndex("dbo.Charity", new[] { "UserId" }); + DropForeignKey("dbo.Charity", "UserId", "dbo.UserProfile"); + DropTable("dbo.Charity"); + DropTable("dbo.UserProfile"); + } + } +} diff --git a/src/UI/Web/Migrations/201307041906449_InitialCreate.resx b/src/UI/Web/Migrations/201307041906449_InitialCreate.resx new file mode 100644 index 0000000..cb8df28 --- /dev/null +++ b/src/UI/Web/Migrations/201307041906449_InitialCreate.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + H4sIAAAAAAAEAMVZwW7bOBC9L7D/IOjUHiolbg/dwG6ROklhbJ0EcdIF9hLQ0tghlqK0Ih3Y37aH/aT9hR1KlkSRsiPFjn2zOOSbGXJm+Dj+759/+1+XEXOeIRU05gP31DtxHeBBHFI+H7gLOfvw2f365ddf+pdhtHR+FvM+qnm4kouB+yRlcub7IniCiAgvokEai3gmvSCOfBLGfu/k5Df/9NQHhHARy3H6dwsuaQTZB34OYx5AIheEjeMQmFiPo2SSoTrXJAKRkAAG7nf6DKN772Hk/QFTL5/vOueMErRlAmzmOsmnswcBE5nGfD5JiKSE3a8SQPmMMAFry8+ST22NP+kp433CeSwRLuavct4t3ULHLnED5EqZlTk3cIdPJMUR1/lGBKjx3BsPPUn1lbj2No0TSOWqvnIUuk6+bsTlx57rXC8YI1MGpdu4LxMZp/AdOKREQnhLpIQUz3MUQmaP6/htVKmPQhluM8aK61zRJYQ/gM/lU6lwTJbFCP50nQdOMbRwkUwXoBuYf2/XPaZCBd85D3/EwfoUDmzC5ej64DpREYA8D8MUhDiu9t7B1Q+zmDy4z5gbB9f6J02GuPiN9fb9qvBsLUcNZed3WNUGNB/uYKatU5XIcNY3F5vuF+veuoIpPUcpX3jHSRLIK5oKeUwDfpAj6b99ijlcL6IpBtZxdMeXSwlcHOXmiAhlhyni21M8iwKK2VPkwwhp1MVUDcNSGhmfL5mA1JIHza/wdY7SaESprqJ0fs7pCu7nbyB//TFJEtwfjQyuR5xJzgSHHybdeViUY/iBaKBjpbWlJiw2ZA6GVOVSCFkmXxBJpkSd2DCMrGntNrdQpu+xWWirLS9mq9/5iiZG7BV00gCqdvEKHYuwZmY+QmlMRUStlRkdJ4ykG0r3MGaLiG+7BrahaCxWB9KGO2PlZa4BLRe0x2uinjpsk7w9esYqdbhsoP16gyHqSIbolZi9LaC9TueSXdC1A2m4srfblXGzujnZUHuMkmnpKOWgjdP3jZQxk9O3srNL+o6E+n0ze9eYxyqR3r8ii23+tm1L9pPCFbcycbomnE2WakFjSTsjVyyoAbgStsetsRsdsyboiqczFhtUl3YoNzUqUqs7Ncn+E6GQV3feNsZgTim1l8zBYAj99W39cg/Jur7zKa6DW/VMQ3V1T1ZCQuSpCd7kbzZkFP2tJowJpzMQ8j7+C/D1gezis9GEekWDyBciZNu7RMd9llG1BS8+wKxXW7cXGX8maYD39LuILN/v65W1D1Dz5bQTZsNraA949gtnJ9CmV0sHwNbNhkbKefDA7hi3Vtv1TbKjoeO605Fu7qLuFilVZ3QnnMZu5/4Qe/upB1pXckfbtE7jTkhG93APSXouRBzQLELqofioZmJJFDLFe1o+XqVx9KjS6fE+fmzO5EseOncxK+4vx2odjBdM0oTRANcO3FPL2wqg/JtEwyjH6jAnnmcjYeWAVOUiYZUPdpmhPKAJYbrVNh1qW43UJpeQpuQCEuCqOhgO7qauRDXK4kvu933t3F/uHtl9kJcbSBv7RzkJG7jhNMbjzeNVSdDvGWV2CpjgZRhY+KWkSUUpNOC1jbB0tMoBR0OoG9I9hRqSyHzs2VHQkDUNfR7r6qw7/rqmnk3FMfa0P30x7AWdVxDqL2AOQS3qyjkjPouL4DcsKqaYtxxIEmJInqeSzpC6oTjA8p+1W38Stsi4zRTCEb9ZyGQh0WWIpqy2GSqJtunPOpd1m/s3ifoS+3ABzaToAtzwbwvKwtLuK5s1bIJQ2bmmIuospaIk81WJdI2MsR3QevvKonIPUcIQTNzwCXmGzba9vIf1HetfUDJPSSTWGNV6/MTwC6Pll/8BBhkjtLYgAAA= + + \ No newline at end of file diff --git a/src/UI/Web/Migrations/Configuration.cs b/src/UI/Web/Migrations/Configuration.cs new file mode 100644 index 0000000..133e6aa --- /dev/null +++ b/src/UI/Web/Migrations/Configuration.cs @@ -0,0 +1,56 @@ +namespace GiveIT.UI.Web.Migrations +{ + using GiveIT.UI.Web.Models; + using System; + using System.Data.Entity; + using System.Data.Entity.Migrations; + using System.Linq; + + internal sealed class Configuration : DbMigrationsConfiguration + { + public Configuration() + { + AutomaticMigrationsEnabled = true; + } + + protected override void Seed(GiveIT.UI.Web.Models.UIWebDbContext context) + { + // This method will be called after migrating to the latest version. + + // You can use the DbSet.AddOrUpdate() helper extension method + // to avoid creating duplicate seed data. E.g. + // + // context.People.AddOrUpdate( + // p => p.FullName, + // new Person { FullName = "Andrew Peters" }, + // new Person { FullName = "Brice Lambson" }, + // new Person { FullName = "Rowan Miller" } + // ); + // + + // context.Users.AddOrUpdate(r => r.ContactFirstName, + // new User + // { + // ContactFirstName = "Joe", + // ContactLastName = "Doe", + // Title = "CEO", + // PhoneNumber = "(111)111-1111", + // PhoneNoExtension = "", + // EmailAddress = "test@test.com" + // }); + + // context.Charities.AddOrUpdate(r => r.CharityName, + // new Charity + // { + // CharityName = "testC", + // MissionAndLocation = "blahblahblah", + // EIN = "00-0000000", + // StreetAddress = "123 Main St.", + // StreetAddress2 = "", + // City = "Detroit", + // State = "MI", + // ZipCode = "48202" + // }); + } + } +} diff --git a/src/UI/Web/Models/AccountModels.cs b/src/UI/Web/Models/AccountModels.cs index 3b80c44..4575a01 100644 --- a/src/UI/Web/Models/AccountModels.cs +++ b/src/UI/Web/Models/AccountModels.cs @@ -8,25 +8,6 @@ namespace GiveIT.UI.Web.Models { - public class UsersContext : DbContext - { - public UsersContext() /// This is a test if this is here in the master it didn't work - : base("DefaultConnection") - { - } - - public DbSet UserProfiles { get; set; } - } - - [Table("UserProfile")] - public class UserProfile - { - [Key] - [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] - public int UserId { get; set; } - public string UserName { get; set; } - } - public class RegisterExternalLoginModel { [Required] diff --git a/src/UI/Web/Models/CharityRegister.cs b/src/UI/Web/Models/CharityRegister.cs new file mode 100644 index 0000000..27d439b --- /dev/null +++ b/src/UI/Web/Models/CharityRegister.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Web; + +namespace GiveIT.UI.Web.Models +{ + public class CharityRegister + { + [Required] + [Display(Name = "Charity Name *")] + [StringLength(100)] + public string CharityName { get; set; } + + [Display(Name = "Mission, Location of Population Served")] + [DataType(DataType.MultilineText)] + public string MissionAndLocation { get; set; } + + [Required] + [RegularExpression(@"^\d{2}-\d{7}$", + ErrorMessage = "EIN entered is not valid. Please try again.")] + [StringLength(10)] + public string EIN { get; set; } + + + [Required] + [Display(Name = "Main Contact First Name *")] + [StringLength(30)] + public string ContactFirstName { get; set; } + + [Required] + [Display(Name = "Main Contact Last Name *")] + [StringLength(50)] + public string ContactLastName { get; set; } + + [StringLength(50)] + public string Title { get; set; } + + [Required] + [Display(Name = "Telephone Number *")] + [RegularExpression(@"^\(?([1-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$", + ErrorMessage = "Entered phone number format is not valid. Please try again.")] + [StringLength(20)] + public string PhoneNumber { get; set; } + + [Display(Name = "Extension")] + [StringLength(10)] + public string PhoneNoExtension { get; set; } + + [Required] + [Display(Name = "Email Address *")] + [RegularExpression(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessage = "Please enter a valid email address.")] + [StringLength(100)] + public string EmailAddress { get; set; } + + + [Required] + [Display(Name = "Confirm Email Address *")] + [Compare("EmailAddress", ErrorMessage = "The Email address and confirmation email address do not match.")] + [StringLength(100)] + public string ConfirmEmailAddress { 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; } + + [Required] + [DataType(DataType.Password)] + [Display(Name = "Confirm password *")] + [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] + public string ConfirmPassword { get; set; } + + + [Display(Name = "Street Address")] + [StringLength(80)] + public string StreetAddress { get; set; } + + [Display(Name = "Street Address 2")] + [StringLength(80)] + public string StreetAddress2 { get; set; } + + [StringLength(30)] + public string City { get; set; } + + [StringLength(20)] + public string State { get; set; } + + [RegularExpression(@"^(\d{5}-\d{4}|\d{5}|\d{9})$|^([a-zA-Z]\d[a-zA-Z] \d[a-zA-Z]\d)$", + ErrorMessage = "Please enter a valid zip code consists of 5 or 9 numeric characters.")] + [StringLength(10)] + [Display(Name = "Zip Code")] + public string ZipCode { get; set; } + + } +} + + \ No newline at end of file diff --git a/src/UI/Web/Models/UIWebDbContext.cs b/src/UI/Web/Models/UIWebDbContext.cs new file mode 100644 index 0000000..b78b064 --- /dev/null +++ b/src/UI/Web/Models/UIWebDbContext.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Data.Entity; +using System.Linq; +using System.Web; + +namespace GiveIT.UI.Web.Models +{ + public class UIWebDbContext : DbContext + { + public UIWebDbContext() + : base("name=DefaultConnection") + { + } + public DbSet Charities { get; set; } + public DbSet Users { get; set; } + } +} \ No newline at end of file diff --git a/src/UI/Web/Models/User/Charity.cs b/src/UI/Web/Models/User/Charity.cs new file mode 100644 index 0000000..65bb537 --- /dev/null +++ b/src/UI/Web/Models/User/Charity.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Web; + +namespace GiveIT.UI.Web.Models +{ + [Table("Charity")] + public class Charity + { + [Key] + [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] + public int CharityId { get; set; } + + [StringLength(100)] + public string CharityName { get; set; } + + public string MissionAndLocation { get; set; } + + [StringLength(10)] + public string EIN { get; set; } + + [StringLength(80)] + public string StreetAddress { get; set; } + + [StringLength(80)] + public string StreetAddress2 { get; set; } + + [StringLength(30)] + public string City { get; set; } + + [StringLength(20)] + public string State { get; set; } + + [StringLength(10)] + public string ZipCode { get; set; } + + } +} diff --git a/src/UI/Web/Models/User/User.cs b/src/UI/Web/Models/User/User.cs new file mode 100644 index 0000000..ac55c79 --- /dev/null +++ b/src/UI/Web/Models/User/User.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Web; + +namespace GiveIT.UI.Web.Models +{ + [Table("UserProfile")] + public class User + { + [Key] + [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] + public int UserId { get; set; } + + public string UserName { get; set; } + + [StringLength(30)] + public string ContactFirstName { get; set; } + + [StringLength(30)] + public string ContactLastName { get; set; } + + [StringLength(30)] + public string Title { get; set; } + + [StringLength(20)] + public string PhoneNumber { get; set; } + + [StringLength(10)] + public string PhoneNoExtension { get; set; } + + [StringLength(100)] + public string EmailAddress { get; set; } + } +} \ No newline at end of file diff --git a/src/UI/Web/UI.Web.csproj b/src/UI/Web/UI.Web.csproj index 19fa7ab..1dc62c2 100644 --- a/src/UI/Web/UI.Web.csproj +++ b/src/UI/Web/UI.Web.csproj @@ -164,12 +164,21 @@ + - Global.asax + + + 201307041906449_InitialCreate.cs + + + + + + @@ -230,7 +239,6 @@ - @@ -277,20 +285,27 @@ - + + + + + + 201307041906449_InitialCreate.cs + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/UI/Web/Views/CharityRegister/RegisterC.cshtml b/src/UI/Web/Views/CharityRegister/RegisterC.cshtml new file mode 100644 index 0000000..e3138ef --- /dev/null +++ b/src/UI/Web/Views/CharityRegister/RegisterC.cshtml @@ -0,0 +1,159 @@ +@model GiveIT.UI.Web.Models.CharityRegister + +@{ + ViewBag.Title = "Register"; +} + +

Join Today and Connect with Volunteers

+ +@using (Html.BeginForm()) { + @Html.AntiForgeryToken() + @Html.ValidationSummary(true) + +
+ Charity + +
+ @Html.LabelFor(model => model.CharityName) +
+
+ @Html.EditorFor(model => model.CharityName) + @Html.ValidationMessageFor(model => model.CharityName) +
+ +
+ @Html.LabelFor(model => model.MissionAndLocation) +
+
+ @Html.EditorFor(model => model.MissionAndLocation) + @Html.ValidationMessageFor(model => model.MissionAndLocation) +
+ +
+ @Html.LabelFor(model => model.EIN) +
+
+ @Html.EditorFor(model => model.EIN) + @Html.ValidationMessageFor(model => model.EIN) +
+ +
+ @Html.LabelFor(model => model.ContactFirstName) +
+
+ @Html.EditorFor(model => model.ContactFirstName) + @Html.ValidationMessageFor(model => model.ContactFirstName) +
+ +
+ @Html.LabelFor(model => model.ContactLastName) +
+
+ @Html.EditorFor(model => model.ContactLastName) + @Html.ValidationMessageFor(model => model.ContactLastName) +
+ +
+ @Html.LabelFor(model => model.Title) +
+
+ @Html.EditorFor(model => model.Title) + @Html.ValidationMessageFor(model => model.Title) +
+ +
+ @Html.LabelFor(model => model.PhoneNumber) +
+
+ @Html.EditorFor(model => model.PhoneNumber) + @Html.ValidationMessageFor(model => model.PhoneNumber) +
+ +
+ @Html.LabelFor(model => model.PhoneNoExtension) +
+
+ @Html.EditorFor(model => model.PhoneNoExtension) + @Html.ValidationMessageFor(model => model.PhoneNoExtension) +
+ +
+ @Html.LabelFor(model => model.EmailAddress) +
+
+ @Html.EditorFor(model => model.EmailAddress) + @Html.ValidationMessageFor(model => model.EmailAddress) +
+
+ @Html.LabelFor(model => model.ConfirmEmailAddress) +
+
+ @Html.EditorFor(model => model.ConfirmEmailAddress) + @Html.ValidationMessageFor(model => model.ConfirmEmailAddress) +
+ +
+ @Html.LabelFor(model => model.Password) +
+
+ @Html.EditorFor(model => model.Password) + @Html.ValidationMessageFor(model => model.Password) +
+ +
+ @Html.LabelFor(model => model.ConfirmPassword) +
+
+ @Html.EditorFor(model => model.ConfirmPassword) + @Html.ValidationMessageFor(model => model.ConfirmPassword) +
+ +
+ @Html.LabelFor(model => model.StreetAddress) +
+
+ @Html.EditorFor(model => model.StreetAddress) + @Html.ValidationMessageFor(model => model.StreetAddress) +
+ +
+ @Html.LabelFor(model => model.StreetAddress2) +
+
+ @Html.EditorFor(model => model.StreetAddress2) + @Html.ValidationMessageFor(model => model.StreetAddress2) +
+ +
+ @Html.LabelFor(model => model.City) +
+
+ @Html.EditorFor(model => model.City) + @Html.ValidationMessageFor(model => model.City) +
+ +
+ @Html.LabelFor(model => model.State) +
+
+ @Html.EditorFor(model => model.State) + @Html.ValidationMessageFor(model => model.State) +
+ +
+ @Html.LabelFor(model => model.ZipCode) +
+
+ @Html.EditorFor(model => model.ZipCode) + @Html.ValidationMessageFor(model => model.ZipCode) +
+ +

+ +

+
+} + +@section Scripts { + @Scripts.Render("~/bundles/jqueryval") +} diff --git a/src/UI/Web/Views/Home/About.cshtml b/src/UI/Web/Views/Home/About.cshtml new file mode 100644 index 0000000..273ba3e --- /dev/null +++ b/src/UI/Web/Views/Home/About.cshtml @@ -0,0 +1,34 @@ +@{ + ViewBag.Title = "About"; +} + +
+

@ViewBag.Title.

+

@ViewBag.Message

+
+ +
+

+ Use this area to provide additional information. +

+ +

+ Use this area to provide additional information. +

+ +

+ Use this area to provide additional information. +

+
+ + \ No newline at end of file diff --git a/src/UI/Web/Views/Home/HowItWorks.cshtml b/src/UI/Web/Views/Home/HowItWorks.cshtml deleted file mode 100644 index 566ce3c..0000000 --- a/src/UI/Web/Views/Home/HowItWorks.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewBag.Title = "How It Works"; -} - - -
- how it works infographic -
diff --git a/src/UI/Web/Views/Home/Index.cshtml b/src/UI/Web/Views/Home/Index.cshtml index f7aa29c..e3a57ed 100644 --- a/src/UI/Web/Views/Home/Index.cshtml +++ b/src/UI/Web/Views/Home/Index.cshtml @@ -1,45 +1,11 @@ -@{ - ViewBag.Title = "Home Page"; -} -@section featured { - +@model IEnumerable + +@{ + ViewBag.Title = "Index"; } -

We suggest the following:

-
    -
  1. -
    Getting Started
    - ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that - enables a clean separation of concerns and that gives you full control over markup - for enjoyable, agile development. ASP.NET MVC includes many features that enable - fast, TDD-friendly development for creating sophisticated applications that use - the latest web standards. - Learn more… -
  2. -
  3. -
    Add NuGet packages and jump-start your coding
    - NuGet makes it easy to install and update free libraries and tools. - Learn more… -
  4. -
  5. -
    Find Web Hosting
    - You can easily find a web hosting company that offers the right mix of features - and price for your applications. - Learn more… -
  6. -
+ +
+

Hahahaha!

+
diff --git a/src/UI/Web/Views/Shared/_Layout.cshtml b/src/UI/Web/Views/Shared/_Layout.cshtml index 6d90eea..247a91f 100644 --- a/src/UI/Web/Views/Shared/_Layout.cshtml +++ b/src/UI/Web/Views/Shared/_Layout.cshtml @@ -21,7 +21,7 @@ diff --git a/src/UI/Web/Web.config b/src/UI/Web/Web.config index 4f125a8..05a001a 100644 --- a/src/UI/Web/Web.config +++ b/src/UI/Web/Web.config @@ -9,7 +9,7 @@
- +