├── .gitignore ├── BookStore.sln ├── BookStore.v11.suo ├── BookStore ├── App_Data │ ├── bookstore.mdf │ └── bookstore_log.ldf ├── BookController.cs ├── BookStore.csproj ├── BookStore.csproj.user ├── Default.aspx ├── Default.aspx.cs ├── Default.aspx.designer.cs ├── Global.asax ├── Global.asax.cs ├── Properties │ └── AssemblyInfo.cs ├── Resources │ └── Images │ │ ├── 0star.png │ │ ├── 1star.png │ │ ├── 2star.png │ │ ├── 3star.png │ │ ├── 4star.png │ │ ├── 5star.png │ │ ├── a-clash-of-kings-a-song-of-ice-and-fire-book-2-400x400-imadhkz8mymsdv46.jpeg │ │ ├── a-degree-in-death-400x400-imadfw74gfzsbbng.jpeg │ │ ├── artemis-fowl-and-the-last-guardian-400x400-imadb8fthzuzh7uv.jpeg │ │ ├── can-love-happen-twice-400x400-imadarucay5gxr5g.jpeg │ │ ├── dragon-reborn-wheel-of-time-book-3-400x400-imadz74fbteazkjv.jpeg │ │ ├── eragon-400x400-imada5h5ufgtehvr.jpeg │ │ ├── foundation-400x400-imadekrnpmmnqtwz.jpeg │ │ ├── game-of-thrones-a-song-of-ice-and-fire-book-1-400x400-imadhktfugaghygp.jpeg │ │ ├── gone-girl-400x400-imadehcn4erysgcg.jpeg │ │ ├── harry-potter-and-the-deathly-hallows-signature-edition-400x400-imadbkz2jhz5f6su.jpeg │ │ ├── jonathan-livingston-seagull-a-story-400x400-imadat8fmeyfbumn.jpeg │ │ ├── jurassic-park-400x400-imadgdeh2jukhcj2.jpeg │ │ ├── kane-chronicles-the-throne-of-fire-400x400-imadgu4geqbynm4r.jpeg │ │ ├── love-endeavors-400x400-imadhepbzwdzvsch.jpeg │ │ ├── love-stories-that-touched-my-heart-400x400-imadjvruag5rzgxn.jpeg │ │ ├── mage-s-blood-the-montide-quartet-400x400-imadfzka4zxhgg7z.jpeg │ │ ├── malgudi-days-400x400-imadat2auzypym2e.jpeg │ │ ├── malgudi-schooldays-400x400-imadjkpq2mtakhcj.jpeg │ │ ├── manhattan-in-reverse-400x400-imadgucbxj96mfcx.jpeg │ │ ├── midnight-s-children-400x400-imadjsauh2gvkhut.jpeg │ │ ├── murder-on-orient-express-400x400-imadesm3hqnapjyw.jpeg │ │ ├── noonshade-400x400-imadkv44wkhbn6um.jpeg │ │ ├── off-armageddon-reef-400x400-imadguwwwzrfu64z.jpeg │ │ ├── oliver-s-story-it-takes-someone-very-special-to-forget-the-love-of-your-life-400x400-imadh6vgwb2z45ht.jpeg │ │ ├── salvation-of-a-saint-400x400-imadg558fdzkvrxs.jpeg │ │ ├── solar-400x400-imadhhbpk9rmc8w6.jpeg │ │ ├── someone-like-you-400x400-imadht2fay9nmfuf.jpeg │ │ ├── the-air-war-400x400-imadbhrmd4tdgqmd.jpeg │ │ ├── the-edge-of-the-machete-400x400-imadd2ekeqhgatcs.jpeg │ │ ├── the-fountainhead-400x400-imad9wngvsevjnfy.jpeg │ │ ├── the-hit-400x400-imadku9feqx8zkjz.jpeg │ │ ├── the-krishna-key-400x400-imadayvmeqfbbwyg.jpeg │ │ ├── the-lord-of-the-rings-400x400-imadez6ppyjy36mh.jpeg │ │ ├── the-lost-symbol-400x400-imadaryjh8guqyah.jpeg │ │ ├── the-murder-of-roger-ackroyd-400x400-imadag4c3rhffhhd.jpeg │ │ ├── the-secret-wish-list-400x400-imadkuygztrkfhpz.jpeg │ │ ├── the-taj-conspiracy-400x400-imad8makhs7eznhz.jpeg │ │ ├── the-third-bullet-400x400-imadzrf6vedwtpj9.jpeg │ │ ├── thea-stilton-and-the-secret-of-the-old-castle-400x400-imadgd5mr9vrrbmd.jpeg │ │ ├── to-kill-a-mockingbird-400x400-imadat2amn7wzuqv.jpeg │ │ ├── train-to-pakistan-400x400-imadas3h89nnmwkh.jpeg │ │ ├── uff-ye-emotions-a-collection-of-award-winning-love-stories-400x400-imadhesu5scdsekz.jpeg │ │ ├── wake-400x400-imadbhrnrmj3wbrn.jpeg │ │ └── wheel-of-time-14-a-memory-of-light-400x400-imadgaw4ecpxfguc.jpeg ├── Scripts │ ├── App.js │ └── tooltip.js ├── Site1.Master ├── Site1.Master.cs ├── Site1.Master.designer.cs ├── Style │ └── StyleSheet.css ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── book-detail.html ├── books.html └── packages.config ├── Controller ├── Controller.cs ├── Controller.csproj └── Properties │ └── AssemblyInfo.cs ├── DataAccess ├── DataAccess.cs ├── DataAccess.csproj └── Properties │ └── AssemblyInfo.cs ├── Database Scripts └── dbo.tblBook.sql ├── LICENSE ├── README.md ├── Shared ├── Models │ └── BookModel.cs ├── Properties │ └── AssemblyInfo.cs ├── Shared.cs └── Shared.csproj └── packages ├── Microsoft.AspNet.WebApi.4.0.20710.0 └── Microsoft.AspNet.WebApi.4.0.20710.0.nupkg ├── Microsoft.AspNet.WebApi.Client.4.0.20710.0 ├── Microsoft.AspNet.WebApi.Client.4.0.20710.0.nupkg └── lib │ └── net40 │ ├── System.Net.Http.Formatting.dll │ └── System.Net.Http.Formatting.xml ├── Microsoft.AspNet.WebApi.Core.4.0.20710.0 ├── Microsoft.AspNet.WebApi.Core.4.0.20710.0.nupkg ├── content │ └── web.config.transform └── lib │ └── net40 │ ├── System.Web.Http.dll │ └── System.Web.Http.xml ├── Microsoft.AspNet.WebApi.WebHost.4.0.20710.0 ├── Microsoft.AspNet.WebApi.WebHost.4.0.20710.0.nupkg └── lib │ └── net40 │ ├── System.Web.Http.WebHost.dll │ └── System.Web.Http.WebHost.xml ├── Microsoft.Net.Http.2.0.20710.0 ├── Microsoft.Net.Http.2.0.20710.0.nupkg └── lib │ ├── net40 │ ├── System.Net.Http.WebRequest.dll │ ├── System.Net.Http.WebRequest.xml │ ├── System.Net.Http.dll │ └── System.Net.Http.xml │ └── net45 │ └── _._ ├── Newtonsoft.Json.4.5.6 ├── Newtonsoft.Json.4.5.6.nupkg └── lib │ └── net40 │ ├── Newtonsoft.Json.dll │ └── Newtonsoft.Json.xml └── repositories.config /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | [Dd]ebug/ 11 | [Dd]ebugPublic/ 12 | [Rr]elease/ 13 | build/ 14 | bld/ 15 | [Bb]in/ 16 | [Oo]bj/ 17 | 18 | # MSTest test Results 19 | [Tt]est[Rr]esult*/ 20 | [Bb]uild[Ll]og.* 21 | 22 | #NUNIT 23 | *.VisualState.xml 24 | TestResult.xml 25 | 26 | *_i.c 27 | *_p.c 28 | *_i.h 29 | *.ilk 30 | *.meta 31 | *.obj 32 | *.pch 33 | *.pdb 34 | *.pgc 35 | *.pgd 36 | *.rsp 37 | *.sbr 38 | *.tlb 39 | *.tli 40 | *.tlh 41 | *.tmp 42 | *.tmp_proj 43 | *.log 44 | *.vspscc 45 | *.vssscc 46 | .builds 47 | *.pidb 48 | *.svclog 49 | *.scc 50 | 51 | # Chutzpah Test files 52 | _Chutzpah* 53 | 54 | # Visual C++ cache files 55 | ipch/ 56 | *.aps 57 | *.ncb 58 | *.opensdf 59 | *.sdf 60 | *.cachefile 61 | 62 | # Visual Studio profiler 63 | *.psess 64 | *.vsp 65 | *.vspx 66 | 67 | # TFS 2012 Local Workspace 68 | $tf/ 69 | 70 | # Guidance Automation Toolkit 71 | *.gpState 72 | 73 | # ReSharper is a .NET coding add-in 74 | _ReSharper*/ 75 | *.[Rr]e[Ss]harper 76 | *.DotSettings.user 77 | 78 | # JustCode is a .NET coding addin-in 79 | .JustCode 80 | 81 | # TeamCity is a build add-in 82 | _TeamCity* 83 | 84 | # DotCover is a Code Coverage Tool 85 | *.dotCover 86 | 87 | # NCrunch 88 | *.ncrunch* 89 | _NCrunch_* 90 | .*crunch*.local.xml 91 | 92 | # MightyMoose 93 | *.mm.* 94 | AutoTest.Net/ 95 | 96 | # Installshield output folder 97 | [Ee]xpress/ 98 | 99 | # DocProject is a documentation generator add-in 100 | DocProject/buildhelp/ 101 | DocProject/Help/*.HxT 102 | DocProject/Help/*.HxC 103 | DocProject/Help/*.hhc 104 | DocProject/Help/*.hhk 105 | DocProject/Help/*.hhp 106 | DocProject/Help/Html2 107 | DocProject/Help/html 108 | 109 | # Click-Once directory 110 | publish/ 111 | 112 | # Publish Web Output 113 | *.[Pp]ublish.xml 114 | *.azurePubxml 115 | 116 | # NuGet Packages Directory 117 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 118 | #packages/* 119 | ## TODO: If the tool you use requires repositories.config, also uncomment the next line 120 | #!packages/repositories.config 121 | 122 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 123 | # This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) 124 | !packages/build/ 125 | 126 | # Windows Azure Build Output 127 | csx/ 128 | *.build.csdef 129 | 130 | # Windows Store app package directory 131 | AppPackages/ 132 | 133 | # Others 134 | sql/ 135 | *.Cache 136 | ClientBin/ 137 | [Ss]tyle[Cc]op.* 138 | ~$* 139 | *~ 140 | *.dbmdl 141 | *.dbproj.schemaview 142 | *.pfx 143 | *.publishsettings 144 | node_modules/ 145 | 146 | # RIA/Silverlight projects 147 | Generated_Code/ 148 | 149 | # Backup & report files from converting an old project file to a newer 150 | # Visual Studio version. Backup files are not needed, because we have git ;-) 151 | _UpgradeReport_Files/ 152 | Backup*/ 153 | UpgradeLog*.XML 154 | UpgradeLog*.htm 155 | 156 | # SQL Server files 157 | App_Data/*.mdf 158 | App_Data/*.ldf 159 | 160 | # Business Intelligence projects 161 | *.rdl.data 162 | *.bim.layout 163 | *.bim_*.settings 164 | 165 | # Microsoft Fakes 166 | FakesAssemblies/ 167 | 168 | # ========================= 169 | # Windows detritus 170 | # ========================= 171 | 172 | # Windows image file caches 173 | Thumbs.db 174 | ehthumbs.db 175 | 176 | # Folder config file 177 | Desktop.ini 178 | 179 | # Recycle Bin used on file shares 180 | $RECYCLE.BIN/ 181 | 182 | *.GhostDoc.xml 183 | 184 | -------------------------------------------------------------------------------- /BookStore.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BookStore", "BookStore\BookStore.csproj", "{C542E368-BB33-4F13-9071-E50A44EB9DC3}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Controller", "Controller\Controller.csproj", "{F0CA7A02-00C9-4F41-B199-4E4878A93B06}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataAccess", "DataAccess\DataAccess.csproj", "{F73BCE65-EA29-4020-B409-2B6A90031AE3}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "Shared\Shared.csproj", "{DDE60834-9685-42AD-A093-6F6900EA7455}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {C542E368-BB33-4F13-9071-E50A44EB9DC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {C542E368-BB33-4F13-9071-E50A44EB9DC3}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {C542E368-BB33-4F13-9071-E50A44EB9DC3}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {C542E368-BB33-4F13-9071-E50A44EB9DC3}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {F0CA7A02-00C9-4F41-B199-4E4878A93B06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {F0CA7A02-00C9-4F41-B199-4E4878A93B06}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {F0CA7A02-00C9-4F41-B199-4E4878A93B06}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {F0CA7A02-00C9-4F41-B199-4E4878A93B06}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {F73BCE65-EA29-4020-B409-2B6A90031AE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {F73BCE65-EA29-4020-B409-2B6A90031AE3}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {F73BCE65-EA29-4020-B409-2B6A90031AE3}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {F73BCE65-EA29-4020-B409-2B6A90031AE3}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {DDE60834-9685-42AD-A093-6F6900EA7455}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {DDE60834-9685-42AD-A093-6F6900EA7455}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {DDE60834-9685-42AD-A093-6F6900EA7455}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {DDE60834-9685-42AD-A093-6F6900EA7455}.Release|Any CPU.Build.0 = Release|Any CPU 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /BookStore.v11.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore.v11.suo -------------------------------------------------------------------------------- /BookStore/App_Data/bookstore.mdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/App_Data/bookstore.mdf -------------------------------------------------------------------------------- /BookStore/App_Data/bookstore_log.ldf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/App_Data/bookstore_log.ldf -------------------------------------------------------------------------------- /BookStore/BookController.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 | using System.Web; 8 | using System.Web.Script.Serialization; 9 | using System.Web.SessionState; 10 | 11 | using Controller; 12 | using Shared; 13 | using Shared.Models; 14 | 15 | namespace BookStore 16 | { 17 | public class BookController : ApiController 18 | { 19 | /// 20 | /// Get all books 21 | /// 22 | /// 23 | public List GetBooks() 24 | { 25 | CommonController commonController = HttpContext.Current.Session["CommonController"] as CommonController; 26 | List returnData = commonController.ExecuteOperation(OperationType.Read, null) as List; 27 | 28 | return returnData; 29 | } 30 | 31 | /// 32 | /// Get book by its id 33 | /// 34 | /// 35 | /// 36 | public List GetBookById(Int32 id) 37 | { 38 | CommonController commonController = HttpContext.Current.Session["CommonController"] as CommonController; 39 | Dictionary data = new Dictionary(); 40 | data.Add("id", id); 41 | List returnData = commonController.ExecuteOperation(OperationType.ReadById, data) as List; 42 | 43 | return returnData; 44 | } 45 | 46 | /// 47 | /// Get all books of the required category. 48 | /// 49 | /// 50 | /// 51 | public List Post([FromBody] String category) 52 | { 53 | CommonController commonController = HttpContext.Current.Session["CommonController"] as CommonController; 54 | Dictionary data = new Dictionary(); 55 | data.Add("category", category); 56 | List returnData = commonController.ExecuteOperation(OperationType.ReadByCategory, data) as List; 57 | 58 | return returnData; 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /BookStore/BookStore.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 8 | 9 | 2.0 10 | {C542E368-BB33-4F13-9071-E50A44EB9DC3} 11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 12 | Library 13 | Properties 14 | BookStore 15 | BookStore 16 | v4.5 17 | true 18 | 19 | 20 | 21 | 22 | 23 | 24 | true 25 | full 26 | false 27 | bin\ 28 | DEBUG;TRACE 29 | prompt 30 | 4 31 | 32 | 33 | pdbonly 34 | true 35 | bin\ 36 | TRACE 37 | prompt 38 | 4 39 | 40 | 41 | 42 | 43 | ..\packages\Newtonsoft.Json.4.5.6\lib\net40\Newtonsoft.Json.dll 44 | 45 | 46 | 47 | ..\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | ..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll 61 | 62 | 63 | ..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.20710.0\lib\net40\System.Web.Http.WebHost.dll 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | Designer 83 | 84 | 85 | 86 | 87 | 88 | Default.aspx 89 | ASPXCodeBehind 90 | 91 | 92 | Default.aspx 93 | 94 | 95 | Global.asax 96 | 97 | 98 | 99 | Site1.Master 100 | ASPXCodeBehind 101 | 102 | 103 | Site1.Master 104 | 105 | 106 | 107 | 108 | 109 | 110 | Web.config 111 | 112 | 113 | Web.config 114 | 115 | 116 | 117 | 118 | {f0ca7a02-00c9-4f41-b199-4e4878a93b06} 119 | Controller 120 | 121 | 122 | {dde60834-9685-42ad-a093-6f6900ea7455} 123 | Shared 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 10.0 132 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | True 142 | True 143 | 0 144 | / 145 | http://localhost:3884/ 146 | False 147 | False 148 | 149 | 150 | False 151 | 152 | 153 | 154 | 155 | 162 | -------------------------------------------------------------------------------- /BookStore/BookStore.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | CurrentPage 13 | True 14 | False 15 | False 16 | False 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | False 26 | True 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /BookStore/Default.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="BookStore.Default" MasterPageFile="~/Site1.Master" %> 2 | 3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /BookStore/Default.aspx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.UI; 6 | using System.Web.UI.WebControls; 7 | 8 | 9 | 10 | namespace BookStore 11 | { 12 | public partial class Default : System.Web.UI.Page 13 | { 14 | protected void Page_Load(object sender, EventArgs e) 15 | { 16 | 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /BookStore/Default.aspx.designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | namespace BookStore { 11 | 12 | 13 | public partial class Default { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /BookStore/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="BookStore.Global" Language="C#" %> 2 | -------------------------------------------------------------------------------- /BookStore/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.Http.WebHost; 7 | using System.Web.Security; 8 | using System.Web.SessionState; 9 | using System.Web.Routing; 10 | 11 | namespace BookStore 12 | { 13 | public class Global : System.Web.HttpApplication 14 | { 15 | #region Classes To Provide Session Support For WebApi 16 | public class MyHttpControllerHandler : HttpControllerHandler, IRequiresSessionState 17 | { 18 | public MyHttpControllerHandler(RouteData routeData) 19 | : base(routeData) 20 | { } 21 | } 22 | 23 | public class MyHttpControllerRouteHandler : HttpControllerRouteHandler 24 | { 25 | protected override IHttpHandler GetHttpHandler(RequestContext requestContext) 26 | { 27 | return new MyHttpControllerHandler(requestContext.RouteData); 28 | } 29 | } 30 | #endregion Classes To Provide Session Support For WebApi 31 | 32 | protected void Application_Start(object sender, EventArgs e) 33 | { 34 | RouteTable.Routes.MapHttpRoute( 35 | name: "DefaultApi", 36 | routeTemplate: "api/{controller}/{id}", 37 | defaults: new { id = RouteParameter.Optional } 38 | ).RouteHandler = new MyHttpControllerRouteHandler(); 39 | } 40 | 41 | protected void Session_Start(object sender, EventArgs e) 42 | { 43 | 44 | } 45 | 46 | protected void Application_BeginRequest(object sender, EventArgs e) 47 | { 48 | 49 | } 50 | 51 | protected void Application_AuthenticateRequest(object sender, EventArgs e) 52 | { 53 | 54 | } 55 | 56 | protected void Application_Error(object sender, EventArgs e) 57 | { 58 | 59 | } 60 | 61 | protected void Session_End(object sender, EventArgs e) 62 | { 63 | 64 | } 65 | 66 | protected void Application_End(object sender, EventArgs e) 67 | { 68 | 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /BookStore/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("BookStore")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("BookStore")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 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("15667f0a-697c-4a4b-afe8-6d618697b96e")] 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 | -------------------------------------------------------------------------------- /BookStore/Resources/Images/0star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/0star.png -------------------------------------------------------------------------------- /BookStore/Resources/Images/1star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/1star.png -------------------------------------------------------------------------------- /BookStore/Resources/Images/2star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/2star.png -------------------------------------------------------------------------------- /BookStore/Resources/Images/3star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/3star.png -------------------------------------------------------------------------------- /BookStore/Resources/Images/4star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/4star.png -------------------------------------------------------------------------------- /BookStore/Resources/Images/5star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/5star.png -------------------------------------------------------------------------------- /BookStore/Resources/Images/a-clash-of-kings-a-song-of-ice-and-fire-book-2-400x400-imadhkz8mymsdv46.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/a-clash-of-kings-a-song-of-ice-and-fire-book-2-400x400-imadhkz8mymsdv46.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/a-degree-in-death-400x400-imadfw74gfzsbbng.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/a-degree-in-death-400x400-imadfw74gfzsbbng.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/artemis-fowl-and-the-last-guardian-400x400-imadb8fthzuzh7uv.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/artemis-fowl-and-the-last-guardian-400x400-imadb8fthzuzh7uv.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/can-love-happen-twice-400x400-imadarucay5gxr5g.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/can-love-happen-twice-400x400-imadarucay5gxr5g.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/dragon-reborn-wheel-of-time-book-3-400x400-imadz74fbteazkjv.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/dragon-reborn-wheel-of-time-book-3-400x400-imadz74fbteazkjv.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/eragon-400x400-imada5h5ufgtehvr.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/eragon-400x400-imada5h5ufgtehvr.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/foundation-400x400-imadekrnpmmnqtwz.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/foundation-400x400-imadekrnpmmnqtwz.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/game-of-thrones-a-song-of-ice-and-fire-book-1-400x400-imadhktfugaghygp.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/game-of-thrones-a-song-of-ice-and-fire-book-1-400x400-imadhktfugaghygp.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/gone-girl-400x400-imadehcn4erysgcg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/gone-girl-400x400-imadehcn4erysgcg.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/harry-potter-and-the-deathly-hallows-signature-edition-400x400-imadbkz2jhz5f6su.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/harry-potter-and-the-deathly-hallows-signature-edition-400x400-imadbkz2jhz5f6su.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/jonathan-livingston-seagull-a-story-400x400-imadat8fmeyfbumn.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/jonathan-livingston-seagull-a-story-400x400-imadat8fmeyfbumn.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/jurassic-park-400x400-imadgdeh2jukhcj2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/jurassic-park-400x400-imadgdeh2jukhcj2.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/kane-chronicles-the-throne-of-fire-400x400-imadgu4geqbynm4r.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/kane-chronicles-the-throne-of-fire-400x400-imadgu4geqbynm4r.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/love-endeavors-400x400-imadhepbzwdzvsch.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/love-endeavors-400x400-imadhepbzwdzvsch.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/love-stories-that-touched-my-heart-400x400-imadjvruag5rzgxn.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/love-stories-that-touched-my-heart-400x400-imadjvruag5rzgxn.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/mage-s-blood-the-montide-quartet-400x400-imadfzka4zxhgg7z.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/mage-s-blood-the-montide-quartet-400x400-imadfzka4zxhgg7z.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/malgudi-days-400x400-imadat2auzypym2e.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/malgudi-days-400x400-imadat2auzypym2e.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/malgudi-schooldays-400x400-imadjkpq2mtakhcj.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/malgudi-schooldays-400x400-imadjkpq2mtakhcj.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/manhattan-in-reverse-400x400-imadgucbxj96mfcx.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/manhattan-in-reverse-400x400-imadgucbxj96mfcx.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/midnight-s-children-400x400-imadjsauh2gvkhut.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/midnight-s-children-400x400-imadjsauh2gvkhut.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/murder-on-orient-express-400x400-imadesm3hqnapjyw.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/murder-on-orient-express-400x400-imadesm3hqnapjyw.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/noonshade-400x400-imadkv44wkhbn6um.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/noonshade-400x400-imadkv44wkhbn6um.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/off-armageddon-reef-400x400-imadguwwwzrfu64z.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/off-armageddon-reef-400x400-imadguwwwzrfu64z.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/oliver-s-story-it-takes-someone-very-special-to-forget-the-love-of-your-life-400x400-imadh6vgwb2z45ht.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/oliver-s-story-it-takes-someone-very-special-to-forget-the-love-of-your-life-400x400-imadh6vgwb2z45ht.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/salvation-of-a-saint-400x400-imadg558fdzkvrxs.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/salvation-of-a-saint-400x400-imadg558fdzkvrxs.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/solar-400x400-imadhhbpk9rmc8w6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/solar-400x400-imadhhbpk9rmc8w6.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/someone-like-you-400x400-imadht2fay9nmfuf.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/someone-like-you-400x400-imadht2fay9nmfuf.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/the-air-war-400x400-imadbhrmd4tdgqmd.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/the-air-war-400x400-imadbhrmd4tdgqmd.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/the-edge-of-the-machete-400x400-imadd2ekeqhgatcs.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/the-edge-of-the-machete-400x400-imadd2ekeqhgatcs.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/the-fountainhead-400x400-imad9wngvsevjnfy.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/the-fountainhead-400x400-imad9wngvsevjnfy.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/the-hit-400x400-imadku9feqx8zkjz.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/the-hit-400x400-imadku9feqx8zkjz.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/the-krishna-key-400x400-imadayvmeqfbbwyg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/the-krishna-key-400x400-imadayvmeqfbbwyg.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/the-lord-of-the-rings-400x400-imadez6ppyjy36mh.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/the-lord-of-the-rings-400x400-imadez6ppyjy36mh.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/the-lost-symbol-400x400-imadaryjh8guqyah.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/the-lost-symbol-400x400-imadaryjh8guqyah.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/the-murder-of-roger-ackroyd-400x400-imadag4c3rhffhhd.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/the-murder-of-roger-ackroyd-400x400-imadag4c3rhffhhd.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/the-secret-wish-list-400x400-imadkuygztrkfhpz.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/the-secret-wish-list-400x400-imadkuygztrkfhpz.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/the-taj-conspiracy-400x400-imad8makhs7eznhz.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/the-taj-conspiracy-400x400-imad8makhs7eznhz.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/the-third-bullet-400x400-imadzrf6vedwtpj9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/the-third-bullet-400x400-imadzrf6vedwtpj9.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/thea-stilton-and-the-secret-of-the-old-castle-400x400-imadgd5mr9vrrbmd.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/thea-stilton-and-the-secret-of-the-old-castle-400x400-imadgd5mr9vrrbmd.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/to-kill-a-mockingbird-400x400-imadat2amn7wzuqv.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/to-kill-a-mockingbird-400x400-imadat2amn7wzuqv.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/train-to-pakistan-400x400-imadas3h89nnmwkh.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/train-to-pakistan-400x400-imadas3h89nnmwkh.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/uff-ye-emotions-a-collection-of-award-winning-love-stories-400x400-imadhesu5scdsekz.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/uff-ye-emotions-a-collection-of-award-winning-love-stories-400x400-imadhesu5scdsekz.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/wake-400x400-imadbhrnrmj3wbrn.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/wake-400x400-imadbhrnrmj3wbrn.jpeg -------------------------------------------------------------------------------- /BookStore/Resources/Images/wheel-of-time-14-a-memory-of-light-400x400-imadgaw4ecpxfguc.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/BookStore/Resources/Images/wheel-of-time-14-a-memory-of-light-400x400-imadgaw4ecpxfguc.jpeg -------------------------------------------------------------------------------- /BookStore/Scripts/App.js: -------------------------------------------------------------------------------- 1 | ; 2 | var tooltipContent = ""; 3 | var bookApp = angular.module('bookStore', []); 4 | 5 | bookApp.factory("BooksDataService", function ($http, $q) { 6 | var mybooks = []; 7 | 8 | var OpType = { 9 | GetAllBooks: 1, 10 | GetBooksByCatagory: 2, 11 | GetBookById: 3 12 | }; 13 | 14 | var read = function (operation, data) { 15 | var deferred = $q.defer(); 16 | if (operation === OpType.GetAllBooks || operation === OpType.GetBookById) { 17 | deferred.resolve($http({ 18 | method: 'GET', 19 | url: 'api/book/' + data 20 | })); 21 | return deferred.promise; 22 | } 23 | else if (operation === OpType.GetBooksByCatagory) { 24 | deferred.resolve($http({ 25 | method: 'POST', 26 | url: 'api/book/', 27 | data: JSON.stringify(data), 28 | headers: { 'Content-Type': 'application/json; charset=utf-8', 'dataType': 'json' } 29 | })); 30 | return deferred.promise; 31 | } 32 | else { console.log("Unidentified method"); } 33 | }; 34 | return { 35 | Books: mybooks, 36 | ReadBooks: read, 37 | OperationType: OpType 38 | }; 39 | }); 40 | 41 | bookApp.config(['$routeProvider', function ($routeProvider) { 42 | $routeProvider.when('/books', { 43 | templateUrl: 'books.html', 44 | controller: 'MainCtrl' 45 | }); 46 | $routeProvider.when('/book-detail/:bookId', { 47 | templateUrl: 'book-detail.html', 48 | controller: 'BookCtrl' 49 | }); 50 | $routeProvider.otherwise({ redirectTo: '/books' }); 51 | }]); 52 | 53 | bookApp.controller('MainCtrl', function ($scope, BooksDataService) { 54 | var tooltipJS = new ToolTipJS(); 55 | $scope.books = []; 56 | 57 | //first lets get all the books 58 | BooksDataService.ReadBooks(BooksDataService.OperationType.GetAllBooks, ""). 59 | then(function (config, data, headers, status) { $scope.books = arguments[0].data; }); 60 | 61 | //set the tooltip location preference, these can be reordered as required 62 | tooltipJS.addLocationPreference(new tooltipJS.tooltipLocation(tooltipJS.LocationConstants.Top, "tooltip-Css")); 63 | tooltipJS.addLocationPreference(new tooltipJS.tooltipLocation(tooltipJS.LocationConstants.Right, "tooltip-Css")); 64 | tooltipJS.addLocationPreference(new tooltipJS.tooltipLocation(tooltipJS.LocationConstants.Left, "tooltip-Css")); 65 | tooltipJS.addLocationPreference(new tooltipJS.tooltipLocation(tooltipJS.LocationConstants.Bottom, "tooltip-Css")); 66 | 67 | //Get Books by their category 68 | $scope.GetBooksByCategory = function (category) { 69 | BooksDataService.ReadBooks(BooksDataService.OperationType.GetBooksByCatagory, category). 70 | then(function (config, data, headers, status) {$scope.books = arguments[0].data; }); 71 | }; 72 | 73 | //set the tooltips for all the book images 74 | $scope.SetToolTip = function (id, name, author, publisher, price, discount, language, year, isbn13, isbn10) { 75 | var content = tooltipContent; 76 | content = content.replace("{{Name}}", name); 77 | content = content.replace("{{AuthorName}}", author); 78 | content = content.replace("{{PublisherName}}", publisher); 79 | content = content.replace("{{Price}}", price); 80 | content = content.replace("{{Discount}}", Math.round(discount * 100) + "%"); 81 | content = content.replace("{{Language}}", language); 82 | content = content.replace("{{PublicationYear}}", year); 83 | content = content.replace("{{ISBN13}}", isbn13); 84 | content = content.replace("{{ISBN10}}", isbn10); 85 | 86 | tooltipJS.applyTooltip("imgBook" + id, content, 5, true); 87 | }; 88 | 89 | //Get our helper methods 90 | $scope.GetRatingImage = getRatingImage; 91 | $scope.GetActualPrice = GetActualPrice; 92 | $scope.HasDiscount = HasDiscount; 93 | 94 | }); 95 | 96 | bookApp.controller('BookCtrl', function ($scope, $routeParams, BooksDataService) { 97 | $scope.bookId = $routeParams.bookId; 98 | $scope.book = {}; 99 | BooksDataService.ReadBooks(BooksDataService.OperationType.GetBookById, $scope.bookId). 100 | then(function (config, data, headers, status) { $scope.book = arguments[0].data[0]; }); 101 | 102 | //Get our helper methods 103 | $scope.GetRatingImage = getRatingImage; 104 | $scope.GetActualPrice = GetActualPrice; 105 | $scope.HasDiscount = HasDiscount; 106 | }); 107 | 108 | //Gets rating image based on the rating value passed 109 | function getRatingImage(rating){ 110 | return rating + "star.png"; 111 | } 112 | 113 | //Gets the actual price after deducting the discount 114 | function GetActualPrice(price, discount) { 115 | var discountString = Math.round(discount * 100) + "%"; 116 | var finalPrice = price - (price * discount) 117 | if (discount > 0) { 118 | return "Rs. " + Math.round(finalPrice) + "(" + discountString + ")"; 119 | } 120 | else { 121 | return ""; 122 | } 123 | }; 124 | 125 | //Determines if there is any discount for the book or not 126 | function HasDiscount(discount) { 127 | return (discount > 0); 128 | }; 129 | 130 | //Set the tooltip html content 131 | tooltipContent = "
" 132 | tooltipContent += "{{Name}}
"; 133 | tooltipContent += ""; 134 | tooltipContent += ""; 135 | tooltipContent += ""; 136 | tooltipContent += ""; 137 | tooltipContent += ""; 138 | tooltipContent += ""; 139 | tooltipContent += ""; 140 | tooltipContent += "
Author{{AuthorName}}
Publisher{{PublisherName}}
Price{{Price}}
Discount{{Discount}}
Language{{Language}}
Publication Year{{PublicationYear}}
ISBN-13{{ISBN13}}
ISBN-10{{ISBN10}}
"; 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /BookStore/Scripts/tooltip.js: -------------------------------------------------------------------------------- 1 | ; 2 | (function (jQuery, w) { 3 | var $ = jQuery; 4 | var toolTipJS = function () { 5 | //***Summary*** 6 | //array to hold tooltip location preferences 7 | //************* 8 | this.locationPreference = []; 9 | 10 | //***Summary*** 11 | //Location object to be added to the location preference list 12 | //************* 13 | this.tooltipLocation = function (location, className) { 14 | this.location = location; 15 | this.className = className; 16 | }; 17 | 18 | //***Summary*** 19 | //tooltip location constants 20 | //************* 21 | this.LocationConstants = { 22 | Top: 1, 23 | Left: 2, 24 | Right: 3, 25 | Bottom: 4 26 | }; 27 | 28 | //***Summary*** 29 | //Add a location preference 30 | //************* 31 | this.addLocationPreference = function (l) { 32 | this.locationPreference.push(l); 33 | }; 34 | 35 | //***Summary*** 36 | //Resets location preferences 37 | //************* 38 | this.resetLocationPreference = function() { 39 | this.locationPreference = []; 40 | } 41 | 42 | //***Summary*** 43 | //Flag to check if the mouse pointer is inside the source element 44 | //************* 45 | this.inside = false; 46 | 47 | //***Summary*** 48 | //applies the tooltip show and hide functions on the mouseover and 49 | //mouseout events of the source control 50 | //***Params**** 51 | //sourceControlId = ID of source control. 52 | //content = Tooltip content. 53 | //distance = Distance between the tooltip and the source control. 54 | //************* 55 | this.applyTooltip = function (toolTipId, content, distance, showAtPointer) { 56 | var divToolTip = null; 57 | var showTooltipDelegate = null; 58 | var hideTooltipDelegate = null; 59 | var sourceControl = $("*[tooltipid='" + toolTipId + "']"); 60 | var params = null; 61 | divToolTip = $("#divToolTip"); 62 | 63 | //create our tooltip div if not already present 64 | if (!(divToolTip.length > 0)) { 65 | divToolTip = document.createElement("div"); 66 | divToolTip.setAttribute("id", "divToolTip"); 67 | $("body").append(divToolTip); 68 | divToolTip = $("#divToolTip"); 69 | divToolTip.css("position", "absolute"); 70 | divToolTip.css("display", "none"); 71 | } 72 | 73 | //delegate to change the calling context to our toolTipJS object 74 | showTooltipDelegate = $.proxy(showToolTip, this); 75 | hideTooltipDelegate = $.proxy(hideTooltip, this); 76 | params = { 77 | "sourceControl": sourceControl, 78 | "content": content, 79 | "distance": distance, 80 | "showAtPointer": showAtPointer 81 | } 82 | 83 | if (showAtPointer === false) { 84 | sourceControl.mouseover(params, showTooltipDelegate); 85 | } 86 | else { 87 | sourceControl.mousemove(params, showTooltipDelegate); 88 | } 89 | 90 | sourceControl.mouseout(hideTooltipDelegate); 91 | }; 92 | }; 93 | 94 | //***Summary*** 95 | //show the tooltip after computing the position and the correct style to apply on 96 | //the tooltip div. 97 | //************* 98 | function showToolTip(e) { 99 | var i = 0; 100 | var showAtPointer = e.data.showAtPointer; 101 | var sourceControl = e.data.sourceControl; 102 | var content = e.data.content; 103 | var targetLeft = null, targetTop = null; //top and left of the tooltip div 104 | var top = sourceControl.offset().top; 105 | var left = sourceControl.offset().left; 106 | var right = sourceControl.offset().left + sourceControl.outerWidth(); 107 | var bottom = sourceControl.offset().top + sourceControl.outerHeight(); 108 | var divToolTip = $("#divToolTip"); 109 | var distance = e.data.distance; 110 | 111 | if (showAtPointer === true) { 112 | left = right = e.pageX; 113 | top = bottom = e.pageY; 114 | } 115 | 116 | divToolTip.removeClass(); //remove any previous class 117 | //reset top and left 118 | if (this.inside === false) { 119 | divToolTip.css("top", 0); 120 | divToolTip.css("left", 0); 121 | } 122 | divToolTip.html(content); //set the tooltip content 123 | for (; i < this.locationPreference.length; i++) { 124 | switch (this.locationPreference[i].location) { 125 | case this.LocationConstants.Top: 126 | if (divToolTip.outerHeight() + distance > top) { 127 | continue; 128 | } 129 | else { 130 | //need to set the css here so as to retrieve final height after applying css 131 | divToolTip.addClass(this.locationPreference[i].className); 132 | targetLeft = left; 133 | //we need to set css left here to correctly compute the tooltip div height 134 | divToolTip.css("left", targetLeft); 135 | targetTop = top - divToolTip.outerHeight() - distance; 136 | } 137 | break; 138 | case this.LocationConstants.Right: 139 | if ((divToolTip.outerWidth() + distance) > ($(window).width() - right)) { 140 | continue; 141 | } 142 | else { 143 | divToolTip.addClass(this.locationPreference[i].className); 144 | targetLeft = right + distance; 145 | targetTop = top; 146 | } 147 | break; 148 | case this.LocationConstants.Left: 149 | if (divToolTip.outerWidth() + distance > left) { 150 | continue; 151 | } 152 | else { 153 | //need to set the css here so as to retrieve final width after applying css 154 | divToolTip.addClass(this.locationPreference[i].className); 155 | targetLeft = left - divToolTip.outerWidth() - distance; 156 | targetTop = top; 157 | } 158 | break; 159 | case this.LocationConstants.Bottom: 160 | if (divToolTip.outerHeight() + distance > $(window).height() - bottom) { 161 | continue; 162 | } 163 | else { 164 | divToolTip.addClass(this.locationPreference[i].className); 165 | targetLeft = left; 166 | targetTop = bottom + distance; 167 | } 168 | break; 169 | } 170 | 171 | break; 172 | } 173 | //apply the top and left for the tooltip div 174 | divToolTip.css("top", targetTop); 175 | divToolTip.css("left", targetLeft); 176 | if (this.inside === false) { 177 | divToolTip.css("display", "block"); 178 | this.inside = true; 179 | } 180 | }; 181 | 182 | //***Summary*** 183 | //hides the toooltip div. 184 | //************* 185 | function hideTooltip() { 186 | this.inside = false; 187 | $("#divToolTip").css("display", "none"); 188 | }; 189 | 190 | w["ToolTipJS"] = toolTipJS; 191 | })($, window); -------------------------------------------------------------------------------- /BookStore/Site1.Master: -------------------------------------------------------------------------------- 1 | <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="BookStore.Site1" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 20 | Online Book Store 21 |
22 | 23 | Made by using AngularJS and Asp.Net Web API 24 | 25 |
26 |
27 | 28 | 29 | 30 | 31 |
32 |
33 | 34 | Add some stuff here... 35 | 36 |
37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /BookStore/Site1.Master.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.UI; 6 | using System.Web.UI.WebControls; 7 | 8 | using Controller; 9 | 10 | namespace BookStore 11 | { 12 | public partial class Site1 : System.Web.UI.MasterPage 13 | { 14 | protected void Page_Load(object sender, EventArgs e) 15 | { 16 | #region Initialize Controller 17 | 18 | CommonController commonController; 19 | if (Session.IsNewSession) 20 | { 21 | commonController = new CommonController(); 22 | Session.Add("CommonController", commonController); 23 | } 24 | 25 | #endregion Initialize Controller 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /BookStore/Site1.Master.designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | namespace BookStore { 11 | 12 | 13 | public partial class Site1 { 14 | 15 | /// 16 | /// head control. 17 | /// 18 | /// 19 | /// Auto-generated field. 20 | /// To modify move field declaration from designer file to code-behind file. 21 | /// 22 | protected global::System.Web.UI.WebControls.ContentPlaceHolder head; 23 | 24 | /// 25 | /// form1 control. 26 | /// 27 | /// 28 | /// Auto-generated field. 29 | /// To modify move field declaration from designer file to code-behind file. 30 | /// 31 | protected global::System.Web.UI.HtmlControls.HtmlForm form1; 32 | 33 | /// 34 | /// ContentPlaceHolder1 control. 35 | /// 36 | /// 37 | /// Auto-generated field. 38 | /// To modify move field declaration from designer file to code-behind file. 39 | /// 40 | protected global::System.Web.UI.WebControls.ContentPlaceHolder ContentPlaceHolder1; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /BookStore/Style/StyleSheet.css: -------------------------------------------------------------------------------- 1 | .discount-true 2 | { 3 | text-decoration: line-through; 4 | color: Gray; 5 | } 6 | 7 | .divHeader { 8 | background-color:black; 9 | height:200px; 10 | width:100%; 11 | padding:5px; 12 | text-align:center; 13 | } 14 | 15 | .divButtonPane { 16 | background-color:white; 17 | height:75px; 18 | width:100%; 19 | text-align:center; 20 | vertical-align:auto; 21 | } 22 | 23 | .divBody { 24 | background-color:white; 25 | height:500px; 26 | width:90%; 27 | overflow-y:scroll; 28 | padding:50px; 29 | } 30 | 31 | .divBookBody { 32 | background-color:white; 33 | height:500px; 34 | width:90%; 35 | overflow-y:scroll; 36 | padding:50px; 37 | } 38 | 39 | .divFooter { 40 | background-color:black; 41 | height:200px; 42 | width:100%; 43 | text-align:center; 44 | } 45 | 46 | .blueButton { 47 | -moz-box-shadow:inset 0px 1px 0px 0px #bbdaf7; 48 | -webkit-box-shadow:inset 0px 1px 0px 0px #bbdaf7; 49 | box-shadow:inset 0px 1px 0px 0px #bbdaf7; 50 | background-color:#79bbff; 51 | text-indent:0; 52 | display:inline-block; 53 | color:#ffffff; 54 | font-family:Arial Black; 55 | font-size:32px; 56 | font-weight:bold; 57 | font-style:normal; 58 | height:70px; 59 | line-height:70px; 60 | width:200px; 61 | text-decoration:none; 62 | text-align:center; 63 | text-shadow:1px 1px 0px #528ecc; 64 | }.blueButton:hover { 65 | background-color:#378de5; 66 | }.blueButton:active { 67 | position:relative; 68 | top:1px; 69 | } 70 | 71 | .redButton { 72 | -moz-box-shadow:inset 0px 1px 0px 0px #f29c93; 73 | -webkit-box-shadow:inset 0px 1px 0px 0px #f29c93; 74 | box-shadow:inset 0px 1px 0px 0px #f29c93; 75 | background-color:#fe1a00; 76 | text-indent:0; 77 | display:inline-block; 78 | color:#ffffff; 79 | font-family:Arial Black; 80 | font-size:32px; 81 | font-weight:bold; 82 | font-style:normal; 83 | height:70px; 84 | line-height:70px; 85 | width:200px; 86 | text-decoration:none; 87 | text-align:center; 88 | text-shadow:1px 1px 0px #b23e35; 89 | }.redButton:hover { 90 | background-color:#ce0100; 91 | }.redButton:active { 92 | position:relative; 93 | top:1px; 94 | } 95 | 96 | .purpleButton { 97 | -moz-box-shadow:inset 0px 1px 0px 0px #d197fe; 98 | -webkit-box-shadow:inset 0px 1px 0px 0px #d197fe; 99 | box-shadow:inset 0px 1px 0px 0px #d197fe; 100 | background-color:#a53df6; 101 | text-indent:0; 102 | display:inline-block; 103 | color:#ffffff; 104 | font-family:Arial Black; 105 | font-size:32px; 106 | font-weight:bold; 107 | font-style:normal; 108 | height:70px; 109 | line-height:70px; 110 | width:200px; 111 | text-decoration:none; 112 | text-align:center; 113 | text-shadow:1px 1px 0px #7d15cd; 114 | }.purpleButton:hover { 115 | background-color:#7c16cb; 116 | }.purpleButton:active { 117 | position:relative; 118 | top:1px; 119 | } 120 | 121 | .greenButton { 122 | -moz-box-shadow:inset 0px 1px 0px 0px #d9fbbe; 123 | -webkit-box-shadow:inset 0px 1px 0px 0px #d9fbbe; 124 | box-shadow:inset 0px 1px 0px 0px #d9fbbe; 125 | background-color:#b8e356; 126 | text-indent:0; 127 | display:inline-block; 128 | color:#ffffff; 129 | font-family:Arial Black; 130 | font-size:32px; 131 | font-weight:bold; 132 | font-style:normal; 133 | height:70px; 134 | line-height:70px; 135 | width:200px; 136 | text-decoration:none; 137 | text-align:center; 138 | text-shadow:1px 1px 0px #86ae47; 139 | }.greenButton:hover { 140 | background-color:#a5cc52; 141 | }.greenButton:active { 142 | position:relative; 143 | top:1px; 144 | } 145 | 146 | .yellowButton { 147 | -moz-box-shadow:inset 0px 1px 0px 0px #f9eca0; 148 | -webkit-box-shadow:inset 0px 1px 0px 0px #f9eca0; 149 | box-shadow:inset 0px 1px 0px 0px #f9eca0; 150 | background-color:#f0c911; 151 | text-indent:0; 152 | display:inline-block; 153 | color:#c92200; 154 | font-family:Arial Black; 155 | font-size:32px; 156 | font-weight:bold; 157 | font-style:normal; 158 | height:70px; 159 | line-height:70px; 160 | width:200px; 161 | text-decoration:none; 162 | text-align:center; 163 | text-shadow:1px 1px 0px #ded17c; 164 | }.yellowButton:hover { 165 | background-color:#f2ab1e; 166 | }.yellowButton:active { 167 | position:relative; 168 | top:1px; 169 | } 170 | 171 | .pinkButton { 172 | -moz-box-shadow:inset 0px 1px 0px 0px #fbafe3; 173 | -webkit-box-shadow:inset 0px 1px 0px 0px #fbafe3; 174 | box-shadow:inset 0px 1px 0px 0px #fbafe3; 175 | background-color:#ff5bb0; 176 | text-indent:0; 177 | display:inline-block; 178 | color:#ffffff; 179 | font-family:Arial Black; 180 | font-size:32px; 181 | font-weight:bold; 182 | font-style:normal; 183 | height:70px; 184 | line-height:70px; 185 | width:200px; 186 | text-decoration:none; 187 | text-align:center; 188 | text-shadow:1px 1px 0px #c70067; 189 | }.pinkButton:hover { 190 | background-color:#ef027d; 191 | }.pinkButton:active { 192 | position:relative; 193 | top:1px; 194 | } 195 | 196 | .buyNowButton { 197 | -moz-box-shadow:inset 0px 1px 0px 0px #fce2c1; 198 | -webkit-box-shadow:inset 0px 1px 0px 0px #fce2c1; 199 | box-shadow:inset 0px 1px 0px 0px #fce2c1; 200 | background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ffc477), color-stop(1, #fb9e25) ); 201 | background:-moz-linear-gradient( center top, #ffc477 5%, #fb9e25 100% ); 202 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc477', endColorstr='#fb9e25'); 203 | background-color:#ffc477; 204 | -webkit-border-top-left-radius:6px; 205 | -moz-border-radius-topleft:6px; 206 | border-top-left-radius:6px; 207 | -webkit-border-top-right-radius:6px; 208 | -moz-border-radius-topright:6px; 209 | border-top-right-radius:6px; 210 | -webkit-border-bottom-right-radius:6px; 211 | -moz-border-radius-bottomright:6px; 212 | border-bottom-right-radius:6px; 213 | -webkit-border-bottom-left-radius:6px; 214 | -moz-border-radius-bottomleft:6px; 215 | border-bottom-left-radius:6px; 216 | text-indent:0; 217 | border:1px solid #eeb44f; 218 | display:inline-block; 219 | color:#ffffff; 220 | font-family:Arial; 221 | font-size:18px; 222 | font-weight:bold; 223 | font-style:normal; 224 | height:35px; 225 | line-height:35px; 226 | width:109px; 227 | text-decoration:none; 228 | text-align:center; 229 | text-shadow:1px 1px 0px #cc9f52; 230 | } 231 | .buyNowButton:hover { 232 | background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #fb9e25), color-stop(1, #ffc477) ); 233 | background:-moz-linear-gradient( center top, #fb9e25 5%, #ffc477 100% ); 234 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fb9e25', endColorstr='#ffc477'); 235 | background-color:#fb9e25; 236 | }.buyNowButton:active { 237 | position:relative; 238 | top:1px; 239 | } 240 | 241 | .tooltip-Css { 242 | padding:10px; 243 | background-color: #fffae8; 244 | border: 2px solid #999999; 245 | -moz-border-radius: 9px; 246 | -webkit-border-radius: 9px; 247 | border-radius: 9px; 248 | -moz-box-shadow: 0px 0px 3px #000000; 249 | -webkit-box-shadow: 0px 0px 3px #000000; 250 | box-shadow: 0px 0px 3px #000000; 251 | opacity: 0.9; 252 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity = 90); 253 | filter: alpha(opacity = 90); 254 | } 255 | 256 | .logoText{ 257 | font-family: Garamond, serif; 258 | line-height: 1em; 259 | color: #fff9d6; 260 | font-weight:bold; 261 | font-size: 127px; 262 | text-shadow:0px 0px 0 rgb(232,232,232), 263 | 1px 1px 0 rgb(219,219,219), 264 | 2px 2px 0 rgb(206,206,206), 265 | 3px 3px 0 rgb(192,192,192), 266 | 4px 4px 0 rgb(179,179,179), 267 | 5px 5px 0 rgb(166,166,166), 268 | 6px 6px 0 rgb(153,153,153), 269 | 7px 7px 6px rgba(0,0,0,0.6), 270 | 7px 7px 1px rgba(0,0,0,0.5), 271 | 0px 0px 6px rgba(0,0,0,.2); 272 | } 273 | 274 | .boldFont800 { 275 | font:bold; 276 | font-family:Arial; 277 | font-weight:800; 278 | } 279 | 280 | .boldFontGray800 { 281 | font:bold; 282 | font-family:Arial; 283 | font-weight:800; 284 | color:gray; 285 | } 286 | 287 | .boldSmallFontGray300 { 288 | font:bold; 289 | font-family:Arial; 290 | font-weight:300; 291 | color:gray; 292 | font-size:small; 293 | } 294 | -------------------------------------------------------------------------------- /BookStore/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /BookStore/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /BookStore/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /BookStore/book-detail.html: -------------------------------------------------------------------------------- 1 | 
2 | 3 | 4 | 7 | 40 | 41 |
5 | 6 | 8 | {{book.Name}}
9 | 10 |
11 | Author: 12 | {{book.AuthorName}}
13 | Publisher: 14 | {{book.PublisherName}}
15 |
16 | Rs. {{book.Price}} 17 | {{GetActualPrice(book.Price, book.Discount)}}
18 | 19 | Inclusive of all taxes. 20 |

21 | 22 | Free home delivery if total order amount is Rs. 1000 or above. Add Rs. 100 otherwise. 23 |
24 | 25 | 26 | 29 | 37 | 38 |
27 | BUY NOW 28 | 30 | 31 | In Stock 32 |
33 | 34 | Delivered in 2-3 business days. 35 | 36 |
39 |
42 |
43 | Summary Of The Book:
44 | 45 | {{book.Details}} 46 | 47 |
48 | Specificatons Of The Book:
49 | 50 | 51 | 54 | 59 | 60 | 61 | 64 | 69 | 70 | 71 | 74 | 79 | 80 | 81 | 84 | 89 | 90 | 91 | 94 | 99 | 100 | 101 | 104 | 109 | 110 |
52 | Author 53 | 55 | 56 | {{book.AuthorName}} 57 | 58 |
62 | Publisher 63 | 65 | 66 | {{book.PublisherName}} 67 | 68 |
72 | Publication Year 73 | 75 | 76 | {{book.PublicationYear}} 77 | 78 |
82 | ISBN-13 83 | 85 | 86 | {{book.ISBN13}} 87 | 88 |
92 | ISBN-10 93 | 95 | 96 | {{book.ISBN10}} 97 | 98 |
102 | Language 103 | 105 | 106 | {{book.Language}} 107 | 108 |
111 |
112 |
-------------------------------------------------------------------------------- /BookStore/books.html: -------------------------------------------------------------------------------- 1 | 
2 | ROMANCE 3 | THRILLER 4 | CLASSICS 5 | FANTASY 6 | MYSTERY 7 | SCI-FI 8 |
9 |
10 |
11 |
    12 |
  • 13 | 14 | 15 | 19 | 48 | 49 |
    16 | 17 | {{SetToolTip(book.Id, book.Name, book.AuthorName, book.PublisherName, book.Price, book.Discount, book.Language, book.PublicationYear, book.ISBN13, book.ISBN10)}} 18 | 20 | 21 | {{book.Name}} 22 |
    23 | 24 | By: {{book.AuthorName}} 25 |
    26 | 27 |
    28 | 29 | 30 | 39 | 45 | 46 |
    31 | Rs. {{book.Price}} 32 | {{GetActualPrice(book.Price, book.Discount)}}
    33 | In Stock
    34 | 35 | Delivered in 2-3 business days. 36 |
    37 | BUY NOW 38 |
    40 | Publisher: 41 | {{book.PublisherName}}
    42 | Released: 43 | {{book.PublicationYear}}
    44 |
    47 |
    50 |
  • 51 |
52 |
53 |
-------------------------------------------------------------------------------- /BookStore/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Controller/Controller.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | using Shared; 8 | using DataAccess; 9 | 10 | namespace Controller 11 | { 12 | public class CommonController 13 | { 14 | #region Private Variables 15 | private DataManager manager; 16 | #endregion Private Variables 17 | 18 | #region Constructer 19 | /// 20 | /// Constructer 21 | /// 22 | public CommonController() 23 | { 24 | manager = new DataManager(); 25 | } 26 | #endregion Constructer 27 | 28 | /// 29 | /// Execute Operation 30 | /// 31 | /// 32 | /// 33 | /// 34 | public Object ExecuteOperation(String operationType, Dictionary data) 35 | { 36 | Object retVal = new Object(); 37 | 38 | //Implementing a global try-catch block, never use this shortcut for production version 39 | try 40 | { 41 | switch (operationType) 42 | { 43 | case OperationType.Read: 44 | retVal = manager.ReadBooksData(); 45 | break; 46 | case OperationType.ReadById: 47 | retVal = manager.ReadBookById(data); 48 | break; 49 | case OperationType.ReadByCategory: 50 | retVal = manager.ReadBookByCategory(data); 51 | break; 52 | default: 53 | break; 54 | } 55 | } 56 | catch (Exception exception) 57 | { 58 | throw new Exception(String.Concat(Exceptions.Error, ": ", exception.Message)); 59 | } 60 | return retVal; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Controller/Controller.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {F0CA7A02-00C9-4F41-B199-4E4878A93B06} 8 | Library 9 | Properties 10 | Controller 11 | Controller 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | {f73bce65-ea29-4020-b409-2b6a90031ae3} 48 | DataAccess 49 | 50 | 51 | {dde60834-9685-42ad-a093-6f6900ea7455} 52 | Shared 53 | 54 | 55 | 56 | 63 | -------------------------------------------------------------------------------- /Controller/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("Controller")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Controller")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 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("c6590c06-6df3-4b15-9e2f-a543d239f1d4")] 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 Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DataAccess/DataAccess.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Data; 7 | using System.Data.SqlClient; 8 | using System.Configuration; 9 | using System.Web; 10 | 11 | using Shared; 12 | using Shared.Models; 13 | 14 | namespace DataAccess 15 | { 16 | public class DataManager 17 | { 18 | private String connectionString = ConfigurationManager.ConnectionStrings["BookData"].ToString(); 19 | 20 | #region Sql Methods 21 | 22 | /// 23 | /// Returns a new sql parameter with the given paramenters. 24 | /// 25 | /// 26 | /// 27 | /// 28 | /// 29 | private SqlParameter GetParameter(String parameterName, Object value, DbType dbtype) 30 | { 31 | SqlParameter param = new SqlParameter(); 32 | param.ParameterName = parameterName; 33 | param.Value = value; 34 | param.DbType = dbtype; 35 | return param; 36 | } 37 | 38 | /// 39 | /// Returns the connection string. 40 | /// 41 | /// 42 | private String GetConnectionString() 43 | { 44 | return connectionString; 45 | } 46 | 47 | /// 48 | /// Returns a new sql connection. 49 | /// 50 | /// 51 | private SqlConnection GetConnection() 52 | { 53 | SqlConnection connection = new SqlConnection(GetConnectionString()); 54 | connection.Open(); 55 | return connection; 56 | } 57 | 58 | /// 59 | /// Closes the provided sql connection. 60 | /// 61 | /// 62 | private void CloseConnection(SqlConnection connection) 63 | { 64 | connection.Close(); 65 | } 66 | 67 | /// 68 | /// Returns the SqlCommand object based on the type of operation passed 69 | /// 70 | /// 71 | /// 72 | private SqlCommand GetCommand(String operationType) 73 | { 74 | String dataQuery = OperationType.Map[operationType]; 75 | SqlConnection connection = GetConnection(); 76 | SqlCommand command = new SqlCommand(dataQuery, connection); 77 | 78 | return command; 79 | } 80 | 81 | #endregion Sql Methods 82 | 83 | #region CRUD 84 | 85 | /// 86 | /// Get book data for a particular catagory 87 | /// 88 | /// 89 | /// 90 | public List ReadBookByCategory(Dictionary data) 91 | { 92 | BookModel bookModel; 93 | SqlDataReader dataReader; 94 | List returnData = new List(); 95 | SqlCommand command = GetCommand(OperationType.ReadByCategory); 96 | String category = data["category"].ToString().ToUpper(); 97 | 98 | command.Parameters.Add(GetParameter("@category", category, DbType.String)); 99 | dataReader = command.ExecuteReader(); 100 | while (dataReader.Read()) 101 | { 102 | bookModel = GetBookModel((Int32)dataReader["Id"], 103 | dataReader["Name"].ToString(), 104 | dataReader["AuthorName"].ToString(), 105 | dataReader["PublisherName"].ToString(), 106 | (Int32)dataReader["Price"], 107 | Convert.ToDecimal(dataReader["Discount"]), 108 | (Int32)dataReader["Rating"], 109 | dataReader["Language"].ToString(), 110 | (Int32)dataReader["PublicationYear"], 111 | dataReader["ISBN13"].ToString(), 112 | dataReader["ISBN10"].ToString(), 113 | dataReader["Category"].ToString(), 114 | dataReader["Image"].ToString(), 115 | dataReader["Details"].ToString()); 116 | 117 | returnData.Add(bookModel); 118 | } 119 | CloseConnection(command.Connection); 120 | return returnData; 121 | } 122 | 123 | /// 124 | /// Read book by its Id 125 | /// 126 | /// 127 | /// 128 | /// 129 | public List ReadBookById(Dictionary data) 130 | { 131 | BookModel bookModel; 132 | SqlDataReader dataReader; 133 | List returnData = new List(); 134 | SqlCommand command = GetCommand(OperationType.ReadById); 135 | Int32 id = Convert.ToInt32(data["id"]); 136 | 137 | command.Parameters.Add(GetParameter("@id", id, DbType.Int32)); 138 | dataReader = command.ExecuteReader(); 139 | while (dataReader.Read()) 140 | { 141 | bookModel = GetBookModel((Int32)dataReader["Id"], 142 | dataReader["Name"].ToString(), 143 | dataReader["AuthorName"].ToString(), 144 | dataReader["PublisherName"].ToString(), 145 | (Int32)dataReader["Price"], 146 | Convert.ToDecimal(dataReader["Discount"]), 147 | (Int32)dataReader["Rating"], 148 | dataReader["Language"].ToString(), 149 | (Int32)dataReader["PublicationYear"], 150 | dataReader["ISBN13"].ToString(), 151 | dataReader["ISBN10"].ToString(), 152 | dataReader["Category"].ToString(), 153 | dataReader["Image"].ToString(), 154 | dataReader["Details"].ToString()); 155 | 156 | returnData.Add(bookModel); 157 | } 158 | CloseConnection(command.Connection); 159 | return returnData; 160 | } 161 | 162 | /// 163 | /// Read Books Data 164 | /// 165 | /// 166 | public List ReadBooksData() 167 | { 168 | BookModel bookModel; 169 | List returnData = new List(); 170 | SqlDataReader dataReader; 171 | SqlCommand command = GetCommand(OperationType.Read); 172 | 173 | dataReader = command.ExecuteReader(); 174 | 175 | while (dataReader.Read()) 176 | { 177 | bookModel = GetBookModel((Int32)dataReader["Id"], 178 | dataReader["Name"].ToString(), 179 | dataReader["AuthorName"].ToString(), 180 | dataReader["PublisherName"].ToString(), 181 | (Int32)dataReader["Price"], 182 | Convert.ToDecimal(dataReader["Discount"]), 183 | (Int32)dataReader["Rating"], 184 | dataReader["Language"].ToString(), 185 | (Int32)dataReader["PublicationYear"], 186 | dataReader["ISBN13"].ToString(), 187 | dataReader["ISBN10"].ToString(), 188 | dataReader["Category"].ToString(), 189 | dataReader["Image"].ToString(), 190 | dataReader["Details"].ToString()); 191 | returnData.Add(bookModel); 192 | } 193 | 194 | CloseConnection(command.Connection); 195 | return returnData; 196 | } 197 | 198 | #endregion CRUD 199 | 200 | #region Helper Methods 201 | 202 | /// 203 | /// Returns new BookModel object with the passed parameters 204 | /// 205 | /// 206 | /// 207 | /// 208 | /// 209 | /// 210 | /// 211 | /// 212 | /// 213 | /// 214 | /// 215 | /// 216 | /// 217 | /// 218 | /// 219 | /// 220 | private BookModel GetBookModel(Int32 id, String name, String authorName, String publisherName, Int32 price, 221 | Decimal discount, Int32 rating, String language, Int32 publicationYear, 222 | String iSBN13, String iSBN10, String category, String image, String details) 223 | { 224 | return new BookModel 225 | { 226 | Id = id, 227 | Name = name, 228 | AuthorName = authorName, 229 | PublisherName = publisherName, 230 | Price = price, 231 | Discount = discount, 232 | Rating = rating, 233 | Language = language, 234 | PublicationYear = publicationYear, 235 | ISBN13 = iSBN13, 236 | ISBN10 = iSBN10, 237 | Category = category, 238 | Image = image, 239 | Details = details, 240 | }; 241 | } 242 | 243 | #endregion Helper Methods 244 | } 245 | } 246 | -------------------------------------------------------------------------------- /DataAccess/DataAccess.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {F73BCE65-EA29-4020-B409-2B6A90031AE3} 8 | Library 9 | Properties 10 | DataAccess 11 | DataAccess 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | {dde60834-9685-42ad-a093-6f6900ea7455} 49 | Shared 50 | 51 | 52 | 53 | 60 | -------------------------------------------------------------------------------- /DataAccess/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("DataAccess")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DataAccess")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 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("cd30c0e2-4cfc-46cd-bff6-de1485022f19")] 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 Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Database Scripts/dbo.tblBook.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE [dbo].[tblBook] ( 2 | [Id] INT IDENTITY (1, 1) NOT NULL, 3 | [Name] NVARCHAR (100) NOT NULL, 4 | [AuthorName] NVARCHAR (50) NOT NULL, 5 | [PublisherName] NVARCHAR (50) NULL, 6 | [Price] INT NOT NULL, 7 | [Discount] REAL NOT NULL, 8 | [Rating] INT NOT NULL, 9 | [Language] NVARCHAR (50) NOT NULL, 10 | [PublicationYear] INT NULL, 11 | [ISBN13] NVARCHAR (50) NULL, 12 | [ISBN10] NVARCHAR (50) NULL, 13 | [Category] NVARCHAR (50) NOT NULL, 14 | [Image] NVARCHAR (200) NOT NULL, 15 | [Details] NVARCHAR (MAX) NULL, 16 | PRIMARY KEY CLUSTERED ([Id] ASC) 17 | ); 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Nitij Jhangra 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | AngularJS-WebAPI-BookStore 2 | ========================== 3 | 4 | This application demonstrates how to use Asp.Net web api RESTful services to send and receive data with angularJS. Apart from that you can see how angularJS is very effective in creating applications where we need to do real-time DOM manipulation. Also this is a single page application which utilizes angular views to navigate to different pages. 5 | 6 | This application does not contain any kind of user management or any payment processing system as this is outside the boundary of the scope of this article, but you can implement them easily enough if you want to by modifying the existing code. 7 | 8 | -------------------------------------------------------------------------------- /Shared/Models/BookModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Shared.Models 8 | { 9 | public class BookModel 10 | { 11 | public Int32 Id { get; set; } 12 | public String Name { get; set; } 13 | public String AuthorName { get; set; } 14 | public String PublisherName { get; set; } 15 | public Int32 Price { get; set; } 16 | public Decimal Discount { get; set; } 17 | public Int32 Rating { get; set; } 18 | public String Language { get; set; } 19 | public Int32 PublicationYear { get; set; } 20 | public String ISBN13 { get; set; } 21 | public String ISBN10 { get; set; } 22 | public String Category { get; set; } 23 | public String Image { get; set; } 24 | public String Details { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Shared/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("Shared")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Shared")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 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("7c58155b-4ba2-49b7-a57a-9dfcde7e5e61")] 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 Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Shared/Shared.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Shared 8 | { 9 | /// 10 | /// OperationType Class 11 | /// 12 | public static class OperationType 13 | { 14 | //add the mappings for operation type and its corresponding sql query text 15 | public static readonly Dictionary Map 16 | = new Dictionary 17 | { 18 | {Read, OperationText.Read}, 19 | {ReadByCategory, OperationText.ReadByCategory}, 20 | {ReadById, OperationText.ReadById} 21 | }; 22 | 23 | public const String Read = "Read"; 24 | public const String ReadByCategory = "ReadByCategory"; 25 | public const String ReadById = "ReadById"; 26 | } 27 | 28 | /// 29 | /// Class to provide custom exception messages 30 | /// 31 | public static class Exceptions 32 | { 33 | public const String Error = "Some error has occured"; 34 | } 35 | 36 | /// 37 | /// OperationText Class 38 | /// 39 | public static class OperationText 40 | { 41 | public const String Read = "SELECT * FROM tblBook"; 42 | public const String ReadByCategory = "SELECT * FROM tblBook WHERE Category = @category"; 43 | public const String ReadById = "SELECT * FROM tblBook WHERE Id = @id"; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /Shared/Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {DDE60834-9685-42AD-A093-6F6900EA7455} 8 | Library 9 | Properties 10 | Shared 11 | Shared 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 54 | -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.4.0.20710.0/Microsoft.AspNet.WebApi.4.0.20710.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/packages/Microsoft.AspNet.WebApi.4.0.20710.0/Microsoft.AspNet.WebApi.4.0.20710.0.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.Client.4.0.20710.0/Microsoft.AspNet.WebApi.Client.4.0.20710.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/packages/Microsoft.AspNet.WebApi.Client.4.0.20710.0/Microsoft.AspNet.WebApi.Client.4.0.20710.0.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.Client.4.0.20710.0/lib/net40/System.Net.Http.Formatting.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/packages/Microsoft.AspNet.WebApi.Client.4.0.20710.0/lib/net40/System.Net.Http.Formatting.dll -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.Core.4.0.20710.0/Microsoft.AspNet.WebApi.Core.4.0.20710.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/packages/Microsoft.AspNet.WebApi.Core.4.0.20710.0/Microsoft.AspNet.WebApi.Core.4.0.20710.0.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.Core.4.0.20710.0/content/web.config.transform: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.Core.4.0.20710.0/lib/net40/System.Web.Http.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/packages/Microsoft.AspNet.WebApi.Core.4.0.20710.0/lib/net40/System.Web.Http.dll -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.WebHost.4.0.20710.0/Microsoft.AspNet.WebApi.WebHost.4.0.20710.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/packages/Microsoft.AspNet.WebApi.WebHost.4.0.20710.0/Microsoft.AspNet.WebApi.WebHost.4.0.20710.0.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.WebHost.4.0.20710.0/lib/net40/System.Web.Http.WebHost.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/packages/Microsoft.AspNet.WebApi.WebHost.4.0.20710.0/lib/net40/System.Web.Http.WebHost.dll -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.WebHost.4.0.20710.0/lib/net40/System.Web.Http.WebHost.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | System.Web.Http.WebHost 5 | 6 | 7 | 8 | Provides a global for ASP.NET applications. 9 | 10 | 11 | 12 | Gets the default message handler that will be called for all requests. 13 | 14 | 15 | Extension methods for 16 | 17 | 18 | Maps the specified route template. 19 | A reference to the mapped route. 20 | A collection of routes for the application. 21 | The name of the route to map. 22 | The route template for the route. 23 | 24 | 25 | Maps the specified route template and sets default route. 26 | A reference to the mapped route. 27 | A collection of routes for the application. 28 | The name of the route to map. 29 | The route template for the route. 30 | An object that contains default route values. 31 | 32 | 33 | Maps the specified route template and sets default route values and constraints. 34 | A reference to the mapped route. 35 | A collection of routes for the application. 36 | The name of the route to map. 37 | The route template for the route. 38 | An object that contains default route values. 39 | A set of expressions that specify values for routeTemplate. 40 | 41 | 42 | Maps the specified route template and sets default route values, constraints, and end-point message handler. 43 | A reference to the mapped route. 44 | A collection of routes for the application. 45 | The name of the route to map. 46 | The route template for the route. 47 | An object that contains default route values. 48 | A set of expressions that specify values for routeTemplate. 49 | The handler to which the request will be dispatched. 50 | 51 | 52 | A that passes ASP.NET requests into the pipeline and write the result back. 53 | 54 | 55 | Initializes a new instance of the class. 56 | The route data. 57 | 58 | 59 | Begins the process request. 60 | An that contains information about the status of the process. 61 | The HTTP context base. 62 | The callback. 63 | The state. 64 | 65 | 66 | Provides an asynchronous process End method when the process ends. 67 | An that contains information about the status of the process. 68 | 69 | 70 | Gets a value indicating whether another request can use the instance. 71 | 72 | 73 | Processes the request. 74 | The HTTP context base. 75 | 76 | 77 | Begins processing the request. 78 | An that contains information about the status of the process. 79 | The HTTP context. 80 | The callback. 81 | The state. 82 | 83 | 84 | Provides an asynchronous process End method when the process ends. 85 | An that contains information about the status of the process. 86 | 87 | 88 | Gets a value indicating whether another request can use the instance. 89 | 90 | 91 | Processes the request. 92 | The HTTP context base. 93 | 94 | 95 | A that returns instances of that can pass requests to a given instance. 96 | 97 | 98 | Initializes a new instance of the class. 99 | 100 | 101 | Provides the object that processes the request. 102 | An object that processes the request. 103 | An object that encapsulates information about the request. 104 | 105 | 106 | Gets the singleton instance. 107 | 108 | 109 | Provides the object that processes the request. 110 | An object that processes the request. 111 | An object that encapsulates information about the request. 112 | 113 | 114 | Provides a registration point for the simple membership pre-application start code. 115 | 116 | 117 | Registers the simple membership pre-application start code. 118 | 119 | 120 | Represents the web host buffer policy selector. 121 | 122 | 123 | Initializes a new instance of the class. 124 | 125 | 126 | Gets a value that indicates whether the host should buffer the entity body of the HTTP request. 127 | true if buffering should be used; otherwise a streamed request should be used. 128 | The host context. 129 | 130 | 131 | Uses a buffered output stream for the web host. 132 | A buffered output stream. 133 | The response. 134 | 135 | 136 | -------------------------------------------------------------------------------- /packages/Microsoft.Net.Http.2.0.20710.0/Microsoft.Net.Http.2.0.20710.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/packages/Microsoft.Net.Http.2.0.20710.0/Microsoft.Net.Http.2.0.20710.0.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.Net.Http.2.0.20710.0/lib/net40/System.Net.Http.WebRequest.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/packages/Microsoft.Net.Http.2.0.20710.0/lib/net40/System.Net.Http.WebRequest.dll -------------------------------------------------------------------------------- /packages/Microsoft.Net.Http.2.0.20710.0/lib/net40/System.Net.Http.WebRequest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | System.Net.Http.WebRequest 5 | 6 | 7 | 8 | Represents the class that is used to create special for use with the Real-Time-Communications (RTC) background notification infrastructure. 9 | 10 | 11 | Creates a special for use with the Real-Time-Communications (RTC) background notification infrastructure. 12 | Returns .An HTTP request message for use with the RTC background notification infrastructure. 13 | The HTTP method. 14 | The Uri the request is sent to. 15 | 16 | 17 | Provides desktop-specific features not available to Windows Store apps or other environments. 18 | 19 | 20 | Initializes a new instance of the class. 21 | 22 | 23 | Gets or sets a value that indicates whether to pipeline the request to the Internet resource. 24 | Returns .true if the request should be pipelined; otherwise, false. The default is true. 25 | 26 | 27 | Gets or sets a value indicating the level of authentication and impersonation used for this request. 28 | Returns .A bitwise combination of the values. The default value is . 29 | 30 | 31 | Gets or sets the cache policy for this request. 32 | Returns .A object that defines a cache policy. The default is . 33 | 34 | 35 | Gets or sets the collection of security certificates that are associated with this request. 36 | Returns .The collection of security certificates associated with this request. 37 | 38 | 39 | Gets or sets the amount of time, in milliseconds, the application will wait for 100-continue from the server before uploading data. 40 | Returns .The amount of time, in milliseconds, the application will wait for 100-continue from the server before uploading data. The default value is 350 milliseconds. 41 | 42 | 43 | Gets or sets the impersonation level for the current request. 44 | Returns .The impersonation level for the request. The default is . 45 | 46 | 47 | Gets or sets the maximum allowed length of the response headers. 48 | Returns .The length, in kilobytes (1024 bytes), of the response headers. 49 | 50 | 51 | Gets or sets a time-out in milliseconds when writing a request to or reading a response from a server. 52 | Returns .The number of milliseconds before the writing or reading times out. The default value is 300,000 milliseconds (5 minutes). 53 | 54 | 55 | Gets or sets a callback method to validate the server certificate. 56 | Returns .A callback method to validate the server certificate. 57 | 58 | 59 | Gets or sets a value that indicates whether to allow high-speed NTLM-authenticated connection sharing. 60 | Returns .true to keep the authenticated connection open; otherwise, false. 61 | 62 | 63 | -------------------------------------------------------------------------------- /packages/Microsoft.Net.Http.2.0.20710.0/lib/net40/System.Net.Http.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/packages/Microsoft.Net.Http.2.0.20710.0/lib/net40/System.Net.Http.dll -------------------------------------------------------------------------------- /packages/Microsoft.Net.Http.2.0.20710.0/lib/net45/_._: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.4.5.6/Newtonsoft.Json.4.5.6.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/packages/Newtonsoft.Json.4.5.6/Newtonsoft.Json.4.5.6.nupkg -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.4.5.6/lib/net40/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nitij/AngularJS-WebAPI-BookStore/bb1d2367d96bd97b9e5f45d55edd138880245bda/packages/Newtonsoft.Json.4.5.6/lib/net40/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------