├── .gitattributes ├── .gitignore ├── A2_HTML5_Biz_App_New.csproj ├── A2_HTML5_Biz_App_New.csproj.user ├── App_Data ├── PropertyStore.mdf ├── PropertyStore_log.ldf ├── aspnet-A2_HTML5_Biz_App_New-20140909055758.mdf └── aspnet-A2_HTML5_Biz_App_New-20140909055758_log.ldf ├── App_Start ├── BundleConfig.cs ├── FilterConfig.cs ├── IdentityConfig.cs ├── RouteConfig.cs ├── Startup.Auth.cs └── WebApiConfig.cs ├── Content ├── MyStyles │ ├── Agents.css │ ├── Customers.css │ ├── MyCss.css │ └── Owner.css ├── Site.css ├── bootstrap-theme.css ├── bootstrap-theme.css.map ├── bootstrap-theme.min.css ├── bootstrap.css ├── bootstrap.css.map └── bootstrap.min.css ├── Controllers ├── AccountController.cs ├── CustomAPIController.cs ├── CustomerController.cs ├── CustomerInfoAPIController.cs ├── HomeController.cs ├── ManageController.cs ├── OwnerController.cs ├── OwnerInfoAPIController.cs ├── OwnerPropertyDescriptionAPIController.cs ├── OwnerPropertyDescriptionController.cs └── RoleControllerController.cs ├── Global.asax ├── Global.asax.cs ├── Models ├── AccountViewModels.cs ├── CustomModelClasses.cs ├── CustomerInfo.cs ├── IdentityModels.cs ├── ManageViewModels.cs ├── OwnerInfo.cs ├── OwnerPropertyDescription.cs ├── PropertyStoreEDMX.Context.cs ├── PropertyStoreEDMX.Context.tt ├── PropertyStoreEDMX.Designer.cs ├── PropertyStoreEDMX.cs ├── PropertyStoreEDMX.edmx ├── PropertyStoreEDMX.edmx.diagram └── PropertyStoreEDMX.tt ├── Project_Readme.html ├── Properties └── AssemblyInfo.cs ├── Scripts ├── MyScripts │ ├── Customers.js │ ├── OwnerPropertyDescription.js │ ├── Owners.js │ └── PropertySearch.js ├── _references.js ├── bootstrap.js ├── bootstrap.min.js ├── jquery-2.1.4.intellisense.js ├── jquery-2.1.4.js ├── jquery-2.1.4.min.js ├── jquery-2.1.4.min.map ├── jquery.validate-vsdoc.js ├── jquery.validate.js ├── jquery.validate.min.js ├── jquery.validate.unobtrusive.js ├── jquery.validate.unobtrusive.min.js ├── knockout-3.3.0.debug.js ├── knockout-3.3.0.js ├── modernizr-2.6.2.js ├── respond.js └── respond.min.js ├── Startup.cs ├── Views ├── Account │ ├── ConfirmEmail.cshtml │ ├── ExternalLoginConfirmation.cshtml │ ├── ExternalLoginFailure.cshtml │ ├── ForgotPassword.cshtml │ ├── ForgotPasswordConfirmation.cshtml │ ├── Login.cshtml │ ├── Register.cshtml │ ├── ResetPassword.cshtml │ ├── ResetPasswordConfirmation.cshtml │ ├── SendCode.cshtml │ ├── VerifyCode.cshtml │ ├── _ChangePasswordPartial.cshtml │ ├── _ExternalLoginsListPartial.cshtml │ ├── _RemoveAccountPartial.cshtml │ └── _SetPasswordPartial.cshtml ├── Agent │ └── Index.cshtml ├── Customer │ ├── Index.cshtml │ └── SearchProperties.cshtml ├── Home │ ├── About.cshtml │ ├── Contact.cshtml │ └── Index.cshtml ├── Manage │ ├── AddPhoneNumber.cshtml │ ├── ChangePassword.cshtml │ ├── Index.cshtml │ ├── ManageLogins.cshtml │ ├── SetPassword.cshtml │ └── VerifyPhoneNumber.cshtml ├── Owner │ └── Index.cshtml ├── OwnerPropertyDescription │ └── Index.cshtml ├── Role │ ├── AssignUserToRole.cshtml │ ├── Create.cshtml │ └── Index.cshtml ├── Shared │ ├── Error.cshtml │ ├── Lockout.cshtml │ ├── _Layout.cshtml │ └── _LoginPartial.cshtml ├── Web.config └── _ViewStart.cshtml ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── favicon.ico ├── fonts ├── glyphicons-halflings-regular.eot ├── glyphicons-halflings-regular.svg ├── glyphicons-halflings-regular.ttf ├── glyphicons-halflings-regular.woff └── glyphicons-halflings-regular.woff2 └── packages.config /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /A2_HTML5_Biz_App_New.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 600 5 | True 6 | False 7 | False 8 | 9 | False 10 | 600 11 | A2_HTML5_Biz_App_New.Models.PropertyStoreEntities 12 | ProjectFiles 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | CurrentPage 21 | True 22 | False 23 | False 24 | False 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | True 34 | True 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /App_Data/PropertyStore.mdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/html5-mvc-business-app/686a23b0eb02adaa922c4956e321170bd12d07d4/App_Data/PropertyStore.mdf -------------------------------------------------------------------------------- /App_Data/PropertyStore_log.ldf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/html5-mvc-business-app/686a23b0eb02adaa922c4956e321170bd12d07d4/App_Data/PropertyStore_log.ldf -------------------------------------------------------------------------------- /App_Data/aspnet-A2_HTML5_Biz_App_New-20140909055758.mdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/html5-mvc-business-app/686a23b0eb02adaa922c4956e321170bd12d07d4/App_Data/aspnet-A2_HTML5_Biz_App_New-20140909055758.mdf -------------------------------------------------------------------------------- /App_Data/aspnet-A2_HTML5_Biz_App_New-20140909055758_log.ldf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/html5-mvc-business-app/686a23b0eb02adaa922c4956e321170bd12d07d4/App_Data/aspnet-A2_HTML5_Biz_App_New-20140909055758_log.ldf -------------------------------------------------------------------------------- /App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace A2_HTML5_Biz_App_New 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js", 24 | "~/Scripts/respond.js")); 25 | 26 | bundles.Add(new StyleBundle("~/Content/css").Include( 27 | "~/Content/bootstrap.css", 28 | "~/Content/site.css")); 29 | 30 | // Set EnableOptimizations to false for debugging. For more information, 31 | // visit http://go.microsoft.com/fwlink/?LinkId=301862 32 | BundleTable.EnableOptimizations = true; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace A2_HTML5_Biz_App_New 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /App_Start/IdentityConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data.Entity; 4 | using System.Linq; 5 | using System.Security.Claims; 6 | using System.Threading.Tasks; 7 | using System.Web; 8 | using Microsoft.AspNet.Identity; 9 | using Microsoft.AspNet.Identity.EntityFramework; 10 | using Microsoft.AspNet.Identity.Owin; 11 | using Microsoft.Owin; 12 | using Microsoft.Owin.Security; 13 | using A2_HTML5_Biz_App_New.Models; 14 | 15 | namespace A2_HTML5_Biz_App_New 16 | { 17 | public class EmailService : IIdentityMessageService 18 | { 19 | public Task SendAsync(IdentityMessage message) 20 | { 21 | // Plug in your email service here to send an email. 22 | return Task.FromResult(0); 23 | } 24 | } 25 | 26 | public class SmsService : IIdentityMessageService 27 | { 28 | public Task SendAsync(IdentityMessage message) 29 | { 30 | // Plug in your SMS service here to send a text message. 31 | return Task.FromResult(0); 32 | } 33 | } 34 | 35 | // Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application. 36 | public class ApplicationUserManager : UserManager 37 | { 38 | public ApplicationUserManager(IUserStore store) 39 | : base(store) 40 | { 41 | } 42 | 43 | public static ApplicationUserManager Create(IdentityFactoryOptions options, IOwinContext context) 44 | { 45 | var manager = new ApplicationUserManager(new UserStore(context.Get())); 46 | // Configure validation logic for usernames 47 | manager.UserValidator = new UserValidator(manager) 48 | { 49 | AllowOnlyAlphanumericUserNames = false, 50 | RequireUniqueEmail = true 51 | }; 52 | 53 | // Configure validation logic for passwords 54 | manager.PasswordValidator = new PasswordValidator 55 | { 56 | RequiredLength = 6, 57 | RequireNonLetterOrDigit = true, 58 | RequireDigit = true, 59 | RequireLowercase = true, 60 | RequireUppercase = true, 61 | }; 62 | 63 | // Configure user lockout defaults 64 | manager.UserLockoutEnabledByDefault = true; 65 | manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5); 66 | manager.MaxFailedAccessAttemptsBeforeLockout = 5; 67 | 68 | // Register two factor authentication providers. This application uses Phone and Emails as a step of receiving a code for verifying the user 69 | // You can write your own provider and plug it in here. 70 | manager.RegisterTwoFactorProvider("Phone Code", new PhoneNumberTokenProvider 71 | { 72 | MessageFormat = "Your security code is {0}" 73 | }); 74 | manager.RegisterTwoFactorProvider("Email Code", new EmailTokenProvider 75 | { 76 | Subject = "Security Code", 77 | BodyFormat = "Your security code is {0}" 78 | }); 79 | manager.EmailService = new EmailService(); 80 | manager.SmsService = new SmsService(); 81 | var dataProtectionProvider = options.DataProtectionProvider; 82 | if (dataProtectionProvider != null) 83 | { 84 | manager.UserTokenProvider = 85 | new DataProtectorTokenProvider(dataProtectionProvider.Create("ASP.NET Identity")); 86 | } 87 | return manager; 88 | } 89 | } 90 | 91 | // Configure the application sign-in manager which is used in this application. 92 | public class ApplicationSignInManager : SignInManager 93 | { 94 | public ApplicationSignInManager(ApplicationUserManager userManager, IAuthenticationManager authenticationManager) 95 | : base(userManager, authenticationManager) 96 | { 97 | } 98 | 99 | public override Task CreateUserIdentityAsync(ApplicationUser user) 100 | { 101 | return user.GenerateUserIdentityAsync((ApplicationUserManager)UserManager); 102 | } 103 | 104 | public static ApplicationSignInManager Create(IdentityFactoryOptions options, IOwinContext context) 105 | { 106 | return new ApplicationSignInManager(context.GetUserManager(), context.Authentication); 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace A2_HTML5_Biz_App_New 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /App_Start/Startup.Auth.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.AspNet.Identity; 3 | using Microsoft.AspNet.Identity.Owin; 4 | using Microsoft.Owin; 5 | using Microsoft.Owin.Security.Cookies; 6 | using Microsoft.Owin.Security.Google; 7 | using Owin; 8 | using A2_HTML5_Biz_App_New.Models; 9 | 10 | namespace A2_HTML5_Biz_App_New 11 | { 12 | public partial class Startup 13 | { 14 | // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864 15 | public void ConfigureAuth(IAppBuilder app) 16 | { 17 | // Configure the db context, user manager and signin manager to use a single instance per request 18 | app.CreatePerOwinContext(ApplicationDbContext.Create); 19 | app.CreatePerOwinContext(ApplicationUserManager.Create); 20 | app.CreatePerOwinContext(ApplicationSignInManager.Create); 21 | 22 | // Enable the application to use a cookie to store information for the signed in user 23 | // and to use a cookie to temporarily store information about a user logging in with a third party login provider 24 | // Configure the sign in cookie 25 | app.UseCookieAuthentication(new CookieAuthenticationOptions 26 | { 27 | AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, 28 | LoginPath = new PathString("/Account/Login"), 29 | Provider = new CookieAuthenticationProvider 30 | { 31 | // Enables the application to validate the security stamp when the user logs in. 32 | // This is a security feature which is used when you change a password or add an external login to your account. 33 | OnValidateIdentity = SecurityStampValidator.OnValidateIdentity( 34 | validateInterval: TimeSpan.FromMinutes(30), 35 | regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager)) 36 | } 37 | }); 38 | app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); 39 | 40 | // Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process. 41 | app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5)); 42 | 43 | // Enables the application to remember the second login verification factor such as phone or email. 44 | // Once you check this option, your second step of verification during the login process will be remembered on the device where you logged in from. 45 | // This is similar to the RememberMe option when you log in. 46 | app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie); 47 | 48 | // Uncomment the following lines to enable logging in with third party login providers 49 | //app.UseMicrosoftAccountAuthentication( 50 | // clientId: "", 51 | // clientSecret: ""); 52 | 53 | //app.UseTwitterAuthentication( 54 | // consumerKey: "", 55 | // consumerSecret: ""); 56 | 57 | //app.UseFacebookAuthentication( 58 | // appId: "", 59 | // appSecret: ""); 60 | 61 | //app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions() 62 | //{ 63 | // ClientId = "", 64 | // ClientSecret = "" 65 | //}); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web.Http; 5 | 6 | namespace A2_HTML5_Biz_App_New 7 | { 8 | public static class WebApiConfig 9 | { 10 | public static void Register(HttpConfiguration config) 11 | { 12 | // Web API configuration and services 13 | 14 | // Web API routes 15 | config.MapHttpAttributeRoutes(); 16 | 17 | config.Routes.MapHttpRoute( 18 | name: "DefaultApi", 19 | routeTemplate: "api/{controller}/{id}", 20 | defaults: new { id = RouteParameter.Optional } 21 | ); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Content/MyStyles/Agents.css: -------------------------------------------------------------------------------- 1 | #tblagent, .c0 { 2 | border:double; 3 | width:400px; 4 | } 5 | -------------------------------------------------------------------------------- /Content/MyStyles/Customers.css: -------------------------------------------------------------------------------- 1 |  #tblcustomer, .c0 { 2 | border:double; 3 | } -------------------------------------------------------------------------------- /Content/MyStyles/MyCss.css: -------------------------------------------------------------------------------- 1 | .t1 { 2 | border:double; 3 | width:400px; 4 | } 5 | -------------------------------------------------------------------------------- /Content/MyStyles/Owner.css: -------------------------------------------------------------------------------- 1 |  #tblowner, .c0 { 2 | border:double; 3 | width:1000px; 4 | } 5 | #dverror { 6 | height:200px; 7 | width:500px; 8 | } -------------------------------------------------------------------------------- /Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | /* Set width on the form input elements since they're 100% wide by default */ 20 | input, 21 | select, 22 | textarea { 23 | max-width: 280px; 24 | } 25 | -------------------------------------------------------------------------------- /Controllers/CustomAPIController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Net.Http; 6 | using System.Web.Http; 7 | 8 | using A2_HTML5_Biz_App_New.Models; 9 | using System.Web.Http.Description; 10 | 11 | namespace A2_HTML5_Biz_App_New.Controllers 12 | { 13 | public class CustomAPIController : ApiController 14 | { 15 | PropertyStoreEntities ctx; 16 | 17 | public CustomAPIController() 18 | { 19 | ctx = new PropertyStoreEntities(); 20 | } 21 | 22 | // Action Method to get the Owner Information based upon the Login Email 23 | [Route("Owner/Get")] 24 | [ResponseType(typeof(OwnerInfo))] 25 | public IHttpActionResult GetOwner() 26 | { 27 | try 28 | { 29 | var user = this.User.Identity.Name; 30 | var Owner = (from o in ctx.OwnerInfoes.ToList() 31 | where o.Email == user 32 | select new OwnerInfo() 33 | { 34 | OwnerId = o.OwnerId, 35 | OwnerName = o.OwnerName, 36 | Address = o.Address, 37 | City = o.City, 38 | Email = o.Email, 39 | Contact1 = o.Contact1, 40 | Contact2 = o.Contact2 41 | }).First(); 42 | return Ok(Owner); 43 | } 44 | catch (Exception) 45 | { 46 | return Ok(new OwnerInfo()); 47 | } 48 | } 49 | 50 | //Get the Customer Info based upon the login Email 51 | 52 | [Route("Customer/Get")] 53 | [ResponseType(typeof(CustomerInfo))] 54 | public IHttpActionResult GetCustomer() 55 | { 56 | try 57 | { 58 | var user = this.User.Identity.Name; 59 | var Customer = (from c in ctx.CustomerInfoes.ToList() 60 | where c.Email == user 61 | select new CustomerInfo() 62 | { 63 | CustomerId = c.CustomerId, 64 | CustomerName = c.CustomerName, 65 | Address = c.Address, 66 | City = c.City, 67 | Contact1 = c.Contact1, 68 | Contact2 = c.Contact2, 69 | Email = c.Email 70 | }).First(); 71 | return Ok(Customer); 72 | } 73 | catch (Exception) 74 | { 75 | return Ok(new CustomerInfo()); 76 | } 77 | } 78 | 79 | 80 | 81 | 82 | //In the below method the propertytype will be : Flat, Row House, Bunglow 83 | // filter will be : AND, OR searchtype will be : Sale, Rent 84 | 85 | [Route("Property/{propertytype}/{filter}/{searchtype}")] 86 | public List GetProperties(string propertytype, string searchtype,string filter) 87 | { 88 | List Properties = new List(); 89 | 90 | switch (filter) 91 | { 92 | 93 | case "AND": 94 | Properties = (from p in ctx.OwnerPropertyDescriptions.ToList() 95 | where 96 | p.Status == searchtype && p.PropertyType == propertytype && p.Status == "Available" 97 | select new SearchProperty() 98 | { 99 | PropertyId = p.OwnerPropertyId, 100 | OwnerName = ctx.OwnerInfoes.Find(p.OwnerId).OwnerName, 101 | Address = p.Address, 102 | Contact1 = ctx.OwnerInfoes.Find(p.OwnerId).Contact1, 103 | Contact2 = ctx.OwnerInfoes.Find(p.OwnerId).Contact2, 104 | Email = ctx.OwnerInfoes.Find(p.OwnerId).Email, 105 | BedRoomNo = p.BedRoomNo, 106 | BuildupArea = p.PropertyBuildupArea, 107 | PropertyType = p.PropertyType, 108 | SaleRentStatus = p.PropertySaleRentStatus, 109 | TotalRooms = p.TotalRooms, 110 | Status = p.Status 111 | }).ToList(); 112 | break; 113 | 114 | case "OR": 115 | Properties = (from p in ctx.OwnerPropertyDescriptions.ToList() 116 | where (p.Status == searchtype || p.PropertyType == propertytype) && p.Status == "Available" 117 | select new SearchProperty() 118 | { 119 | PropertyId = p.OwnerPropertyId, 120 | OwnerName = ctx.OwnerInfoes.Find(p.OwnerId).OwnerName, 121 | Address = p.Address, 122 | Contact1 = ctx.OwnerInfoes.Find(p.OwnerId).Contact1, 123 | Contact2 = ctx.OwnerInfoes.Find(p.OwnerId).Contact2, 124 | Email = ctx.OwnerInfoes.Find(p.OwnerId).Email, 125 | BedRoomNo = p.BedRoomNo, 126 | BuildupArea = p.PropertyBuildupArea, 127 | PropertyType = p.PropertyType, 128 | SaleRentStatus = p.PropertySaleRentStatus, 129 | TotalRooms = p.TotalRooms, 130 | Status = p.Status 131 | }).ToList(); 132 | break; 133 | } 134 | return Properties; 135 | } 136 | 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /Controllers/CustomerController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace A2_HTML5_Biz_App_New.Controllers 8 | { 9 | [Authorize(Roles = "Customer")] 10 | public class CustomerController : Controller 11 | { 12 | // GET: Customer 13 | public ActionResult Index() 14 | { 15 | var user = this.User.Identity.Name; 16 | ViewBag.CurrentUserEmail = user; 17 | return View(); 18 | } 19 | 20 | public ActionResult SearchProperties() 21 | { 22 | return View(); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Controllers/CustomerInfoAPIController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.Entity; 5 | using System.Data.Entity.Infrastructure; 6 | using System.Linq; 7 | using System.Net; 8 | using System.Net.Http; 9 | using System.Web.Http; 10 | using System.Web.Http.Description; 11 | using A2_HTML5_Biz_App_New.Models; 12 | 13 | namespace A2_HTML5_Biz_App_New.Controllers 14 | { 15 | public class CustomerInfoAPIController : ApiController 16 | { 17 | private PropertyStoreEntities db = new PropertyStoreEntities(); 18 | 19 | // GET: api/CustomerInfoAPI 20 | public IQueryable GetCustomerInfoes() 21 | { 22 | return db.CustomerInfoes; 23 | } 24 | 25 | // GET: api/CustomerInfoAPI/5 26 | [ResponseType(typeof(CustomerInfo))] 27 | public IHttpActionResult GetCustomerInfo(int id) 28 | { 29 | CustomerInfo customerInfo = db.CustomerInfoes.Find(id); 30 | if (customerInfo == null) 31 | { 32 | return NotFound(); 33 | } 34 | 35 | return Ok(customerInfo); 36 | } 37 | 38 | // PUT: api/CustomerInfoAPI/5 39 | [ResponseType(typeof(void))] 40 | public IHttpActionResult PutCustomerInfo(int id, CustomerInfo customerInfo) 41 | { 42 | if (!ModelState.IsValid) 43 | { 44 | return BadRequest(ModelState); 45 | } 46 | 47 | if (id != customerInfo.CustomerId) 48 | { 49 | return BadRequest(); 50 | } 51 | 52 | db.Entry(customerInfo).State = EntityState.Modified; 53 | 54 | try 55 | { 56 | db.SaveChanges(); 57 | } 58 | catch (DbUpdateConcurrencyException) 59 | { 60 | if (!CustomerInfoExists(id)) 61 | { 62 | return NotFound(); 63 | } 64 | else 65 | { 66 | throw; 67 | } 68 | } 69 | 70 | return StatusCode(HttpStatusCode.NoContent); 71 | } 72 | 73 | // POST: api/CustomerInfoAPI 74 | [ResponseType(typeof(CustomerInfo))] 75 | public IHttpActionResult PostCustomerInfo(CustomerInfo customerInfo) 76 | { 77 | if (!ModelState.IsValid) 78 | { 79 | return BadRequest(ModelState); 80 | } 81 | 82 | customerInfo.RegistrationDate = DateTime.Now; 83 | db.CustomerInfoes.Add(customerInfo); 84 | db.SaveChanges(); 85 | 86 | return CreatedAtRoute("DefaultApi", new { id = customerInfo.CustomerId }, customerInfo); 87 | } 88 | 89 | // DELETE: api/CustomerInfoAPI/5 90 | [ResponseType(typeof(CustomerInfo))] 91 | public IHttpActionResult DeleteCustomerInfo(int id) 92 | { 93 | CustomerInfo customerInfo = db.CustomerInfoes.Find(id); 94 | if (customerInfo == null) 95 | { 96 | return NotFound(); 97 | } 98 | 99 | db.CustomerInfoes.Remove(customerInfo); 100 | db.SaveChanges(); 101 | 102 | return Ok(customerInfo); 103 | } 104 | 105 | protected override void Dispose(bool disposing) 106 | { 107 | if (disposing) 108 | { 109 | db.Dispose(); 110 | } 111 | base.Dispose(disposing); 112 | } 113 | 114 | private bool CustomerInfoExists(int id) 115 | { 116 | return db.CustomerInfoes.Count(e => e.CustomerId == id) > 0; 117 | } 118 | } 119 | } -------------------------------------------------------------------------------- /Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace A2_HTML5_Biz_App_New.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public ActionResult Index() 12 | { 13 | return View(); 14 | } 15 | 16 | public ActionResult About() 17 | { 18 | ViewBag.Message = "Your application description page."; 19 | 20 | return View(); 21 | } 22 | 23 | public ActionResult Contact() 24 | { 25 | ViewBag.Message = "Your contact page."; 26 | 27 | return View(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Controllers/ManageController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using Microsoft.AspNet.Identity; 7 | using Microsoft.AspNet.Identity.Owin; 8 | using Microsoft.Owin.Security; 9 | using A2_HTML5_Biz_App_New.Models; 10 | 11 | namespace A2_HTML5_Biz_App_New.Controllers 12 | { 13 | [Authorize] 14 | public class ManageController : Controller 15 | { 16 | public ManageController() 17 | { 18 | } 19 | 20 | public ManageController(ApplicationUserManager userManager) 21 | { 22 | UserManager = userManager; 23 | } 24 | 25 | private ApplicationUserManager _userManager; 26 | public ApplicationUserManager UserManager 27 | { 28 | get 29 | { 30 | return _userManager ?? HttpContext.GetOwinContext().GetUserManager(); 31 | } 32 | private set 33 | { 34 | _userManager = value; 35 | } 36 | } 37 | 38 | // 39 | // GET: /Manage/Index 40 | public async Task Index(ManageMessageId? message) 41 | { 42 | ViewBag.StatusMessage = 43 | message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." 44 | : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." 45 | : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." 46 | : message == ManageMessageId.Error ? "An error has occurred." 47 | : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." 48 | : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." 49 | : ""; 50 | 51 | var model = new IndexViewModel 52 | { 53 | HasPassword = HasPassword(), 54 | PhoneNumber = await UserManager.GetPhoneNumberAsync(User.Identity.GetUserId()), 55 | TwoFactor = await UserManager.GetTwoFactorEnabledAsync(User.Identity.GetUserId()), 56 | Logins = await UserManager.GetLoginsAsync(User.Identity.GetUserId()), 57 | BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(User.Identity.GetUserId()) 58 | }; 59 | return View(model); 60 | } 61 | 62 | // 63 | // GET: /Manage/RemoveLogin 64 | public ActionResult RemoveLogin() 65 | { 66 | var linkedAccounts = UserManager.GetLogins(User.Identity.GetUserId()); 67 | ViewBag.ShowRemoveButton = HasPassword() || linkedAccounts.Count > 1; 68 | return View(linkedAccounts); 69 | } 70 | 71 | // 72 | // POST: /Manage/RemoveLogin 73 | [HttpPost] 74 | [ValidateAntiForgeryToken] 75 | public async Task RemoveLogin(string loginProvider, string providerKey) 76 | { 77 | ManageMessageId? message; 78 | var result = await UserManager.RemoveLoginAsync(User.Identity.GetUserId(), new UserLoginInfo(loginProvider, providerKey)); 79 | if (result.Succeeded) 80 | { 81 | var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); 82 | if (user != null) 83 | { 84 | await SignInAsync(user, isPersistent: false); 85 | } 86 | message = ManageMessageId.RemoveLoginSuccess; 87 | } 88 | else 89 | { 90 | message = ManageMessageId.Error; 91 | } 92 | return RedirectToAction("ManageLogins", new { Message = message }); 93 | } 94 | 95 | // 96 | // GET: /Manage/AddPhoneNumber 97 | public ActionResult AddPhoneNumber() 98 | { 99 | return View(); 100 | } 101 | 102 | // 103 | // POST: /Manage/AddPhoneNumber 104 | [HttpPost] 105 | [ValidateAntiForgeryToken] 106 | public async Task AddPhoneNumber(AddPhoneNumberViewModel model) 107 | { 108 | if (!ModelState.IsValid) 109 | { 110 | return View(model); 111 | } 112 | // Generate the token and send it 113 | var code = await UserManager.GenerateChangePhoneNumberTokenAsync(User.Identity.GetUserId(), model.Number); 114 | if (UserManager.SmsService != null) 115 | { 116 | var message = new IdentityMessage 117 | { 118 | Destination = model.Number, 119 | Body = "Your security code is: " + code 120 | }; 121 | await UserManager.SmsService.SendAsync(message); 122 | } 123 | return RedirectToAction("VerifyPhoneNumber", new { PhoneNumber = model.Number }); 124 | } 125 | 126 | // 127 | // POST: /Manage/EnableTwoFactorAuthentication 128 | [HttpPost] 129 | public async Task EnableTwoFactorAuthentication() 130 | { 131 | await UserManager.SetTwoFactorEnabledAsync(User.Identity.GetUserId(), true); 132 | var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); 133 | if (user != null) 134 | { 135 | await SignInAsync(user, isPersistent: false); 136 | } 137 | return RedirectToAction("Index", "Manage"); 138 | } 139 | 140 | // 141 | // POST: /Manage/DisableTwoFactorAuthentication 142 | [HttpPost] 143 | public async Task DisableTwoFactorAuthentication() 144 | { 145 | await UserManager.SetTwoFactorEnabledAsync(User.Identity.GetUserId(), false); 146 | var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); 147 | if (user != null) 148 | { 149 | await SignInAsync(user, isPersistent: false); 150 | } 151 | return RedirectToAction("Index", "Manage"); 152 | } 153 | 154 | // 155 | // GET: /Manage/VerifyPhoneNumber 156 | public async Task VerifyPhoneNumber(string phoneNumber) 157 | { 158 | var code = await UserManager.GenerateChangePhoneNumberTokenAsync(User.Identity.GetUserId(), phoneNumber); 159 | // Send an SMS through the SMS provider to verify the phone number 160 | return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel { PhoneNumber = phoneNumber }); 161 | } 162 | 163 | // 164 | // POST: /Manage/VerifyPhoneNumber 165 | [HttpPost] 166 | [ValidateAntiForgeryToken] 167 | public async Task VerifyPhoneNumber(VerifyPhoneNumberViewModel model) 168 | { 169 | if (!ModelState.IsValid) 170 | { 171 | return View(model); 172 | } 173 | var result = await UserManager.ChangePhoneNumberAsync(User.Identity.GetUserId(), model.PhoneNumber, model.Code); 174 | if (result.Succeeded) 175 | { 176 | var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); 177 | if (user != null) 178 | { 179 | await SignInAsync(user, isPersistent: false); 180 | } 181 | return RedirectToAction("Index", new { Message = ManageMessageId.AddPhoneSuccess }); 182 | } 183 | // If we got this far, something failed, redisplay form 184 | ModelState.AddModelError("", "Failed to verify phone"); 185 | return View(model); 186 | } 187 | 188 | // 189 | // GET: /Manage/RemovePhoneNumber 190 | public async Task RemovePhoneNumber() 191 | { 192 | var result = await UserManager.SetPhoneNumberAsync(User.Identity.GetUserId(), null); 193 | if (!result.Succeeded) 194 | { 195 | return RedirectToAction("Index", new { Message = ManageMessageId.Error }); 196 | } 197 | var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); 198 | if (user != null) 199 | { 200 | await SignInAsync(user, isPersistent: false); 201 | } 202 | return RedirectToAction("Index", new { Message = ManageMessageId.RemovePhoneSuccess }); 203 | } 204 | 205 | // 206 | // GET: /Manage/ChangePassword 207 | public ActionResult ChangePassword() 208 | { 209 | return View(); 210 | } 211 | 212 | // 213 | // POST: /Manage/ChangePassword 214 | [HttpPost] 215 | [ValidateAntiForgeryToken] 216 | public async Task ChangePassword(ChangePasswordViewModel model) 217 | { 218 | if (!ModelState.IsValid) 219 | { 220 | return View(model); 221 | } 222 | var result = await UserManager.ChangePasswordAsync(User.Identity.GetUserId(), model.OldPassword, model.NewPassword); 223 | if (result.Succeeded) 224 | { 225 | var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); 226 | if (user != null) 227 | { 228 | await SignInAsync(user, isPersistent: false); 229 | } 230 | return RedirectToAction("Index", new { Message = ManageMessageId.ChangePasswordSuccess }); 231 | } 232 | AddErrors(result); 233 | return View(model); 234 | } 235 | 236 | // 237 | // GET: /Manage/SetPassword 238 | public ActionResult SetPassword() 239 | { 240 | return View(); 241 | } 242 | 243 | // 244 | // POST: /Manage/SetPassword 245 | [HttpPost] 246 | [ValidateAntiForgeryToken] 247 | public async Task SetPassword(SetPasswordViewModel model) 248 | { 249 | if (ModelState.IsValid) 250 | { 251 | var result = await UserManager.AddPasswordAsync(User.Identity.GetUserId(), model.NewPassword); 252 | if (result.Succeeded) 253 | { 254 | var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); 255 | if (user != null) 256 | { 257 | await SignInAsync(user, isPersistent: false); 258 | } 259 | return RedirectToAction("Index", new { Message = ManageMessageId.SetPasswordSuccess }); 260 | } 261 | AddErrors(result); 262 | } 263 | 264 | // If we got this far, something failed, redisplay form 265 | return View(model); 266 | } 267 | 268 | // 269 | // GET: /Manage/ManageLogins 270 | public async Task ManageLogins(ManageMessageId? message) 271 | { 272 | ViewBag.StatusMessage = 273 | message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." 274 | : message == ManageMessageId.Error ? "An error has occurred." 275 | : ""; 276 | var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); 277 | if (user == null) 278 | { 279 | return View("Error"); 280 | } 281 | var userLogins = await UserManager.GetLoginsAsync(User.Identity.GetUserId()); 282 | var otherLogins = AuthenticationManager.GetExternalAuthenticationTypes().Where(auth => userLogins.All(ul => auth.AuthenticationType != ul.LoginProvider)).ToList(); 283 | ViewBag.ShowRemoveButton = user.PasswordHash != null || userLogins.Count > 1; 284 | return View(new ManageLoginsViewModel 285 | { 286 | CurrentLogins = userLogins, 287 | OtherLogins = otherLogins 288 | }); 289 | } 290 | 291 | // 292 | // POST: /Manage/LinkLogin 293 | [HttpPost] 294 | [ValidateAntiForgeryToken] 295 | public ActionResult LinkLogin(string provider) 296 | { 297 | // Request a redirect to the external login provider to link a login for the current user 298 | return new AccountController.ChallengeResult(provider, Url.Action("LinkLoginCallback", "Manage"), User.Identity.GetUserId()); 299 | } 300 | 301 | // 302 | // GET: /Manage/LinkLoginCallback 303 | public async Task LinkLoginCallback() 304 | { 305 | var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(XsrfKey, User.Identity.GetUserId()); 306 | if (loginInfo == null) 307 | { 308 | return RedirectToAction("ManageLogins", new { Message = ManageMessageId.Error }); 309 | } 310 | var result = await UserManager.AddLoginAsync(User.Identity.GetUserId(), loginInfo.Login); 311 | return result.Succeeded ? RedirectToAction("ManageLogins") : RedirectToAction("ManageLogins", new { Message = ManageMessageId.Error }); 312 | } 313 | 314 | #region Helpers 315 | // Used for XSRF protection when adding external logins 316 | private const string XsrfKey = "XsrfId"; 317 | 318 | private IAuthenticationManager AuthenticationManager 319 | { 320 | get 321 | { 322 | return HttpContext.GetOwinContext().Authentication; 323 | } 324 | } 325 | 326 | private async Task SignInAsync(ApplicationUser user, bool isPersistent) 327 | { 328 | AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie, DefaultAuthenticationTypes.TwoFactorCookie); 329 | AuthenticationManager.SignIn(new AuthenticationProperties { IsPersistent = isPersistent }, await user.GenerateUserIdentityAsync(UserManager)); 330 | } 331 | 332 | private void AddErrors(IdentityResult result) 333 | { 334 | foreach (var error in result.Errors) 335 | { 336 | ModelState.AddModelError("", error); 337 | } 338 | } 339 | 340 | private bool HasPassword() 341 | { 342 | var user = UserManager.FindById(User.Identity.GetUserId()); 343 | if (user != null) 344 | { 345 | return user.PasswordHash != null; 346 | } 347 | return false; 348 | } 349 | 350 | private bool HasPhoneNumber() 351 | { 352 | var user = UserManager.FindById(User.Identity.GetUserId()); 353 | if (user != null) 354 | { 355 | return user.PhoneNumber != null; 356 | } 357 | return false; 358 | } 359 | 360 | public enum ManageMessageId 361 | { 362 | AddPhoneSuccess, 363 | ChangePasswordSuccess, 364 | SetTwoFactorSuccess, 365 | SetPasswordSuccess, 366 | RemoveLoginSuccess, 367 | RemovePhoneSuccess, 368 | Error 369 | } 370 | 371 | #endregion 372 | } 373 | } -------------------------------------------------------------------------------- /Controllers/OwnerController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace A2_HTML5_Biz_App_New.Controllers 8 | { 9 | [Authorize(Roles="Owner")] 10 | public class OwnerController : Controller 11 | { 12 | // GET: Owner 13 | /// 14 | /// The Action Method Provides the Current Login Email Information 15 | /// 16 | /// 17 | public ActionResult Index() 18 | { 19 | var data = this.User.Identity.Name; 20 | ViewBag.CurrentUserEmail = data; 21 | return View(); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Controllers/OwnerInfoAPIController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.Entity; 5 | using System.Data.Entity.Infrastructure; 6 | using System.Linq; 7 | using System.Net; 8 | using System.Net.Http; 9 | using System.Web.Http; 10 | using System.Web.Http.Description; 11 | using A2_HTML5_Biz_App_New.Models; 12 | using System.Data.Entity.Validation; 13 | using System.Diagnostics; 14 | 15 | namespace A2_HTML5_Biz_App_New.Controllers 16 | { 17 | public class OwnerInfoAPIController : ApiController 18 | { 19 | private PropertyStoreEntities db = new PropertyStoreEntities(); 20 | 21 | // GET: api/OwnerInfoAPI 22 | public IQueryable GetOwnerInfoes() 23 | { 24 | return db.OwnerInfoes; 25 | } 26 | 27 | 28 | // GET: api/OwnerInfoAPI/5 29 | [ResponseType(typeof(OwnerInfo))] 30 | public IHttpActionResult GetOwnerInfo(int id) 31 | { 32 | OwnerInfo ownerInfo = db.OwnerInfoes.Find(id); 33 | if (ownerInfo == null) 34 | { 35 | return NotFound(); 36 | } 37 | 38 | return Ok(ownerInfo); 39 | } 40 | 41 | // PUT: api/OwnerInfoAPI/5 42 | [ResponseType(typeof(void))] 43 | public IHttpActionResult PutOwnerInfo(int id, OwnerInfo ownerInfo) 44 | { 45 | if (!ModelState.IsValid) 46 | { 47 | return BadRequest(ModelState); 48 | } 49 | 50 | if (id != ownerInfo.OwnerId) 51 | { 52 | return BadRequest(); 53 | } 54 | 55 | db.Entry(ownerInfo).State = EntityState.Modified; 56 | 57 | try 58 | { 59 | db.SaveChanges(); 60 | } 61 | catch (DbUpdateConcurrencyException) 62 | { 63 | if (!OwnerInfoExists(id)) 64 | { 65 | return NotFound(); 66 | } 67 | else 68 | { 69 | throw; 70 | } 71 | } 72 | 73 | return StatusCode(HttpStatusCode.NoContent); 74 | } 75 | 76 | // POST: api/OwnerInfoAPI 77 | [ResponseType(typeof(OwnerInfo))] 78 | public IHttpActionResult PostOwnerInfo(OwnerInfo ownerInfo) 79 | { 80 | try 81 | { 82 | if (!ModelState.IsValid) 83 | { 84 | return BadRequest(ModelState); 85 | } 86 | ownerInfo.RegistrationDate = DateTime.Now; 87 | 88 | db.OwnerInfoes.Add(ownerInfo); 89 | db.SaveChanges(); 90 | } 91 | catch (DbEntityValidationException e) 92 | { 93 | foreach (var eve in e.EntityValidationErrors) 94 | { 95 | Debug.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", 96 | eve.Entry.Entity.GetType().Name, eve.Entry.State); 97 | foreach (var ve in eve.ValidationErrors) 98 | { 99 | Debug.WriteLine("- Property: \"{0}\", Error: \"{1}\"", 100 | ve.PropertyName, ve.ErrorMessage); 101 | } 102 | } 103 | throw; 104 | throw; 105 | } 106 | 107 | return CreatedAtRoute("DefaultApi", new { id = ownerInfo.OwnerId }, ownerInfo); 108 | } 109 | 110 | // DELETE: api/OwnerInfoAPI/5 111 | [ResponseType(typeof(OwnerInfo))] 112 | public IHttpActionResult DeleteOwnerInfo(int id) 113 | { 114 | OwnerInfo ownerInfo = db.OwnerInfoes.Find(id); 115 | if (ownerInfo == null) 116 | { 117 | return NotFound(); 118 | } 119 | 120 | db.OwnerInfoes.Remove(ownerInfo); 121 | db.SaveChanges(); 122 | 123 | return Ok(ownerInfo); 124 | } 125 | 126 | protected override void Dispose(bool disposing) 127 | { 128 | if (disposing) 129 | { 130 | db.Dispose(); 131 | } 132 | base.Dispose(disposing); 133 | } 134 | 135 | private bool OwnerInfoExists(int id) 136 | { 137 | return db.OwnerInfoes.Count(e => e.OwnerId == id) > 0; 138 | } 139 | } 140 | } -------------------------------------------------------------------------------- /Controllers/OwnerPropertyDescriptionAPIController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.Entity; 5 | using System.Data.Entity.Infrastructure; 6 | using System.Linq; 7 | using System.Net; 8 | using System.Net.Http; 9 | using System.Web.Http; 10 | using System.Web.Http.Description; 11 | using A2_HTML5_Biz_App_New.Models; 12 | 13 | namespace A2_HTML5_Biz_App_New.Controllers 14 | { 15 | public class OwnerPropertyDescriptionAPIController : ApiController 16 | { 17 | private PropertyStoreEntities db = new PropertyStoreEntities(); 18 | 19 | // GET: api/OwnerPropertyDescriptionAPI 20 | public List GetOwnerPropertyDescriptions() 21 | { 22 | 23 | //Logic for Getting the Current Login User and its Owner Is 24 | var user = this.User.Identity.Name; 25 | var owner = (from o in db.OwnerInfoes.ToList() 26 | where o.Email == user 27 | select new OwnerInfo() 28 | { 29 | OwnerId = o.OwnerId 30 | }).First(); 31 | //Ends Here 32 | 33 | var OwnPropeDesc = from owpd in db.OwnerPropertyDescriptions.ToList() 34 | where owpd.OwnerId == owner.OwnerId 35 | select new OwnerPropertyDescription() 36 | { 37 | OwnerPropertyId = owpd.OwnerPropertyId, 38 | PropertyType = owpd.PropertyType, 39 | OwnerId = owpd.OwnerId, 40 | Address = owpd.Address, 41 | BedRoomNo = owpd.BedRoomNo, 42 | TotalRooms = owpd.TotalRooms, 43 | PropertyBuildupArea = owpd.PropertyBuildupArea, 44 | PropertyDescription = owpd.PropertyDescription, 45 | PropertySaleRentStatus = owpd.PropertySaleRentStatus, 46 | SaleOrRentCost = owpd.SaleOrRentCost, 47 | PropertyAge = owpd.PropertyAge, 48 | Status = owpd.Status, 49 | RegistrationDate = owpd.RegistrationDate 50 | }; 51 | 52 | return OwnPropeDesc.ToList(); 53 | } 54 | 55 | // GET: api/OwnerPropertyDescriptionAPI/5 56 | [ResponseType(typeof(OwnerPropertyDescription))] 57 | public IHttpActionResult GetOwnerPropertyDescription(int id) 58 | { 59 | OwnerPropertyDescription ownerPropertyDescription = db.OwnerPropertyDescriptions.Find(id); 60 | if (ownerPropertyDescription == null) 61 | { 62 | return NotFound(); 63 | } 64 | 65 | return Ok(ownerPropertyDescription); 66 | } 67 | 68 | // PUT: api/OwnerPropertyDescriptionAPI/5 69 | [ResponseType(typeof(void))] 70 | public IHttpActionResult PutOwnerPropertyDescription(int id, OwnerPropertyDescription ownerPropertyDescription) 71 | { 72 | if (!ModelState.IsValid) 73 | { 74 | return BadRequest(ModelState); 75 | } 76 | 77 | if (id != ownerPropertyDescription.OwnerPropertyId) 78 | { 79 | return BadRequest(); 80 | } 81 | 82 | db.Entry(ownerPropertyDescription).State = EntityState.Modified; 83 | 84 | try 85 | { 86 | db.SaveChanges(); 87 | } 88 | catch (DbUpdateConcurrencyException) 89 | { 90 | if (!OwnerPropertyDescriptionExists(id)) 91 | { 92 | return NotFound(); 93 | } 94 | else 95 | { 96 | throw; 97 | } 98 | } 99 | 100 | return StatusCode(HttpStatusCode.NoContent); 101 | } 102 | 103 | // POST: api/OwnerPropertyDescriptionAPI 104 | [ResponseType(typeof(OwnerPropertyDescription))] 105 | public IHttpActionResult PostOwnerPropertyDescription(OwnerPropertyDescription ownerPropertyDescription) 106 | { 107 | if (!ModelState.IsValid) 108 | { 109 | return BadRequest(ModelState); 110 | } 111 | ownerPropertyDescription.RegistrationDate = DateTime.Now; 112 | db.OwnerPropertyDescriptions.Add(ownerPropertyDescription); 113 | db.SaveChanges(); 114 | 115 | return CreatedAtRoute("DefaultApi", new { id = ownerPropertyDescription.OwnerPropertyId }, ownerPropertyDescription); 116 | } 117 | 118 | // DELETE: api/OwnerPropertyDescriptionAPI/5 119 | [ResponseType(typeof(OwnerPropertyDescription))] 120 | public IHttpActionResult DeleteOwnerPropertyDescription(int id) 121 | { 122 | OwnerPropertyDescription ownerPropertyDescription = db.OwnerPropertyDescriptions.Find(id); 123 | if (ownerPropertyDescription == null) 124 | { 125 | return NotFound(); 126 | } 127 | 128 | db.OwnerPropertyDescriptions.Remove(ownerPropertyDescription); 129 | db.SaveChanges(); 130 | 131 | return Ok(ownerPropertyDescription); 132 | } 133 | 134 | protected override void Dispose(bool disposing) 135 | { 136 | if (disposing) 137 | { 138 | db.Dispose(); 139 | } 140 | base.Dispose(disposing); 141 | } 142 | 143 | private bool OwnerPropertyDescriptionExists(int id) 144 | { 145 | return db.OwnerPropertyDescriptions.Count(e => e.OwnerPropertyId == id) > 0; 146 | } 147 | } 148 | } -------------------------------------------------------------------------------- /Controllers/OwnerPropertyDescriptionController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace A2_HTML5_Biz_App_New.Controllers 8 | { 9 | [Authorize(Roles="Owner")] 10 | public class OwnerPropertyDescriptionController : Controller 11 | { 12 | // GET: OwnerPropertyDescription 13 | public ActionResult Index() 14 | { 15 | var data = this.User.Identity.Name; 16 | 17 | ViewBag.CurrentUserEmail = data; 18 | 19 | return View(); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Controllers/RoleControllerController.cs: -------------------------------------------------------------------------------- 1 | using A2_HTML5_Biz_App_New.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Mvc; 7 | 8 | namespace A2_HTML5_Biz_App_New.Controllers 9 | { 10 | [Authorize(Roles="Administrator")] 11 | public class RoleController : Controller 12 | { 13 | ApplicationDbContext ctx; 14 | 15 | public RoleController() 16 | { 17 | ctx = new ApplicationDbContext(); 18 | } 19 | 20 | // GET: RoleController 21 | public ActionResult Index() 22 | { 23 | var appRoles = ctx.Roles.ToList(); 24 | return View(appRoles); 25 | } 26 | 27 | public ActionResult Create() 28 | { 29 | return View(); 30 | } 31 | /// 32 | /// Action method to create Roles 33 | /// 34 | /// 35 | /// 36 | [HttpPost] 37 | public ActionResult Create(FormCollection collection) 38 | { 39 | try 40 | { 41 | ctx.Roles.Add(new Microsoft.AspNet.Identity.EntityFramework.IdentityRole() 42 | { 43 | Name = collection["RoleName"] 44 | }); 45 | ctx.SaveChanges(); 46 | ViewBag.ResultMessage = "Role created successfully !"; 47 | return RedirectToAction("Index"); 48 | } 49 | catch 50 | { 51 | return View(); 52 | } 53 | } 54 | 55 | 56 | public ActionResult Edit(string roleName) 57 | { 58 | var Role = ctx.Roles.Where(role => role.Name.Equals(roleName, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault(); 59 | 60 | return View(Role); 61 | } 62 | 63 | // 64 | // POST: /Roles/Edit/5 65 | //[HttpPost] 66 | //[ValidateAntiForgeryToken] 67 | //public ActionResult Edit(Microsoft.AspNet.Identity.EntityFramework.IdentityRole role) 68 | //{ 69 | // try 70 | // { 71 | // ctx.Entry(role).State = System.Data.Entity.EntityState.Modified; 72 | // ctx.SaveChanges(); 73 | 74 | // return RedirectToAction("Index"); 75 | // } 76 | // catch 77 | // { 78 | // return View(); 79 | // } 80 | //} 81 | 82 | //// 83 | //// GET: /Roles/Delete/5 84 | //public ActionResult Delete(string RoleName) 85 | //{ 86 | // var thisRole = ctx.Roles.Where(r => r.Name.Equals(RoleName, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault(); 87 | // ctx.Roles.Remove(thisRole); 88 | // ctx.SaveChanges(); 89 | // return RedirectToAction("Index"); 90 | //} 91 | 92 | /// 93 | /// Assign Users to Role 94 | /// 95 | /// 96 | public ActionResult AssignUserToRole() 97 | { 98 | var list = ctx.Roles.OrderBy(role => role.Name).ToList().Select(role => new SelectListItem { Value = role.Name.ToString(), Text = role.Name }).ToList(); 99 | ViewBag.Roles = list; 100 | return View(); 101 | } 102 | 103 | /// 104 | /// Add user to Role 105 | /// 106 | /// 107 | /// 108 | /// 109 | 110 | [HttpPost] 111 | [ValidateAntiForgeryToken] 112 | public ActionResult UserAddToRole(string UserName, string RoleName) 113 | { 114 | ApplicationUser user = ctx.Users.Where(usr => usr.UserName.Equals(UserName, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault(); 115 | 116 | // Display Roles in DropDown 117 | 118 | var list = ctx.Roles.OrderBy(role => role.Name).ToList().Select(role => new SelectListItem { Value = role.Name.ToString(), Text = role.Name }).ToList(); 119 | ViewBag.Roles = list; 120 | 121 | if (user != null) 122 | { 123 | var account = new AccountController(); 124 | account.UserManager.AddToRoleAsync(user.Id, RoleName); 125 | 126 | ViewBag.ResultMessage = "Role created successfully !"; 127 | 128 | return View("AssignUserToRole"); 129 | } 130 | else 131 | { 132 | ViewBag.ErrorMessage = "Sorry user is not available"; 133 | return View("AssignUserToRole"); 134 | } 135 | 136 | } 137 | 138 | //[HttpPost] 139 | //[ValidateAntiForgeryToken] 140 | //public ActionResult GetRoles(string UserName) 141 | //{ 142 | // if (!string.IsNullOrWhiteSpace(UserName)) 143 | // { 144 | // ApplicationUser user = ctx.Users.Where(u => u.UserName.Equals(UserName, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault(); 145 | // var account = new AccountController(); 146 | 147 | // ViewBag.RolesForThisUser = account.UserManager.GetRolesAsync(user.Id); 148 | 149 | // // prepopulat roles for the view dropdown 150 | // var list = ctx.Roles.OrderBy(r => r.Name).ToList().Select(rr => new SelectListItem { Value = rr.Name.ToString(), Text = rr.Name }).ToList(); 151 | // ViewBag.Roles = list; 152 | // } 153 | 154 | // return View("ManageUserRoles"); 155 | //} 156 | 157 | //[HttpPost] 158 | //[ValidateAntiForgeryToken] 159 | //public ActionResult DeleteRoleForUser(string UserName, string RoleName) 160 | //{ 161 | // var account = new AccountController(); 162 | // ApplicationUser user = ctx.Users.Where(u => u.UserName.Equals(UserName, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault(); 163 | 164 | // //account.UserManager.IsInRole(user.Id, RoleName) 165 | // if (account.UserManager.IsInRoleAsync(user.Id, RoleName).Result) 166 | // { 167 | // account.UserManager.RemoveFromRoleAsync(user.Id, RoleName); 168 | // ViewBag.ResultMessage = "Role removed from this user successfully !"; 169 | // } 170 | // else 171 | // { 172 | // ViewBag.ResultMessage = "This user doesn't belong to selected role."; 173 | // } 174 | // // prepopulat roles for the view dropdown 175 | // var list = ctx.Roles.OrderBy(r => r.Name).ToList().Select(rr => new SelectListItem { Value = rr.Name.ToString(), Text = rr.Name }).ToList(); 176 | // ViewBag.Roles = list; 177 | 178 | // return View("AssignUserToRole"); 179 | //} 180 | } 181 | } -------------------------------------------------------------------------------- /Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="A2_HTML5_Biz_App_New.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Mvc; 7 | using System.Web.Optimization; 8 | using System.Web.Routing; 9 | 10 | namespace A2_HTML5_Biz_App_New 11 | { 12 | public class MvcApplication : System.Web.HttpApplication 13 | { 14 | protected void Application_Start() 15 | { 16 | AreaRegistration.RegisterAllAreas(); 17 | GlobalConfiguration.Configure(WebApiConfig.Register); 18 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 19 | RouteConfig.RegisterRoutes(RouteTable.Routes); 20 | BundleConfig.RegisterBundles(BundleTable.Bundles); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Models/AccountViewModels.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace A2_HTML5_Biz_App_New.Models 5 | { 6 | public class ExternalLoginConfirmationViewModel 7 | { 8 | [Required] 9 | [Display(Name = "Email")] 10 | public string Email { get; set; } 11 | } 12 | 13 | public class ExternalLoginListViewModel 14 | { 15 | public string ReturnUrl { get; set; } 16 | } 17 | 18 | public class SendCodeViewModel 19 | { 20 | public string SelectedProvider { get; set; } 21 | public ICollection Providers { get; set; } 22 | public string ReturnUrl { get; set; } 23 | public bool RememberMe { get; set; } 24 | } 25 | 26 | public class VerifyCodeViewModel 27 | { 28 | [Required] 29 | public string Provider { get; set; } 30 | 31 | [Required] 32 | [Display(Name = "Code")] 33 | public string Code { get; set; } 34 | public string ReturnUrl { get; set; } 35 | 36 | [Display(Name = "Remember this browser?")] 37 | public bool RememberBrowser { get; set; } 38 | 39 | public bool RememberMe { get; set; } 40 | } 41 | 42 | public class ForgotViewModel 43 | { 44 | [Required] 45 | [Display(Name = "Email")] 46 | public string Email { get; set; } 47 | } 48 | 49 | public class LoginViewModel 50 | { 51 | [Required] 52 | [Display(Name = "Email")] 53 | [EmailAddress] 54 | public string Email { get; set; } 55 | 56 | [Required] 57 | [DataType(DataType.Password)] 58 | [Display(Name = "Password")] 59 | public string Password { get; set; } 60 | 61 | [Display(Name = "Remember me?")] 62 | public bool RememberMe { get; set; } 63 | } 64 | 65 | public class RegisterViewModel 66 | { 67 | [Required] 68 | [EmailAddress] 69 | [Display(Name = "Email")] 70 | public string Email { get; set; } 71 | 72 | [Required] 73 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 74 | [DataType(DataType.Password)] 75 | [Display(Name = "Password")] 76 | public string Password { get; set; } 77 | 78 | [DataType(DataType.Password)] 79 | [Display(Name = "Confirm password")] 80 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 81 | public string ConfirmPassword { get; set; } 82 | 83 | public string Name { get; set; } 84 | } 85 | 86 | public class ResetPasswordViewModel 87 | { 88 | [Required] 89 | [EmailAddress] 90 | [Display(Name = "Email")] 91 | public string Email { get; set; } 92 | 93 | [Required] 94 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 95 | [DataType(DataType.Password)] 96 | [Display(Name = "Password")] 97 | public string Password { get; set; } 98 | 99 | [DataType(DataType.Password)] 100 | [Display(Name = "Confirm password")] 101 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 102 | public string ConfirmPassword { get; set; } 103 | 104 | public string Code { get; set; } 105 | } 106 | 107 | public class ForgotPasswordViewModel 108 | { 109 | [Required] 110 | [EmailAddress] 111 | [Display(Name = "Email")] 112 | public string Email { get; set; } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Models/CustomModelClasses.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace A2_HTML5_Biz_App_New.Models 3 | { 4 | public class SearchProperty 5 | { 6 | public int PropertyId { get; set; } 7 | public string OwnerName { get; set; } 8 | 9 | public string Contact1 { get; set; } 10 | 11 | public string Contact2 { get; set; } 12 | public string Email { get; set; } 13 | public string PropertyType { get; set; } 14 | public string Address { get; set; } 15 | public int BedRoomNo { get; set; } 16 | public int TotalRooms { get; set; } 17 | public int BuildupArea { get; set; } 18 | public string SaleRentStatus { get; set; } 19 | 20 | public string Status { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /Models/CustomerInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated from a template. 4 | // 5 | // Manual changes to this file may cause unexpected behavior in your application. 6 | // Manual changes to this file will be overwritten if the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | namespace A2_HTML5_Biz_App_New.Models 11 | { 12 | using System; 13 | using System.Collections.Generic; 14 | 15 | public partial class CustomerInfo 16 | { 17 | public int CustomerId { get; set; } 18 | public string CustomerName { get; set; } 19 | public string Address { get; set; } 20 | public string City { get; set; } 21 | public string Email { get; set; } 22 | public string Contact1 { get; set; } 23 | public string Contact2 { get; set; } 24 | public System.DateTime RegistrationDate { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Models/IdentityModels.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity; 2 | using System.Security.Claims; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNet.Identity; 5 | using Microsoft.AspNet.Identity.EntityFramework; 6 | 7 | namespace A2_HTML5_Biz_App_New.Models 8 | { 9 | // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more. 10 | public class ApplicationUser : IdentityUser 11 | { 12 | public async Task GenerateUserIdentityAsync(UserManager manager) 13 | { 14 | // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType 15 | var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); 16 | // Add custom user claims here 17 | return userIdentity; 18 | } 19 | } 20 | 21 | public class ApplicationDbContext : IdentityDbContext 22 | { 23 | public ApplicationDbContext() 24 | : base("DefaultConnection", throwIfV1Schema: false) 25 | { 26 | } 27 | 28 | public static ApplicationDbContext Create() 29 | { 30 | return new ApplicationDbContext(); 31 | } 32 | 33 | } 34 | } -------------------------------------------------------------------------------- /Models/ManageViewModels.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | using Microsoft.AspNet.Identity; 4 | using Microsoft.Owin.Security; 5 | 6 | namespace A2_HTML5_Biz_App_New.Models 7 | { 8 | public class IndexViewModel 9 | { 10 | public bool HasPassword { get; set; } 11 | public IList Logins { get; set; } 12 | public string PhoneNumber { get; set; } 13 | public bool TwoFactor { get; set; } 14 | public bool BrowserRemembered { get; set; } 15 | } 16 | 17 | public class ManageLoginsViewModel 18 | { 19 | public IList CurrentLogins { get; set; } 20 | public IList OtherLogins { get; set; } 21 | } 22 | 23 | public class FactorViewModel 24 | { 25 | public string Purpose { get; set; } 26 | } 27 | 28 | public class SetPasswordViewModel 29 | { 30 | [Required] 31 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 32 | [DataType(DataType.Password)] 33 | [Display(Name = "New password")] 34 | public string NewPassword { get; set; } 35 | 36 | [DataType(DataType.Password)] 37 | [Display(Name = "Confirm new password")] 38 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 39 | public string ConfirmPassword { get; set; } 40 | } 41 | 42 | public class ChangePasswordViewModel 43 | { 44 | [Required] 45 | [DataType(DataType.Password)] 46 | [Display(Name = "Current password")] 47 | public string OldPassword { get; set; } 48 | 49 | [Required] 50 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 51 | [DataType(DataType.Password)] 52 | [Display(Name = "New password")] 53 | public string NewPassword { get; set; } 54 | 55 | [DataType(DataType.Password)] 56 | [Display(Name = "Confirm new password")] 57 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 58 | public string ConfirmPassword { get; set; } 59 | } 60 | 61 | public class AddPhoneNumberViewModel 62 | { 63 | [Required] 64 | [Phone] 65 | [Display(Name = "Phone Number")] 66 | public string Number { get; set; } 67 | } 68 | 69 | public class VerifyPhoneNumberViewModel 70 | { 71 | [Required] 72 | [Display(Name = "Code")] 73 | public string Code { get; set; } 74 | 75 | [Required] 76 | [Phone] 77 | [Display(Name = "Phone Number")] 78 | public string PhoneNumber { get; set; } 79 | } 80 | 81 | public class ConfigureTwoFactorViewModel 82 | { 83 | public string SelectedProvider { get; set; } 84 | public ICollection Providers { get; set; } 85 | } 86 | } -------------------------------------------------------------------------------- /Models/OwnerInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated from a template. 4 | // 5 | // Manual changes to this file may cause unexpected behavior in your application. 6 | // Manual changes to this file will be overwritten if the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | namespace A2_HTML5_Biz_App_New.Models 11 | { 12 | using System; 13 | using System.Collections.Generic; 14 | 15 | public partial class OwnerInfo 16 | { 17 | public OwnerInfo() 18 | { 19 | this.OwnerPropertyDescriptions = new HashSet(); 20 | } 21 | 22 | public int OwnerId { get; set; } 23 | public string OwnerName { get; set; } 24 | public string Address { get; set; } 25 | public string City { get; set; } 26 | public string Contact1 { get; set; } 27 | public string Contact2 { get; set; } 28 | public string Email { get; set; } 29 | public System.DateTime RegistrationDate { get; set; } 30 | 31 | public virtual ICollection OwnerPropertyDescriptions { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Models/OwnerPropertyDescription.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated from a template. 4 | // 5 | // Manual changes to this file may cause unexpected behavior in your application. 6 | // Manual changes to this file will be overwritten if the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | namespace A2_HTML5_Biz_App_New.Models 11 | { 12 | using System; 13 | using System.Collections.Generic; 14 | 15 | public partial class OwnerPropertyDescription 16 | { 17 | public int OwnerPropertyId { get; set; } 18 | public string PropertyType { get; set; } 19 | public int OwnerId { get; set; } 20 | public string Address { get; set; } 21 | public int BedRoomNo { get; set; } 22 | public int TotalRooms { get; set; } 23 | public int PropertyBuildupArea { get; set; } 24 | public string PropertyDescription { get; set; } 25 | public string PropertySaleRentStatus { get; set; } 26 | public int SaleOrRentCost { get; set; } 27 | public int PropertyAge { get; set; } 28 | public string Status { get; set; } 29 | public System.DateTime RegistrationDate { get; set; } 30 | 31 | public virtual OwnerInfo OwnerInfo { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Models/PropertyStoreEDMX.Context.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated from a template. 4 | // 5 | // Manual changes to this file may cause unexpected behavior in your application. 6 | // Manual changes to this file will be overwritten if the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | namespace A2_HTML5_Biz_App_New.Models 11 | { 12 | using System; 13 | using System.Data.Entity; 14 | using System.Data.Entity.Infrastructure; 15 | 16 | public partial class PropertyStoreEntities : DbContext 17 | { 18 | public PropertyStoreEntities() 19 | : base("name=PropertyStoreEntities") 20 | { 21 | } 22 | 23 | protected override void OnModelCreating(DbModelBuilder modelBuilder) 24 | { 25 | throw new UnintentionalCodeFirstException(); 26 | } 27 | 28 | public virtual DbSet CustomerInfoes { get; set; } 29 | public virtual DbSet OwnerInfoes { get; set; } 30 | public virtual DbSet OwnerPropertyDescriptions { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Models/PropertyStoreEDMX.Designer.cs: -------------------------------------------------------------------------------- 1 | // T4 code generation is enabled for model 'F:\Mahesh_New\Articles\MVC\Infra\A2_HTML5_Biz_App_New\A2_HTML5_Biz_App_New\Models\PropertyStoreEDMX.edmx'. 2 | // To enable legacy code generation, change the value of the 'Code Generation Strategy' designer 3 | // property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model 4 | // is open in the designer. 5 | 6 | // If no context and entity classes have been generated, it may be because you created an empty model but 7 | // have not yet chosen which version of Entity Framework to use. To generate a context class and entity 8 | // classes for your model, open the model in the designer, right-click on the designer surface, and 9 | // select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation 10 | // Item...'. -------------------------------------------------------------------------------- /Models/PropertyStoreEDMX.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated from a template. 4 | // 5 | // Manual changes to this file may cause unexpected behavior in your application. 6 | // Manual changes to this file will be overwritten if the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | -------------------------------------------------------------------------------- /Models/PropertyStoreEDMX.edmx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | -------------------------------------------------------------------------------- /Models/PropertyStoreEDMX.edmx.diagram: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Project_Readme.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Your ASP.NET application 6 | 95 | 96 | 97 | 98 | 102 | 103 |
104 |
105 |

This application consists of:

106 |
    107 |
  • Sample pages showing basic nav between Home, About, and Contact
  • 108 |
  • Theming using Bootstrap
  • 109 |
  • Authentication, if selected, shows how to register and sign in
  • 110 |
  • ASP.NET features managed using NuGet
  • 111 |
112 |
113 | 114 | 131 | 132 |
133 |

Deploy

134 | 139 |
140 | 141 |
142 |

Get help

143 | 147 |
148 |
149 | 150 | 151 | -------------------------------------------------------------------------------- /Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("A2_HTML5_Biz_App_New")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("A2_HTML5_Biz_App_New")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("123281b5-10c9-4ae9-ac1c-34e02a5e274e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Scripts/MyScripts/Customers.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | (function () { 5 | var CustomerViewModel = function () { 6 | var self = this; 7 | 8 | var data = GlobalDeclarationCust.UserName(); 9 | 10 | 11 | getCustomerByEmail(); 12 | 13 | self.CustomerId = ko.observable(0); //For Customer Id 14 | self.CustomerName = ko.observable(""); //For Customer Name 15 | self.Address = ko.observable(""); //For Address 16 | self.City = ko.observable(""); //For City 17 | self.Email = ko.observable(""); //For Email 18 | self.Contact1 = ko.observable(""); //The Field for Primary Contact 19 | self.Contact2 = ko.observable("");//The Field for Secondary Contact 20 | 21 | self.Email(data); 22 | 23 | self.ErrorMessage = ko.observable(""); 24 | 25 | var Customer = { 26 | CustomerId: self.CustomerId, 27 | CustomerName: self.CustomerName, 28 | Address: self.Address, 29 | City: self.City, 30 | Email: self.Email, 31 | Contact1: self.Contact1, 32 | Contact2: self.Contact2 33 | }; 34 | 35 | //Function to get Customer info based upon the Login Email 36 | function getCustomerByEmail() { 37 | $.ajax({ 38 | url: "/Customer/Get", 39 | type:"GET" 40 | }).done(function (resp) { 41 | if (resp.CustomerId !== 0) { 42 | self.CustomerId(resp.CustomerId); 43 | self.CustomerName(resp.CustomerName); 44 | self.Address(resp.Address); 45 | self.City(resp.City); 46 | self.Contact1(resp.Contact1); 47 | self.Contact2(resp.Contact2); 48 | self.Email(resp.Email); 49 | } 50 | }).error(function (err) { 51 | self.ErrorMessage("Error!!!" + err.status); 52 | }); 53 | } 54 | //Save the Customer 55 | self.save = function () { 56 | 57 | // alert("Data" + ko.toJSON(Customer)); 58 | $.ajax({ 59 | url: "/api/CustomerInfoAPI", 60 | type: "POST", 61 | data: Customer, 62 | datatype: "json", 63 | contenttype:"application/json;utf-8" 64 | }).done(function (resp) { 65 | self.CustomerId(resp.CustomerId); 66 | }).error(function (err) { 67 | self.ErrorMessage("Error " + err.status); 68 | }); 69 | }; 70 | 71 | self.clear = function () { 72 | self.CustomerId(0); 73 | self.CustomerName(""); 74 | self.Address(""); 75 | self.City(""); 76 | self.Email(""); 77 | self.Contact1(""); 78 | self.Contact2(""); 79 | } 80 | }; 81 | ko.applyBindings(new CustomerViewModel()); 82 | })(); -------------------------------------------------------------------------------- /Scripts/MyScripts/OwnerPropertyDescription.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | (function () { 5 | 6 | var OwnerPropertyDescriptionViewModel = function () { 7 | var self = this; 8 | 9 | var data = GlobalDeclaration.UserName(); //Get the Current LogIn User 10 | 11 | self.OwnerPropertyId = ko.observable(0); //For OwnerPropertyId 12 | self.OwnerId = ko.observable(0); //For OwnerId 13 | self.OwnerName = ko.observable(""); //For Owner Name 14 | self.Address = ko.observable(""); //For Address 15 | self.BedRoomNo = ko.observable(0); //For No. of Bedrooms 16 | self.TotalRooms = ko.observable(0); //For Total Rooms 17 | self.PropertyBuildupArea = ko.observable(0);//For the area 18 | self.PropertyDescription = ko.observable(); //For Property Description 19 | self.PropertySaleRentStatus = ko.observable(); //For the Status as Rent or Sale 20 | self.SaleOrRentCost = ko.observable(); //The Cost for Sale to Rent 21 | self.PropertyAge = ko.observable(); //The Age of the property 22 | self.Status = ko.observable(); //The Status of the Property as 'Available' 23 | self.RegistrationDate = ko.observable(); //For the Registration Date 24 | 25 | self.PropertyType = ko.observable(); //The Property Type (Flat, Bunglow, RowHouse,etc) 26 | 27 | self.ErrorMesage = ko.observable(""); 28 | 29 | self.PropertyTypes = ko.observableArray([ 30 | "Flat", "Bunglow","Row House" 31 | ]); //Array for Property Types 32 | 33 | self.SelectedProperty = ko.observable(); 34 | 35 | //Flag for Selection of Property and Status 36 | var propertySelected =0, saleORrentStatusSelected =0; 37 | 38 | //This will provide the selected property type id 39 | self.SelectedProperty.subscribe(function (val) { 40 | if(val!=='undefined'){ 41 | propertySelected = 1; 42 | self.PropertyType(val); 43 | } 44 | }); 45 | 46 | 47 | //The Array used to Store properties by owner 48 | self.PropertyByOwner = ko.observableArray([]); //Array for Property Owners 49 | 50 | //Array for Sale or Rent 51 | self.PropertySalesOrRentStatusConstant = ko.observableArray([ 52 | "Sale","Rent" 53 | ]); 54 | 55 | //An observable 56 | self.SelectedStatus = ko.observable(); 57 | 58 | //This will decide whether the property is for Rent or sales 59 | self.SelectedStatus.subscribe(function (text) { 60 | if (text !== 'undefined') { 61 | saleORrentStatusSelected=1 62 | self.PropertySaleRentStatus(text); 63 | } 64 | }); 65 | 66 | 67 | //The Owner Description Object 68 | var OwnerPropertyDescription = { 69 | OwnerPropertyId: self.OwnerPropertyId, 70 | PropertyType: self.PropertyType, 71 | OwnerId: self.OwnerId, 72 | Address: self.Address, 73 | BedRoomNo: self.BedRoomNo, 74 | TotalRooms: self.TotalRooms, 75 | PropertyBuildupArea: self.PropertyBuildupArea, 76 | PropertyDescription: self.PropertyDescription, 77 | PropertySaleRentStatus: self.PropertySaleRentStatus, 78 | SaleOrRentCost: self.SaleOrRentCost, 79 | PropertyAge: self.PropertyAge, 80 | Status:self.Status 81 | }; 82 | 83 | 84 | //Function call to load all propeties by Owner 85 | loadPropertiesbyowner(); 86 | 87 | 88 | 89 | //Function to load all properties by owner 90 | function loadPropertiesbyowner() { 91 | $.ajax({ 92 | url: "/api/OwnerPropertyDescriptionAPI", 93 | type: "GET" 94 | }).done(function (resp) { 95 | self.PropertyByOwner(resp); 96 | }).error(function (err) { 97 | self.ErrorMesage("Error " + err.status); 98 | }); 99 | } 100 | 101 | //Save the Description. Saves the Property description if the 102 | //Property tyoe and SaleRent Status is selected 103 | self.save = function () { 104 | if (propertySelected === 1 && saleORrentStatusSelected === 1) 105 | { 106 | self.Status("Available"); 107 | $.ajax({ 108 | url: "/api/OwnerPropertyDescriptionAPI", 109 | type: "POST", 110 | data: OwnerPropertyDescription, 111 | datatype: "json", 112 | contenttype:"application/json;utf-8" 113 | }).done(function (resp) { 114 | self.OwnerPropertyId(resp.OwnerPropertyId); 115 | loadPropertiesbyowner(); 116 | }).error(function (err) { 117 | self.ErrorMesage("Error " + err.status); 118 | }); 119 | } 120 | propertySelected = 0; 121 | saleORrentStatusSelected = 0; 122 | } 123 | 124 | //Clear Inpit Elements 125 | self.cancel = function () { 126 | self.OwnerPropertyId(0); 127 | self.PropertyType(""); 128 | self.Address(""); 129 | self.BedRoomNo(0); 130 | self.TotalRooms(0); 131 | self.PropertyBuildupArea(0); 132 | self.PropertyDescription(""); 133 | self.PropertySaleRentStatus("Choose Sale or Rent"); 134 | self.SaleOrRentCost(0); 135 | self.PropertyAge(0); 136 | self.Status("") 137 | } 138 | 139 | getOwnerIdUsingEmail(); 140 | //Function to Get the OwnerId using Email 141 | function getOwnerIdUsingEmail() { 142 | $.ajax({ 143 | url: "/Owner/Get", 144 | type:"GET" 145 | }).done(function (resp) { 146 | self.OwnerId(resp.OwnerId); 147 | self.OwnerName(resp.OwnerName); 148 | }).error(function (err) { 149 | self.ErrorMesage(err.status); 150 | }); 151 | } 152 | 153 | }; 154 | ko.applyBindings(new OwnerPropertyDescriptionViewModel()); 155 | 156 | })(); -------------------------------------------------------------------------------- /Scripts/MyScripts/Owners.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | 5 | (function () { 6 | var OwnerViewModel = function () { 7 | var self = this; 8 | 9 | //This function is declared in the Index.cshtml of the Owner View 10 | var data = GlobalDeclaration.UserName(); //Get the Current LogIn User 11 | 12 | getOwnerIdUsingEmail(); //Load the Ownerdetails if found 13 | 14 | self.OwnerId = ko.observable(0); //The OwnerId 15 | self.OwnerName = ko.observable(""); //The Owner Name 16 | self.Address = ko.observable(""); //The Address 17 | self.City = ko.observable(""); //The City 18 | self.Email = ko.observable(""); //The Email 19 | 20 | 21 | self.Email(data); //Set the login Email to the Email Observable 22 | 23 | self.Contact1 = ko.observable(""); //The Field for Primary Contact 24 | self.Contact2 = ko.observable("");//The Field for Secondary Contact 25 | 26 | self.ErrorMessage = ko.observable(""); 27 | 28 | 29 | //The Owner Object, this will be used for Adding Owner 30 | var Owner = { 31 | OwnerId: self.OwnerId, 32 | OwnerName: self.OwnerName, 33 | Address: self.Address, 34 | City: self.City, 35 | Email: self.Email, 36 | Contact1: self.Contact1, 37 | Contact2:self.Contact2 38 | }; 39 | 40 | //The Function to Save Owner 41 | self.save = function () { 42 | $.ajax({ 43 | url: "/api/OwnerInfoAPI", 44 | type: "POST", 45 | data: Owner, 46 | datatype: "json", 47 | contenttype:"application/json;utf-8" 48 | }).done(function (resp) { 49 | self.OwnerId(resp.OwnerId); 50 | }).error(function (err) { 51 | self.ErrorMessage("Error! " + err.status); 52 | }); 53 | } 54 | 55 | 56 | self.cancel = function () { 57 | self.OwnerId(0); 58 | self.OwnerName(""); 59 | self.Address(""); 60 | self.City(""); 61 | self.Email(""); 62 | self.Contact1(""); 63 | self.Contact2(""); 64 | } 65 | 66 | //The Function will decide whether to Register Properties 67 | self.canRegisterProperty = function () { 68 | var canRegister = false; 69 | if (self.OwnerId() > 0) 70 | { 71 | canRegister = true; 72 | } 73 | return canRegister; 74 | } 75 | 76 | //Function to Get the Owner Details based upon Email 77 | function getOwnerIdUsingEmail() { 78 | alert("Wel-Come " + data); 79 | $.ajax({ 80 | url: "/Owner/Get", 81 | type: "GET" 82 | }).done(function (resp) { 83 | if (resp.OwnerId !== 0) 84 | { 85 | self.OwnerId(resp.OwnerId); 86 | self.OwnerName(resp.OwnerName); 87 | self.Address(resp.Address); 88 | self.City(resp.City); 89 | self.Email(resp.Email); 90 | self.Contact1(resp.Contact1); 91 | self.Contact2(resp.Contact1); 92 | } 93 | }).error(function (err) { 94 | alert("Error Occured"); 95 | self.ErrorMessage(err.status); 96 | alert(JSON.stringify(Owner)); 97 | }); 98 | } 99 | }; 100 | ko.applyBindings(new OwnerViewModel()); 101 | })(); -------------------------------------------------------------------------------- /Scripts/MyScripts/PropertySearch.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | (function () { 5 | var searchViewModel = function () { 6 | 7 | var self = this; 8 | //Array for the Property type 9 | self.PropertyTypes = ko.observableArray(["Flat", "Bunglaow", "Row House"]); 10 | //Array for the FIlter condition 11 | self.Filters = ko.observableArray(["AND", "OR"]); 12 | //Array for the property Status 13 | self.PropertySaleRentStatus = ko.observableArray(["Rent","Sale"]); 14 | 15 | 16 | self.PropertyId = ko.observable(0); //For PropertyId 17 | self.OwnerName = ko.observable(""); //For OwnerName 18 | self.Contact1 = ko.observable(); //For Primary Contact 19 | self.Contact2 = ko.observable(); //For Secondary Contact 20 | self.Email = ko.observable(""); //For Email 21 | self.PropertyType = ko.observable(""); //For Property Type 22 | self.Address = ko.observable(""); //For Address 23 | self.BedRoomNo = ko.observable(0);//For No of Bedrooms 24 | self.TotalRooms = ko.observable(0); //For Total Rooms 25 | self.BuildupArea = ko.observable(0); //For Area 26 | self.SaleRentStatus = ko.observable(""); //For Sale or Rent 27 | self.Status = ko.observable(""); //For Status like Available 28 | 29 | self.ErrorMessage = ko.observable(""); 30 | 31 | //Flag for selection of the PropertyType and SaleRent Status 32 | 33 | var propertySelected = 0, saleORrentStatusSelected = 0; 34 | 35 | self.SearchedProperties = ko.observableArray(); 36 | 37 | self.selectedPropertyType = ko.observable(); 38 | 39 | self.selectedPropertyType.subscribe(function (val) { 40 | 41 | if (val !== 'undefines') { 42 | propertySelected = 1; 43 | self.PropertyType(val); 44 | } 45 | }); 46 | 47 | self.selectedSaleRentStatus = ko.observable(); 48 | 49 | self.selectedSaleRentStatus.subscribe(function (val) { 50 | if (val !== 'undefined') { 51 | saleORrentStatusSelected = 1; 52 | self.SaleRentStatus(val); 53 | } 54 | }); 55 | 56 | self.Filter = ko.observable(); 57 | self.SelectedFilter = ko.observable(""); 58 | self.Filter.subscribe(function (val) { 59 | if (val !== 'undefined') { 60 | self.SelectedFilter(val); 61 | } 62 | }); 63 | 64 | 65 | //Funtion to search properties based upon the Conditions 66 | self.SearchProperties =function(){ 67 | if (propertySelected === 1 && saleORrentStatusSelected === 1) 68 | { 69 | 70 | //Get the Filter Values 71 | propertytype = self.PropertyType(); 72 | filter = self.SelectedFilter(); 73 | searchtype = self.SaleRentStatus(); 74 | 75 | var url ="/Property/"+propertytype+"/" +filter+"/" +searchtype; 76 | alert(url); 77 | 78 | $.ajax({ 79 | url: url, 80 | type:"GET" 81 | }).done(function (resp) { 82 | self.SearchedProperties(resp); 83 | }).error(function (err) { 84 | self.ErrorMessage("Error!!!!" + err.status); 85 | }); 86 | } 87 | } 88 | 89 | }; 90 | ko.applyBindings(new searchViewModel()); 91 | 92 | })(); -------------------------------------------------------------------------------- /Scripts/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | /// 8 | /// 9 | /// 10 | /// 11 | /// 12 | /// 13 | -------------------------------------------------------------------------------- /Scripts/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | /* NUGET: BEGIN LICENSE TEXT 2 | * 3 | * Microsoft grants you the right to use these script files for the sole 4 | * purpose of either: (i) interacting through your browser with the Microsoft 5 | * website or online service, subject to the applicable licensing or use 6 | * terms; or (ii) using the files as included with a Microsoft product subject 7 | * to that product's license terms. Microsoft reserves all other rights to the 8 | * files not expressly granted by Microsoft, whether by implication, estoppel 9 | * or otherwise. Insofar as a script file is dual licensed under GPL, 10 | * Microsoft neither took the code under GPL nor distributes it thereunder but 11 | * under the terms set out in this paragraph. All notices and licenses 12 | * below are for informational purposes only. 13 | * 14 | * NUGET: END LICENSE TEXT */ 15 | /* 16 | ** Unobtrusive validation support library for jQuery and jQuery Validate 17 | ** Copyright (C) Microsoft Corporation. All rights reserved. 18 | */ 19 | (function(a){var d=a.validator,b,e="unobtrusiveValidation";function c(a,b,c){a.rules[b]=c;if(a.message)a.messages[b]=a.message}function j(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function f(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function h(a){return a.substr(0,a.lastIndexOf(".")+1)}function g(a,b){if(a.indexOf("*.")===0)a=a.replace("*.",b);return a}function m(c,e){var b=a(this).find("[data-valmsg-for='"+f(e[0].name)+"']"),d=b.attr("data-valmsg-replace"),g=d?a.parseJSON(d)!==false:null;b.removeClass("field-validation-valid").addClass("field-validation-error");c.data("unobtrusiveContainer",b);if(g){b.empty();c.removeClass("input-validation-error").appendTo(b)}else c.hide()}function l(e,d){var c=a(this).find("[data-valmsg-summary=true]"),b=c.find("ul");if(b&&b.length&&d.errorList.length){b.empty();c.addClass("validation-summary-errors").removeClass("validation-summary-valid");a.each(d.errorList,function(){a("
  • ").html(this.message).appendTo(b)})}}function k(d){var b=d.data("unobtrusiveContainer"),c=b.attr("data-valmsg-replace"),e=c?a.parseJSON(c):null;if(b){b.addClass("field-validation-valid").removeClass("field-validation-error");d.removeData("unobtrusiveContainer");e&&b.empty()}}function n(){var b=a(this);b.data("validator").resetForm();b.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors");b.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}function i(b){var c=a(b),f=c.data(e),i=a.proxy(n,b),g=d.unobtrusive.options||{},h=function(e,d){var c=g[e];c&&a.isFunction(c)&&c.apply(b,d)};if(!f){f={options:{errorClass:g.errorClass||"input-validation-error",errorElement:g.errorElement||"span",errorPlacement:function(){m.apply(b,arguments);h("errorPlacement",arguments)},invalidHandler:function(){l.apply(b,arguments);h("invalidHandler",arguments)},messages:{},rules:{},success:function(){k.apply(b,arguments);h("success",arguments)}},attachValidation:function(){c.off("reset."+e,i).on("reset."+e,i).validate(this.options)},validate:function(){c.validate();return c.valid()}};c.data(e,f)}return f}d.unobtrusive={adapters:[],parseElement:function(b,h){var d=a(b),f=d.parents("form")[0],c,e,g;if(!f)return;c=i(f);c.options.rules[b.name]=e={};c.options.messages[b.name]=g={};a.each(this.adapters,function(){var c="data-val-"+this.name,i=d.attr(c),h={};if(i!==undefined){c+="-";a.each(this.params,function(){h[this]=d.attr(c+this)});this.adapt({element:b,form:f,message:i,params:h,rules:e,messages:g})}});a.extend(e,{__dummy__:true});!h&&c.attachValidation()},parse:function(c){var b=a(c),e=b.parents().addBack().filter("form").add(b.find("form")).has("[data-val=true]");b.find("[data-val=true]").each(function(){d.unobtrusive.parseElement(this,true)});e.each(function(){var a=i(this);a&&a.attachValidation()})}};b=d.unobtrusive.adapters;b.add=function(c,a,b){if(!b){b=a;a=[]}this.push({name:c,params:a,adapt:b});return this};b.addBool=function(a,b){return this.add(a,function(d){c(d,b||a,true)})};b.addMinMax=function(e,g,f,a,d,b){return this.add(e,[d||"min",b||"max"],function(b){var e=b.params.min,d=b.params.max;if(e&&d)c(b,a,[e,d]);else if(e)c(b,g,e);else d&&c(b,f,d)})};b.addSingleVal=function(a,b,d){return this.add(a,[b||"val"],function(e){c(e,d||a,e.params[b])})};d.addMethod("__dummy__",function(){return true});d.addMethod("regex",function(b,c,d){var a;if(this.optional(c))return true;a=(new RegExp(d)).exec(b);return a&&a.index===0&&a[0].length===b.length});d.addMethod("nonalphamin",function(c,d,b){var a;if(b){a=c.match(/\W/g);a=a&&a.length>=b}return a});if(d.methods.extension){b.addSingleVal("accept","mimtype");b.addSingleVal("extension","extension")}else b.addSingleVal("extension","extension","accept");b.addSingleVal("regex","pattern");b.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");b.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");b.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength");b.add("equalto",["other"],function(b){var i=h(b.element.name),j=b.params.other,d=g(j,i),e=a(b.form).find(":input").filter("[name='"+f(d)+"']")[0];c(b,"equalTo",e)});b.add("required",function(a){(a.element.tagName.toUpperCase()!=="INPUT"||a.element.type.toUpperCase()!=="CHECKBOX")&&c(a,"required",true)});b.add("remote",["url","type","additionalfields"],function(b){var d={url:b.params.url,type:b.params.type||"GET",data:{}},e=h(b.element.name);a.each(j(b.params.additionalfields||b.element.name),function(i,h){var c=g(h,e);d.data[c]=function(){return a(b.form).find(":input").filter("[name='"+f(c)+"']").val()}});c(b,"remote",d)});b.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&c(a,"minlength",a.params.min);a.params.nonalphamin&&c(a,"nonalphamin",a.params.nonalphamin);a.params.regex&&c(a,"regex",a.params.regex)});a(function(){d.unobtrusive.parse(document)})})(jQuery); -------------------------------------------------------------------------------- /Scripts/respond.js: -------------------------------------------------------------------------------- 1 | /* NUGET: BEGIN LICENSE TEXT 2 | * 3 | * Microsoft grants you the right to use these script files for the sole 4 | * purpose of either: (i) interacting through your browser with the Microsoft 5 | * website or online service, subject to the applicable licensing or use 6 | * terms; or (ii) using the files as included with a Microsoft product subject 7 | * to that product's license terms. Microsoft reserves all other rights to the 8 | * files not expressly granted by Microsoft, whether by implication, estoppel 9 | * or otherwise. Insofar as a script file is dual licensed under GPL, 10 | * Microsoft neither took the code under GPL nor distributes it thereunder but 11 | * under the terms set out in this paragraph. All notices and licenses 12 | * below are for informational purposes only. 13 | * 14 | * NUGET: END LICENSE TEXT */ 15 | /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ 16 | /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ 17 | window.matchMedia = window.matchMedia || (function(doc, undefined){ 18 | 19 | var bool, 20 | docElem = doc.documentElement, 21 | refNode = docElem.firstElementChild || docElem.firstChild, 22 | // fakeBody required for 23 | fakeBody = doc.createElement('body'), 24 | div = doc.createElement('div'); 25 | 26 | div.id = 'mq-test-1'; 27 | div.style.cssText = "position:absolute;top:-100em"; 28 | fakeBody.style.background = "none"; 29 | fakeBody.appendChild(div); 30 | 31 | return function(q){ 32 | 33 | div.innerHTML = '­'; 34 | 35 | docElem.insertBefore(fakeBody, refNode); 36 | bool = div.offsetWidth == 42; 37 | docElem.removeChild(fakeBody); 38 | 39 | return { matches: bool, media: q }; 40 | }; 41 | 42 | })(document); 43 | 44 | 45 | 46 | 47 | /*! Respond.js v1.2.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ 48 | (function( win ){ 49 | //exposed namespace 50 | win.respond = {}; 51 | 52 | //define update even in native-mq-supporting browsers, to avoid errors 53 | respond.update = function(){}; 54 | 55 | //expose media query support flag for external use 56 | respond.mediaQueriesSupported = win.matchMedia && win.matchMedia( "only all" ).matches; 57 | 58 | //if media queries are supported, exit here 59 | if( respond.mediaQueriesSupported ){ return; } 60 | 61 | //define vars 62 | var doc = win.document, 63 | docElem = doc.documentElement, 64 | mediastyles = [], 65 | rules = [], 66 | appendedEls = [], 67 | parsedSheets = {}, 68 | resizeThrottle = 30, 69 | head = doc.getElementsByTagName( "head" )[0] || docElem, 70 | base = doc.getElementsByTagName( "base" )[0], 71 | links = head.getElementsByTagName( "link" ), 72 | requestQueue = [], 73 | 74 | //loop stylesheets, send text content to translate 75 | ripCSS = function(){ 76 | var sheets = links, 77 | sl = sheets.length, 78 | i = 0, 79 | //vars for loop: 80 | sheet, href, media, isCSS; 81 | 82 | for( ; i < sl; i++ ){ 83 | sheet = sheets[ i ], 84 | href = sheet.href, 85 | media = sheet.media, 86 | isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet"; 87 | 88 | //only links plz and prevent re-parsing 89 | if( !!href && isCSS && !parsedSheets[ href ] ){ 90 | // selectivizr exposes css through the rawCssText expando 91 | if (sheet.styleSheet && sheet.styleSheet.rawCssText) { 92 | translate( sheet.styleSheet.rawCssText, href, media ); 93 | parsedSheets[ href ] = true; 94 | } else { 95 | if( (!/^([a-zA-Z:]*\/\/)/.test( href ) && !base) 96 | || href.replace( RegExp.$1, "" ).split( "/" )[0] === win.location.host ){ 97 | requestQueue.push( { 98 | href: href, 99 | media: media 100 | } ); 101 | } 102 | } 103 | } 104 | } 105 | makeRequests(); 106 | }, 107 | 108 | //recurse through request queue, get css text 109 | makeRequests = function(){ 110 | if( requestQueue.length ){ 111 | var thisRequest = requestQueue.shift(); 112 | 113 | ajax( thisRequest.href, function( styles ){ 114 | translate( styles, thisRequest.href, thisRequest.media ); 115 | parsedSheets[ thisRequest.href ] = true; 116 | makeRequests(); 117 | } ); 118 | } 119 | }, 120 | 121 | //find media blocks in css text, convert to style blocks 122 | translate = function( styles, href, media ){ 123 | var qs = styles.match( /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi ), 124 | ql = qs && qs.length || 0, 125 | //try to get CSS path 126 | href = href.substring( 0, href.lastIndexOf( "/" )), 127 | repUrls = function( css ){ 128 | return css.replace( /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, "$1" + href + "$2$3" ); 129 | }, 130 | useMedia = !ql && media, 131 | //vars used in loop 132 | i = 0, 133 | j, fullq, thisq, eachq, eql; 134 | 135 | //if path exists, tack on trailing slash 136 | if( href.length ){ href += "/"; } 137 | 138 | //if no internal queries exist, but media attr does, use that 139 | //note: this currently lacks support for situations where a media attr is specified on a link AND 140 | //its associated stylesheet has internal CSS media queries. 141 | //In those cases, the media attribute will currently be ignored. 142 | if( useMedia ){ 143 | ql = 1; 144 | } 145 | 146 | 147 | for( ; i < ql; i++ ){ 148 | j = 0; 149 | 150 | //media attr 151 | if( useMedia ){ 152 | fullq = media; 153 | rules.push( repUrls( styles ) ); 154 | } 155 | //parse for styles 156 | else{ 157 | fullq = qs[ i ].match( /@media *([^\{]+)\{([\S\s]+?)$/ ) && RegExp.$1; 158 | rules.push( RegExp.$2 && repUrls( RegExp.$2 ) ); 159 | } 160 | 161 | eachq = fullq.split( "," ); 162 | eql = eachq.length; 163 | 164 | for( ; j < eql; j++ ){ 165 | thisq = eachq[ j ]; 166 | mediastyles.push( { 167 | media : thisq.split( "(" )[ 0 ].match( /(only\s+)?([a-zA-Z]+)\s?/ ) && RegExp.$2 || "all", 168 | rules : rules.length - 1, 169 | hasquery: thisq.indexOf("(") > -1, 170 | minw : thisq.match( /\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ), 171 | maxw : thisq.match( /\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ) 172 | } ); 173 | } 174 | } 175 | 176 | applyMedia(); 177 | }, 178 | 179 | lastCall, 180 | 181 | resizeDefer, 182 | 183 | // returns the value of 1em in pixels 184 | getEmValue = function() { 185 | var ret, 186 | div = doc.createElement('div'), 187 | body = doc.body, 188 | fakeUsed = false; 189 | 190 | div.style.cssText = "position:absolute;font-size:1em;width:1em"; 191 | 192 | if( !body ){ 193 | body = fakeUsed = doc.createElement( "body" ); 194 | body.style.background = "none"; 195 | } 196 | 197 | body.appendChild( div ); 198 | 199 | docElem.insertBefore( body, docElem.firstChild ); 200 | 201 | ret = div.offsetWidth; 202 | 203 | if( fakeUsed ){ 204 | docElem.removeChild( body ); 205 | } 206 | else { 207 | body.removeChild( div ); 208 | } 209 | 210 | //also update eminpx before returning 211 | ret = eminpx = parseFloat(ret); 212 | 213 | return ret; 214 | }, 215 | 216 | //cached container for 1em value, populated the first time it's needed 217 | eminpx, 218 | 219 | //enable/disable styles 220 | applyMedia = function( fromResize ){ 221 | var name = "clientWidth", 222 | docElemProp = docElem[ name ], 223 | currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[ name ] || docElemProp, 224 | styleBlocks = {}, 225 | lastLink = links[ links.length-1 ], 226 | now = (new Date()).getTime(); 227 | 228 | //throttle resize calls 229 | if( fromResize && lastCall && now - lastCall < resizeThrottle ){ 230 | clearTimeout( resizeDefer ); 231 | resizeDefer = setTimeout( applyMedia, resizeThrottle ); 232 | return; 233 | } 234 | else { 235 | lastCall = now; 236 | } 237 | 238 | for( var i in mediastyles ){ 239 | var thisstyle = mediastyles[ i ], 240 | min = thisstyle.minw, 241 | max = thisstyle.maxw, 242 | minnull = min === null, 243 | maxnull = max === null, 244 | em = "em"; 245 | 246 | if( !!min ){ 247 | min = parseFloat( min ) * ( min.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 ); 248 | } 249 | if( !!max ){ 250 | max = parseFloat( max ) * ( max.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 ); 251 | } 252 | 253 | // if there's no media query at all (the () part), or min or max is not null, and if either is present, they're true 254 | if( !thisstyle.hasquery || ( !minnull || !maxnull ) && ( minnull || currWidth >= min ) && ( maxnull || currWidth <= max ) ){ 255 | if( !styleBlocks[ thisstyle.media ] ){ 256 | styleBlocks[ thisstyle.media ] = []; 257 | } 258 | styleBlocks[ thisstyle.media ].push( rules[ thisstyle.rules ] ); 259 | } 260 | } 261 | 262 | //remove any existing respond style element(s) 263 | for( var i in appendedEls ){ 264 | if( appendedEls[ i ] && appendedEls[ i ].parentNode === head ){ 265 | head.removeChild( appendedEls[ i ] ); 266 | } 267 | } 268 | 269 | //inject active styles, grouped by media type 270 | for( var i in styleBlocks ){ 271 | var ss = doc.createElement( "style" ), 272 | css = styleBlocks[ i ].join( "\n" ); 273 | 274 | ss.type = "text/css"; 275 | ss.media = i; 276 | 277 | //originally, ss was appended to a documentFragment and sheets were appended in bulk. 278 | //this caused crashes in IE in a number of circumstances, such as when the HTML element had a bg image set, so appending beforehand seems best. Thanks to @dvelyk for the initial research on this one! 279 | head.insertBefore( ss, lastLink.nextSibling ); 280 | 281 | if ( ss.styleSheet ){ 282 | ss.styleSheet.cssText = css; 283 | } 284 | else { 285 | ss.appendChild( doc.createTextNode( css ) ); 286 | } 287 | 288 | //push to appendedEls to track for later removal 289 | appendedEls.push( ss ); 290 | } 291 | }, 292 | //tweaked Ajax functions from Quirksmode 293 | ajax = function( url, callback ) { 294 | var req = xmlHttp(); 295 | if (!req){ 296 | return; 297 | } 298 | req.open( "GET", url, true ); 299 | req.onreadystatechange = function () { 300 | if ( req.readyState != 4 || req.status != 200 && req.status != 304 ){ 301 | return; 302 | } 303 | callback( req.responseText ); 304 | } 305 | if ( req.readyState == 4 ){ 306 | return; 307 | } 308 | req.send( null ); 309 | }, 310 | //define ajax obj 311 | xmlHttp = (function() { 312 | var xmlhttpmethod = false; 313 | try { 314 | xmlhttpmethod = new XMLHttpRequest(); 315 | } 316 | catch( e ){ 317 | xmlhttpmethod = new ActiveXObject( "Microsoft.XMLHTTP" ); 318 | } 319 | return function(){ 320 | return xmlhttpmethod; 321 | }; 322 | })(); 323 | 324 | //translate CSS 325 | ripCSS(); 326 | 327 | //expose update for re-running respond later on 328 | respond.update = ripCSS; 329 | 330 | //adjust on resize 331 | function callMedia(){ 332 | applyMedia( true ); 333 | } 334 | if( win.addEventListener ){ 335 | win.addEventListener( "resize", callMedia, false ); 336 | } 337 | else if( win.attachEvent ){ 338 | win.attachEvent( "onresize", callMedia ); 339 | } 340 | })(this); 341 | -------------------------------------------------------------------------------- /Scripts/respond.min.js: -------------------------------------------------------------------------------- 1 | /* NUGET: BEGIN LICENSE TEXT 2 | * 3 | * Microsoft grants you the right to use these script files for the sole 4 | * purpose of either: (i) interacting through your browser with the Microsoft 5 | * website or online service, subject to the applicable licensing or use 6 | * terms; or (ii) using the files as included with a Microsoft product subject 7 | * to that product's license terms. Microsoft reserves all other rights to the 8 | * files not expressly granted by Microsoft, whether by implication, estoppel 9 | * or otherwise. Insofar as a script file is dual licensed under GPL, 10 | * Microsoft neither took the code under GPL nor distributes it thereunder but 11 | * under the terms set out in this paragraph. All notices and licenses 12 | * below are for informational purposes only. 13 | * 14 | * NUGET: END LICENSE TEXT */ 15 | /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ 16 | /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ 17 | window.matchMedia=window.matchMedia||(function(e,f){var c,a=e.documentElement,b=a.firstElementChild||a.firstChild,d=e.createElement("body"),g=e.createElement("div");g.id="mq-test-1";g.style.cssText="position:absolute;top:-100em";d.style.background="none";d.appendChild(g);return function(h){g.innerHTML='­';a.insertBefore(d,b);c=g.offsetWidth==42;a.removeChild(d);return{matches:c,media:h}}})(document); 18 | 19 | /*! Respond.js v1.2.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ 20 | (function(e){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=e.matchMedia&&e.matchMedia("only all").matches;if(respond.mediaQueriesSupported){return}var w=e.document,s=w.documentElement,i=[],k=[],q=[],o={},h=30,f=w.getElementsByTagName("head")[0]||s,g=w.getElementsByTagName("base")[0],b=f.getElementsByTagName("link"),d=[],a=function(){var D=b,y=D.length,B=0,A,z,C,x;for(;B-1,minw:F.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:F.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}}j()},l,r,v=function(){var z,A=w.createElement("div"),x=w.body,y=false;A.style.cssText="position:absolute;font-size:1em;width:1em";if(!x){x=y=w.createElement("body");x.style.background="none"}x.appendChild(A);s.insertBefore(x,s.firstChild);z=A.offsetWidth;if(y){s.removeChild(x)}else{x.removeChild(A)}z=p=parseFloat(z);return z},p,j=function(I){var x="clientWidth",B=s[x],H=w.compatMode==="CSS1Compat"&&B||w.body[x]||B,D={},G=b[b.length-1],z=(new Date()).getTime();if(I&&l&&z-l-1?(p||v()):1)}if(!!J){J=parseFloat(J)*(J.indexOf(y)>-1?(p||v()):1)}if(!K.hasquery||(!A||!L)&&(A||H>=C)&&(L||H<=J)){if(!D[K.media]){D[K.media]=[]}D[K.media].push(k[K.rules])}}for(var E in q){if(q[E]&&q[E].parentNode===f){f.removeChild(q[E])}}for(var E in D){var M=w.createElement("style"),F=D[E].join("\n");M.type="text/css";M.media=E;f.insertBefore(M,G.nextSibling);if(M.styleSheet){M.styleSheet.cssText=F}else{M.appendChild(w.createTextNode(F))}q.push(M)}},n=function(x,z){var y=c();if(!y){return}y.open("GET",x,true);y.onreadystatechange=function(){if(y.readyState!=4||y.status!=200&&y.status!=304){return}z(y.responseText)};if(y.readyState==4){return}y.send(null)},c=(function(){var x=false;try{x=new XMLHttpRequest()}catch(y){x=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return x}})();a();respond.update=a;function t(){j(true)}if(e.addEventListener){e.addEventListener("resize",t,false)}else{if(e.attachEvent){e.attachEvent("onresize",t)}}})(this); -------------------------------------------------------------------------------- /Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin; 2 | using Owin; 3 | 4 | [assembly: OwinStartupAttribute(typeof(A2_HTML5_Biz_App_New.Startup))] 5 | namespace A2_HTML5_Biz_App_New 6 | { 7 | public partial class Startup 8 | { 9 | public void Configuration(IAppBuilder app) 10 | { 11 | ConfigureAuth(app); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Views/Account/ConfirmEmail.cshtml: -------------------------------------------------------------------------------- 1 | { 2 | ViewBag.Title = "Confirm Email"; 3 | } 4 | 5 |

    @ViewBag.Title.

    6 |
    7 |

    8 | Thank you for confirming your email. Please @Html.ActionLink("Click here to Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }) 9 |

    10 |
    11 | -------------------------------------------------------------------------------- /Views/Account/ExternalLoginConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.ExternalLoginConfirmationViewModel 2 | @{ 3 | ViewBag.Title = "Register"; 4 | } 5 |

    @ViewBag.Title.

    6 |

    Associate your @ViewBag.LoginProvider account.

    7 | 8 | @using (Html.BeginForm("ExternalLoginConfirmation", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 | 12 |

    Association Form

    13 |
    14 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 15 |

    16 | You've successfully authenticated with @ViewBag.LoginProvider. 17 | Please enter a user name for this site below and click the Register button to finish 18 | logging in. 19 |

    20 |
    21 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 22 |
    23 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 24 | @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" }) 25 |
    26 |
    27 |
    28 |
    29 | 30 |
    31 |
    32 | } 33 | 34 | @section Scripts { 35 | @Scripts.Render("~/bundles/jqueryval") 36 | } 37 | -------------------------------------------------------------------------------- /Views/Account/ExternalLoginFailure.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Login Failure"; 3 | } 4 | 5 |
    6 |

    @ViewBag.Title.

    7 |

    Unsuccessful login with service.

    8 |
    9 | -------------------------------------------------------------------------------- /Views/Account/ForgotPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.ForgotPasswordViewModel 2 | @{ 3 | ViewBag.Title = "Forgot your password?"; 4 | } 5 | 6 |

    @ViewBag.Title.

    7 | 8 | @using (Html.BeginForm("ForgotPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 |

    Enter your email.

    12 |
    13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
    15 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 16 |
    17 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 18 |
    19 |
    20 |
    21 |
    22 | 23 |
    24 |
    25 | } 26 | 27 | @section Scripts { 28 | @Scripts.Render("~/bundles/jqueryval") 29 | } 30 | -------------------------------------------------------------------------------- /Views/Account/ForgotPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Forgot Password Confirmation"; 3 | } 4 | 5 |
    6 |

    @ViewBag.Title.

    7 |
    8 |
    9 |

    10 | Please check your email to reset your password. 11 |

    12 |
    13 | 14 | -------------------------------------------------------------------------------- /Views/Account/Login.cshtml: -------------------------------------------------------------------------------- 1 | @using A2_HTML5_Biz_App_New.Models 2 | @model LoginViewModel 3 | @{ 4 | ViewBag.Title = "Log in"; 5 | } 6 | 7 |

    @ViewBag.Title.

    8 |
    9 |
    10 |
    11 | @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 12 | { 13 | @Html.AntiForgeryToken() 14 |

    Use a local account to log in.

    15 |
    16 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 17 |
    18 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 19 |
    20 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 21 | @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" }) 22 |
    23 |
    24 |
    25 | @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) 26 |
    27 | @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) 28 | @Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" }) 29 |
    30 |
    31 |
    32 |
    33 |
    34 | @Html.CheckBoxFor(m => m.RememberMe) 35 | @Html.LabelFor(m => m.RememberMe) 36 |
    37 |
    38 |
    39 |
    40 |
    41 | 42 |
    43 |
    44 |

    45 | @Html.ActionLink("Register as a new user", "Register") 46 |

    47 | @* Enable this once you have account confirmation enabled for password reset functionality 48 |

    49 | @Html.ActionLink("Forgot your password?", "ForgotPassword") 50 |

    *@ 51 | } 52 |
    53 |
    54 |
    55 |
    56 | @Html.Partial("_ExternalLoginsListPartial", new ExternalLoginListViewModel { ReturnUrl = ViewBag.ReturnUrl }) 57 |
    58 |
    59 |
    60 | 61 | @section Scripts { 62 | @Scripts.Render("~/bundles/jqueryval") 63 | } -------------------------------------------------------------------------------- /Views/Account/Register.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.RegisterViewModel 2 | @{ 3 | ViewBag.Title = "Register"; 4 | } 5 | 6 |

    @ViewBag.Title.

    7 | 8 | @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 |

    Create a new account.

    12 |
    13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
    15 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 16 |
    17 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 18 |
    19 |
    20 |
    21 | @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) 22 |
    23 | @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) 24 |
    25 |
    26 |
    27 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 28 |
    29 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 30 |
    31 |
    32 | 33 |
    34 | @Html.Label("Select Your User Type", new { @class = "col-md-2 control-label" }) 35 |
    36 | @Html.DropDownList("Name") 37 |
    38 |
    39 | 40 | 41 |
    42 |
    43 | 44 |
    45 |
    46 | } 47 | 48 | @section Scripts { 49 | @Scripts.Render("~/bundles/jqueryval") 50 | } 51 | -------------------------------------------------------------------------------- /Views/Account/ResetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.ResetPasswordViewModel 2 | @{ 3 | ViewBag.Title = "Reset password"; 4 | } 5 | 6 |

    @ViewBag.Title.

    7 | 8 | @using (Html.BeginForm("ResetPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 |

    Reset your password.

    12 |
    13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 | @Html.HiddenFor(model => model.Code) 15 |
    16 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 17 |
    18 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 19 |
    20 |
    21 |
    22 | @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) 23 |
    24 | @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) 25 |
    26 |
    27 |
    28 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 29 |
    30 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 31 |
    32 |
    33 |
    34 |
    35 | 36 |
    37 |
    38 | } 39 | 40 | @section Scripts { 41 | @Scripts.Render("~/bundles/jqueryval") 42 | } 43 | -------------------------------------------------------------------------------- /Views/Account/ResetPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Reset password confirmation"; 3 | } 4 | 5 |
    6 |

    @ViewBag.Title.

    7 |
    8 |
    9 |

    10 | Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }) 11 |

    12 |
    13 | -------------------------------------------------------------------------------- /Views/Account/SendCode.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.SendCodeViewModel 2 | @{ 3 | ViewBag.Title = "Send"; 4 | } 5 | 6 |

    @ViewBag.Title.

    7 | 8 | @using (Html.BeginForm("SendCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { 9 | @Html.AntiForgeryToken() 10 | @Html.Hidden("rememberMe", @Model.RememberMe) 11 |

    Send verification code

    12 |
    13 |
    14 |
    15 | Select Two-Factor Authentication Provider: 16 | @Html.DropDownListFor(model => model.SelectedProvider, Model.Providers) 17 | 18 |
    19 |
    20 | } 21 | 22 | @section Scripts { 23 | @Scripts.Render("~/bundles/jqueryval") 24 | } 25 | -------------------------------------------------------------------------------- /Views/Account/VerifyCode.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.VerifyCodeViewModel 2 | @{ 3 | ViewBag.Title = "Verify"; 4 | } 5 | 6 |

    @ViewBag.Title.

    7 | 8 | @using (Html.BeginForm("VerifyCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { 9 | @Html.AntiForgeryToken() 10 | @Html.Hidden("provider", @Model.Provider) 11 | @Html.Hidden("rememberMe", @Model.RememberMe) 12 |

    Enter verification code

    13 |
    14 | @Html.ValidationSummary("", new { @class = "text-danger" }) 15 |
    16 | @Html.LabelFor(m => m.Code, new { @class = "col-md-2 control-label" }) 17 |
    18 | @Html.TextBoxFor(m => m.Code, new { @class = "form-control" }) 19 |
    20 |
    21 |
    22 |
    23 |
    24 | @Html.CheckBoxFor(m => m.RememberBrowser) 25 | @Html.LabelFor(m => m.RememberBrowser) 26 |
    27 |
    28 |
    29 |
    30 |
    31 | 32 |
    33 |
    34 | } 35 | 36 | @section Scripts { 37 | @Scripts.Render("~/bundles/jqueryval") 38 | } 39 | -------------------------------------------------------------------------------- /Views/Account/_ChangePasswordPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using A2_HTML5_Biz_App_New.Models 2 | @model Microsoft.AspNet.Identity.ManageUserViewModel 3 | 4 | @using (Html.BeginForm("Manage", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 5 | { 6 | @Html.AntiForgeryToken() 7 |

    Change Password Form

    8 |
    9 | @Html.ValidationSummary("", new { @class = "text-danger" }) 10 |
    11 | @Html.LabelFor(m => m.OldPassword, new { @class = "col-md-2 control-label" }) 12 |
    13 | @Html.PasswordFor(m => m.OldPassword, new { @class = "form-control" }) 14 |
    15 |
    16 |
    17 | @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) 18 |
    19 | @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) 20 |
    21 |
    22 |
    23 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 24 |
    25 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 26 |
    27 |
    28 | 29 |
    30 |
    31 | 32 |
    33 |
    34 | } 35 | -------------------------------------------------------------------------------- /Views/Account/_ExternalLoginsListPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.ExternalLoginListViewModel 2 | @using Microsoft.Owin.Security 3 | 4 |

    Use another service to log in.

    5 |
    6 | @{ 7 | var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes(); 8 | if (loginProviders.Count() == 0) { 9 |
    10 |

    11 | There are no external authentication services configured. See this article 12 | for details on setting up this ASP.NET application to support logging in via external services. 13 |

    14 |
    15 | } 16 | else { 17 | using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = Model.ReturnUrl })) { 18 | @Html.AntiForgeryToken() 19 |
    20 |

    21 | @foreach (AuthenticationDescription p in loginProviders) { 22 | 23 | } 24 |

    25 |
    26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Views/Account/_RemoveAccountPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model ICollection 2 | 3 | @if (Model.Count > 0) 4 | { 5 |

    Registered Logins

    6 | 7 | 8 | @foreach (var account in Model) 9 | { 10 | 11 | 12 | 30 | 31 | } 32 | 33 |
    @account.LoginProvider 13 | @if (ViewBag.ShowRemoveButton) 14 | { 15 | using (Html.BeginForm("Disassociate", "Account")) 16 | { 17 | @Html.AntiForgeryToken() 18 |
    19 | @Html.Hidden("loginProvider", account.LoginProvider) 20 | @Html.Hidden("providerKey", account.ProviderKey) 21 | 22 |
    23 | } 24 | } 25 | else 26 | { 27 | @:   28 | } 29 |
    34 | } 35 | -------------------------------------------------------------------------------- /Views/Account/_SetPasswordPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.ManageUserViewModel 2 | 3 | @using (Html.BeginForm("Manage", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 4 | { 5 |

    6 | You do not have a local username/password for this site. Add a local 7 | account so you can log in without an external login. 8 |

    9 | @Html.AntiForgeryToken() 10 | 11 |

    Create Local Login

    12 |
    13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
    15 | @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) 16 |
    17 | @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) 18 |
    19 |
    20 |
    21 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 22 |
    23 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 24 |
    25 |
    26 |
    27 |
    28 | 29 |
    30 |
    31 | } 32 | -------------------------------------------------------------------------------- /Views/Agent/Index.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 | 7 | 8 | 9 |

    Index

    10 | 11 | 12 | 15 | 19 | 20 | 21 | 24 | 28 | 29 | 30 | 33 | 37 | 38 | 39 | 42 | 46 | 47 | 48 | 51 | 54 | 55 | 56 | 59 | 63 | 64 | 65 | 68 | 72 | 73 | 74 | 77 | 81 | 82 | 83 | 86 | 90 | 91 | 92 | 95 | 99 | 100 | 101 | 104 | 108 | 109 | 110 | 114 | 118 | 119 |
    13 | Agent Id: 14 | 16 | 18 |
    22 | Agent Name: 23 | 25 | 27 |
    31 | Agent Address: 32 | 34 | 36 |
    40 | Company Name: 41 | 43 | 45 |
    49 | Office Address: 50 | 52 | 53 |
    57 | City: 58 | 60 | 62 |
    66 | State: 67 | 69 | 71 |
    75 | Personal Contact: 76 | 78 | 80 |
    84 | Office Contact: 85 | 87 | 89 |
    93 | Email: 94 | 96 | 98 |
    102 | Web Site: 103 | 105 | 107 |
    111 | 113 | 115 | 117 |
    120 | 121 | 122 | -------------------------------------------------------------------------------- /Views/Customer/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Index"; 3 | } 4 | 5 |

    Index

    6 | 7 | 8 | 9 | 10 | 11 | 19 | 20 |
    21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 40 | 41 | 42 | 43 | 44 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 60 | 61 | 66 | 67 | 68 | 69 | 74 | 75 | 76 | 77 | 82 | 83 | 84 | 87 | 93 | 94 |
    Customer Id 26 | 30 |
    Name 36 | 39 |
    Address 45 | 48 |
    City 54 | 57 |
    Email 62 | 65 |
    Primary Contact: 70 | 73 |
    Secondary Contact 78 | 81 |
    85 | 86 | 88 | 92 |
    95 |
    96 |
    97 | @Html.ActionLink("Continue to Search Property", "SearchProperties", 98 | "Customer") 99 |
    100 | 101 | 102 | -------------------------------------------------------------------------------- /Views/Customer/SearchProperties.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewBag.Title = "SearchProperties"; 4 | } 5 | 6 | 41 | 42 | 43 | 44 | 45 |

    Search Properties Available for Sale or Rent

    46 | 47 | 48 | 49 | 50 | 53 | 54 | 57 | 58 | 59 | 63 | 67 | 71 | 72 |
    51 | Property Type 52 | 55 | Status 56 |
    60 | 62 | 64 | 66 | 68 | 70 |
    73 | 75 |
    76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 98 | 101 | 104 | 107 | 110 | 113 | 116 | 119 | 122 | 125 | 128 | 131 | 132 | 133 |
    Property IdOwner NamePrimary ContactSecondary ContactEmailProperty TypeAddressNo. of BedRoomsTotal RoomsBuild up AreaSale Rent StatusAvailable Status
    96 | 97 | 99 | 100 | 102 | 103 | 105 | 106 | 108 | 109 | 111 | 112 | 114 | 115 | 117 | 118 | 120 | 121 | 123 | 124 | 126 | 127 | 129 | 130 |
    134 |
    135 | -------------------------------------------------------------------------------- /Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "About"; 3 | } 4 |

    @ViewBag.Title.

    5 |

    @ViewBag.Message

    6 | 7 |

    Use this area to provide additional information.

    8 | -------------------------------------------------------------------------------- /Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Contact"; 3 | } 4 |

    @ViewBag.Title.

    5 |

    @ViewBag.Message

    6 | 7 |
    8 | One Microsoft Way
    9 | Redmond, WA 98052-6399
    10 | P: 11 | 425.555.0100 12 |
    13 | 14 |
    15 | Support: Support@example.com
    16 | Marketing: Marketing@example.com 17 |
    -------------------------------------------------------------------------------- /Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Property Manager Home Page"; 3 | } 4 | 5 |
    6 |

    Property Information Portal

    7 |

    The Unique Portal for Owners and Customers

    8 | 9 |
    10 | 11 |
    12 |

    Please @Html.ActionLink("Login","Login","Account") with your User Role Type.

    13 |

    If you are New User then please @Html.ActionLink("Register", "Register", "Account") and select your user role as Owner and Customer

    14 |
    -------------------------------------------------------------------------------- /Views/Manage/AddPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.AddPhoneNumberViewModel 2 | @{ 3 | ViewBag.Title = "Phone Number"; 4 | } 5 | 6 |

    @ViewBag.Title.

    7 | 8 | @using (Html.BeginForm("AddPhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 |

    Add a phone number

    12 |
    13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
    15 | @Html.LabelFor(m => m.Number, new { @class = "col-md-2 control-label" }) 16 |
    17 | @Html.TextBoxFor(m => m.Number, new { @class = "form-control" }) 18 |
    19 |
    20 |
    21 |
    22 | 23 |
    24 |
    25 | } 26 | 27 | @section Scripts { 28 | @Scripts.Render("~/bundles/jqueryval") 29 | } 30 | -------------------------------------------------------------------------------- /Views/Manage/ChangePassword.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.ChangePasswordViewModel 2 | @{ 3 | ViewBag.Title = "Change Password"; 4 | } 5 | 6 |

    @ViewBag.Title.

    7 | 8 | @using (Html.BeginForm("ChangePassword", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 |

    Change Password Form

    12 |
    13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
    15 | @Html.LabelFor(m => m.OldPassword, new { @class = "col-md-2 control-label" }) 16 |
    17 | @Html.PasswordFor(m => m.OldPassword, new { @class = "form-control" }) 18 |
    19 |
    20 |
    21 | @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) 22 |
    23 | @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) 24 |
    25 |
    26 |
    27 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 28 |
    29 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 30 |
    31 |
    32 |
    33 |
    34 | 35 |
    36 |
    37 | } 38 | @section Scripts { 39 | @Scripts.Render("~/bundles/jqueryval") 40 | } -------------------------------------------------------------------------------- /Views/Manage/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.IndexViewModel 2 | @{ 3 | ViewBag.Title = "Manage"; 4 | } 5 | 6 |

    @ViewBag.Title.

    7 | 8 |

    @ViewBag.StatusMessage

    9 |
    10 |

    Change your account settings

    11 |
    12 |
    13 |
    Password:
    14 |
    15 | [ 16 | @if (Model.HasPassword) 17 | { 18 | @Html.ActionLink("Change your password", "ChangePassword") 19 | } 20 | else 21 | { 22 | @Html.ActionLink("Create", "SetPassword") 23 | } 24 | ] 25 |
    26 |
    External Logins:
    27 |
    28 | @Model.Logins.Count [ 29 | @Html.ActionLink("Manage", "ManageLogins") ] 30 |
    31 | @* 32 | Phone Numbers can used as a second factor of verification in a two-factor authentication system. 33 | 34 | See this article 35 | for details on setting up this ASP.NET application to support two-factor authentication using SMS. 36 | 37 | Uncomment the following block after you have set up two-factor authentication 38 | *@ 39 | @* 40 |
    Phone Number:
    41 |
    42 | @(Model.PhoneNumber ?? "None") [ 43 | @if (Model.PhoneNumber != null) 44 | { 45 | @Html.ActionLink("Change", "AddPhoneNumber") 46 | @:  |  47 | @Html.ActionLink("Remove", "RemovePhoneNumber") 48 | } 49 | else 50 | { 51 | @Html.ActionLink("Add", "AddPhoneNumber") 52 | } 53 | ] 54 |
    55 | *@ 56 |
    Two-Factor Authentication:
    57 |
    58 |

    59 | There are no two-factor authentication providers configured. See this article 60 | for details on setting up this ASP.NET application to support two-factor authentication. 61 |

    62 | @*@if (Model.TwoFactor) 63 | { 64 | 65 |
    66 | Enabled 67 | 68 |
    69 | } 70 | else 71 | { 72 | 73 |
    74 | Disabled 75 | 76 |
    77 | }*@ 78 |
    79 |
    80 |
    81 | -------------------------------------------------------------------------------- /Views/Manage/ManageLogins.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.ManageLoginsViewModel 2 | @using Microsoft.Owin.Security 3 | @{ 4 | ViewBag.Title = "Manage your external logins"; 5 | } 6 | 7 |

    @ViewBag.Title.

    8 | 9 |

    @ViewBag.StatusMessage

    10 | @if (Model.CurrentLogins.Count > 0) 11 | { 12 |

    Registered Logins

    13 | 14 | 15 | @foreach (var account in Model.CurrentLogins) 16 | { 17 | 18 | 19 | 37 | 38 | } 39 | 40 |
    @account.LoginProvider 20 | @if (ViewBag.ShowRemoveButton) 21 | { 22 | using (Html.BeginForm("RemoveLogin", "Manage")) 23 | { 24 | @Html.AntiForgeryToken() 25 |
    26 | @Html.Hidden("loginProvider", account.LoginProvider) 27 | @Html.Hidden("providerKey", account.ProviderKey) 28 | 29 |
    30 | } 31 | } 32 | else 33 | { 34 | @:   35 | } 36 |
    41 | } 42 | @if (Model.OtherLogins.Count > 0) 43 | { 44 |

    Add another service to log in.

    45 |
    46 | using (Html.BeginForm("LinkLogin", "Manage")) 47 | { 48 | @Html.AntiForgeryToken() 49 |
    50 |

    51 | @foreach (AuthenticationDescription p in Model.OtherLogins) 52 | { 53 | 54 | } 55 |

    56 |
    57 | } 58 | } 59 | 60 | -------------------------------------------------------------------------------- /Views/Manage/SetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.SetPasswordViewModel 2 | @{ 3 | ViewBag.Title = "Create Password"; 4 | } 5 | 6 |

    @ViewBag.Title.

    7 |

    8 | You do not have a local username/password for this site. Add a local 9 | account so you can log in without an external login. 10 |

    11 | 12 | @using (Html.BeginForm("SetPassword", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 13 | { 14 | @Html.AntiForgeryToken() 15 | 16 |

    Create Local Login

    17 |
    18 | @Html.ValidationSummary("", new { @class = "text-danger" }) 19 |
    20 | @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) 21 |
    22 | @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) 23 |
    24 |
    25 |
    26 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 27 |
    28 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 29 |
    30 |
    31 |
    32 |
    33 | 34 |
    35 |
    36 | } 37 | @section Scripts { 38 | @Scripts.Render("~/bundles/jqueryval") 39 | } -------------------------------------------------------------------------------- /Views/Manage/VerifyPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model A2_HTML5_Biz_App_New.Models.VerifyPhoneNumberViewModel 2 | @{ 3 | ViewBag.Title = "Verify Phone Number"; 4 | } 5 | 6 |

    @ViewBag.Title.

    7 | 8 | @using (Html.BeginForm("VerifyPhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 | @Html.Hidden("phoneNumber", @Model.PhoneNumber) 12 |

    Enter verification code

    13 |
    @ViewBag.Status
    14 |
    15 | @Html.ValidationSummary("", new { @class = "text-danger" }) 16 |
    17 | @Html.LabelFor(m => m.Code, new { @class = "col-md-2 control-label" }) 18 |
    19 | @Html.TextBoxFor(m => m.Code, new { @class = "form-control" }) 20 |
    21 |
    22 |
    23 |
    24 | 25 |
    26 |
    27 | } 28 | 29 | @section Scripts { 30 | @Scripts.Render("~/bundles/jqueryval") 31 | } 32 | -------------------------------------------------------------------------------- /Views/Owner/Index.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 |

    Index

    7 | 8 | 9 | 10 | 18 | 19 | 20 | 21 | 22 |
    23 | 24 | 25 | 26 | 27 | 32 | 33 | 34 | 35 | 40 | 41 | 42 | 43 | 48 | 49 | 50 | 51 | 56 | 57 | 58 | 59 | 64 | 65 | 66 | 67 | 72 | 73 | 74 | 75 | 80 | 81 | 82 | 85 | 92 | 93 |
    OwnerId 28 | 31 |
    Name 36 | 39 |
    Address 44 | 47 |
    City 52 | 55 |
    Email 60 | 63 |
    Primary Contact 68 | 71 |
    Secondary Contact 76 | 79 |
    83 | 84 | 86 | 91 |
    94 |
    95 |
    96 | @Html.ActionLink("Continue to Register Property", "Index", 97 | "OwnerPropertyDescription") 98 |
    99 |
    100 | 101 |
    102 | 103 | -------------------------------------------------------------------------------- /Views/OwnerPropertyDescription/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Index"; 3 | } 4 | 23 | 24 | 25 | 26 | 27 | 35 | 36 | 37 | 38 | 39 |

    Index

    40 | 41 |
    42 | 43 | 44 | 45 | 48 | 51 | 54 | 57 | 60 | 63 | 66 | 69 | 72 | 75 | 78 | 81 | 82 | 83 | 84 | 85 | 88 | 91 | 94 | 97 | 100 | 103 | 106 | 109 | 112 | 115 | 118 | 121 | 122 | 123 | 124 |
    46 | Property No 47 | 49 | The Property Type 50 | 52 | Address 53 | 55 | No of Bedrooms 56 | 58 | Total Rooms 59 | 61 | Buildup Area 62 | 64 | Description 65 | 67 | Property Status 68 | 70 | Cost 71 | 73 | Property Age 74 | 76 | Status 77 | 79 | Registration Date 80 |
    86 | 87 | 89 | 90 | 92 | 93 | 95 | 96 | 98 | 99 | 101 | 102 | 104 | 105 | 107 | 108 | 110 | 111 | 113 | 114 | 116 | 117 | 119 | 120 |
    125 |
    126 | 127 |
    128 | 129 |
    130 | 131 | 132 | 135 | 140 | 141 | 142 | 145 | 148 | 149 | 150 | 153 | 159 | 160 | 161 | 162 | 167 | 168 | 169 | 172 | 176 | 177 | 178 | 181 | 185 | 186 | 187 | 190 | 194 | 195 | 196 | 199 | 203 | 204 | 205 | 208 | 212 | 213 | 214 | 217 | 221 | 222 | 223 | 224 | 228 | 229 | 230 | 234 | 239 | 240 |
    133 | Owner Poperty Id: 134 | 136 | 139 |
    143 | Property Type: 144 | 146 | 147 |
    151 | Owner Name: 152 | 154 | 155 | 158 |
    Address 163 | 166 |
    170 | No. Of BedRooms: 171 | 173 | 175 |
    179 | Total Rooms: 180 | 182 | 184 |
    188 | Build Up Area: 189 | 191 | 193 |
    197 | Property Description: 198 | 200 | 202 |
    206 | Published For (Sale/Rent): 207 | 209 | 211 |
    215 | The Expected Cost 216 | 218 | 220 |
    Property Age 225 | 227 |
    231 | 233 | 235 | 238 |
    241 |
    242 | 243 |
    244 |
    245 |
    246 | 247 | -------------------------------------------------------------------------------- /Views/Role/AssignUserToRole.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Assign Users to Role"; 3 | } 4 | 5 | 6 |

    Assign Users to Role

    7 | 8 | 9 | 12 | 15 | 16 |
    10 | @Html.ActionLink("Create New Role", "Create") 11 | 13 | @Html.ActionLink("Assign User to Role", "AssignUserToRole") 14 |
    17 | 18 | 19 |

    Role Add to User

    20 | @using (Html.BeginForm("UserAddToRole", "Role")) 21 | { 22 | @Html.AntiForgeryToken() 23 | @Html.ValidationSummary(true) 24 | 25 |

    26 | Username : @Html.Editor("UserName") 27 | Role Name: @Html.DropDownList("RoleName", ( 28 | IEnumerable)ViewBag.Roles, "Select Role") 29 |

    30 | 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /Views/Role/Create.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Create"; 3 | } 4 |

    Create Role

    5 | @Html.ActionLink("Available Roles", "Index") | @Html.ActionLink("Manage User In Role", "AssignUserToRole") 6 |
    7 | @using (Html.BeginForm()) 8 | { 9 | @Html.AntiForgeryToken() 10 | @Html.ValidationSummary(true) 11 | 12 |
    13 | Role Name: 14 |
    15 |

    16 | @Html.Editor("RoleName") 17 | @*@Html.TextBox("RoleName")*@ 18 |

    19 | 20 | } 21 | -------------------------------------------------------------------------------- /Views/Role/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 | 7 |

    Index

    8 | 9 | 10 | 13 | 16 | 17 |
    11 | @Html.ActionLink("Create New Role", "Create") 12 | 14 | @Html.ActionLink("Manage User In Role", "AssignUserToRole") 15 |
    18 |
    19 |
    20 | 21 | 22 | @foreach (var role in Model) 23 | { 24 | 25 | 28 | 31 | 32 | } 33 |
    26 | @role.Name 27 | 29 | @Html.ActionLink("Edit", "Edit", new { roleName = @role.Name }) 30 |
    34 | -------------------------------------------------------------------------------- /Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Error"; 5 | } 6 | 7 |

    Error.

    8 |

    An error occurred while processing your request.

    9 | 10 | -------------------------------------------------------------------------------- /Views/Shared/Lockout.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Locked Out"; 5 | } 6 | 7 |
    8 |

    Locked out.

    9 |

    This account has been locked out, please try again later.

    10 |
    11 | -------------------------------------------------------------------------------- /Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title - My ASP.NET Application 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | 10 | 11 | 12 | 35 |
    36 | @RenderBody() 37 |
    38 |
    39 |

    © @DateTime.Now.Year - My ASP.NET Application

    40 |
    41 |
    42 | 43 | @Scripts.Render("~/bundles/jquery") 44 | @Scripts.Render("~/bundles/bootstrap") 45 | @RenderSection("scripts", required: false) 46 | 47 | 48 | -------------------------------------------------------------------------------- /Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNet.Identity 2 | @if (Request.IsAuthenticated) 3 | { 4 | using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) 5 | { 6 | @Html.AntiForgeryToken() 7 | 8 | 14 | } 15 | } 16 | else 17 | { 18 | 22 | } 23 | -------------------------------------------------------------------------------- /Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
    7 |
    8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/html5-mvc-business-app/686a23b0eb02adaa922c4956e321170bd12d07d4/favicon.ico -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/html5-mvc-business-app/686a23b0eb02adaa922c4956e321170bd12d07d4/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/html5-mvc-business-app/686a23b0eb02adaa922c4956e321170bd12d07d4/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/html5-mvc-business-app/686a23b0eb02adaa922c4956e321170bd12d07d4/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnetcurry/html5-mvc-business-app/686a23b0eb02adaa922c4956e321170bd12d07d4/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | --------------------------------------------------------------------------------