├── .gitignore ├── Approval.Web.old ├── Approval.Web.csproj ├── Content │ └── Site.css ├── Controllers │ ├── ApprovalController.cs │ └── HomeController.cs ├── Global.asax ├── Global.asax.cs ├── Properties │ └── AssemblyInfo.cs ├── Scripts │ ├── MicrosoftAjax.debug.js │ ├── MicrosoftAjax.js │ ├── MicrosoftMvcAjax.debug.js │ ├── MicrosoftMvcAjax.js │ ├── MicrosoftMvcValidation.debug.js │ ├── MicrosoftMvcValidation.js │ ├── jquery-1.4.1-vsdoc.js │ ├── jquery-1.4.1.js │ ├── jquery-1.4.1.min.js │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ └── jquery.validate.min.js ├── Service References │ └── ApprovalWorkflowService │ │ ├── Reference.cs │ │ ├── Reference.svcmap │ │ ├── Workflow.disco │ │ ├── Workflow.wsdl │ │ ├── Workflow.xsd │ │ ├── Workflow1.xsd │ │ ├── Workflow2.xsd │ │ ├── configuration.svcinfo │ │ └── configuration91.svcinfo ├── Views │ ├── Approval │ │ ├── Approve.aspx │ │ └── Decline.aspx │ ├── Home │ │ ├── About.aspx │ │ └── Index.aspx │ ├── Shared │ │ ├── Error.aspx │ │ └── Site.Master │ └── Web.config ├── Web.Debug.config ├── Web.Release.config └── Web.config ├── Approval.Web ├── App_Start │ ├── FilterConfig.cs │ ├── RouteConfig.cs │ └── WebApiConfig.cs ├── Approval.Web.csproj ├── Controllers │ ├── ApprovalController.cs │ └── HomeController.cs ├── Global.asax ├── Global.asax.cs ├── Properties │ └── AssemblyInfo.cs ├── Service References │ └── ApprovalWorkflowService │ │ ├── Reference.cs │ │ ├── Reference.svcmap │ │ ├── Workflow.disco │ │ ├── Workflow.wsdl │ │ ├── Workflow.xsd │ │ ├── Workflow1.xsd │ │ ├── Workflow2.xsd │ │ ├── configuration.svcinfo │ │ └── configuration91.svcinfo ├── Views │ ├── Approval │ │ ├── Approve.aspx │ │ └── Decline.aspx │ ├── Home │ │ ├── About.aspx │ │ └── Index.aspx │ ├── Shared │ │ ├── Error.aspx │ │ └── Site.Master │ └── Web.config ├── Web.Debug.config ├── Web.Release.config ├── Web.config └── packages.config ├── ApprovalSample.sln ├── ApprovalSample.sln.ide └── graph │ └── ApprovalSample.sln.ide ├── ApprovalWorkflow ├── ApprovalWorkflow.csproj ├── Properties │ └── AssemblyInfo.cs ├── SendEmail.cs ├── Web.config └── Workflow.xamlx ├── ApproverClient ├── ApproverClient.csproj ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── Service References │ └── ApprovalWorkflowService │ │ ├── Reference.cs │ │ ├── Reference.svcmap │ │ ├── Service1.disco │ │ ├── Service1.wsdl │ │ ├── Service1.xsd │ │ ├── Service11.xsd │ │ ├── Service12.xsd │ │ ├── configuration.svcinfo │ │ └── configuration91.svcinfo └── app.config ├── LICENSE.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | 131 | # NuGet Packages Directory 132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 133 | packages/ 134 | 135 | # Windows Azure Build Output 136 | csx 137 | *.build.csdef 138 | 139 | # Windows Store app package directory 140 | AppPackages/ 141 | 142 | # Others 143 | sql/ 144 | *.Cache 145 | ClientBin/ 146 | [Ss]tyle[Cc]op.* 147 | ~$* 148 | *~ 149 | *.dbmdl 150 | *.[Pp]ublish.xml 151 | *.pfx 152 | *.publishsettings 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | App_Data/*.mdf 166 | App_Data/*.ldf 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 | # Mac crap 183 | .DS_Store 184 | 185 | 186 | ############# 187 | ## Python 188 | ############# 189 | 190 | *.py[co] 191 | 192 | # Packages 193 | *.egg 194 | *.egg-info 195 | dist/ 196 | build/ 197 | eggs/ 198 | parts/ 199 | var/ 200 | sdist/ 201 | develop-eggs/ 202 | .installed.cfg 203 | 204 | # Installer logs 205 | pip-log.txt 206 | 207 | # Unit test / coverage reports 208 | .coverage 209 | .tox 210 | 211 | #Translations 212 | *.mo 213 | 214 | #Mr Developer 215 | .mr.developer.cfg 216 | -------------------------------------------------------------------------------- /Approval.Web.old/Approval.Web.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 7 | 8 | 2.0 9 | {037AA44A-6D2B-40FB-BD81-1FEEABFAC368} 10 | {F85E285D-A4E0-4152-9332-AB1D724D3325};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 11 | Library 12 | Properties 13 | Approval.Web 14 | Approval.Web 15 | v4.0 16 | false 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 3.5 47 | 48 | 49 | 3.5 50 | 51 | 52 | 3.5 53 | 54 | 55 | 56 | 3.5 57 | 58 | 59 | 60 | 3.5 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | Global.asax 74 | 75 | 76 | 77 | True 78 | True 79 | Reference.svcmap 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | WCF Proxy Generator 89 | Reference.cs 90 | 91 | 92 | 93 | 94 | 95 | Web.config 96 | 97 | 98 | Web.config 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | Designer 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | Designer 136 | 137 | 138 | Designer 139 | 140 | 141 | 142 | 143 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | True 155 | True 156 | 1842 157 | / 158 | http://localhost/TechEdNZ/Approval.Web 159 | False 160 | False 161 | 162 | 163 | False 164 | 165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /Approval.Web.old/Content/Site.css: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------- 2 | The base color for this template is #5c87b2. If you'd like 3 | to use a different color start by replacing all instances of 4 | #5c87b2 with your new color. 5 | ----------------------------------------------------------*/ 6 | body 7 | { 8 | background-color: #5c87b2; 9 | font-size: .75em; 10 | font-family: Verdana, Helvetica, Sans-Serif; 11 | margin: 0; 12 | padding: 0; 13 | color: #696969; 14 | } 15 | 16 | a:link 17 | { 18 | color: #034af3; 19 | text-decoration: underline; 20 | } 21 | a:visited 22 | { 23 | color: #505abc; 24 | } 25 | a:hover 26 | { 27 | color: #1d60ff; 28 | text-decoration: none; 29 | } 30 | a:active 31 | { 32 | color: #12eb87; 33 | } 34 | 35 | p, ul 36 | { 37 | margin-bottom: 20px; 38 | line-height: 1.6em; 39 | } 40 | 41 | /* HEADINGS 42 | ----------------------------------------------------------*/ 43 | h1, h2, h3, h4, h5, h6 44 | { 45 | font-size: 1.5em; 46 | color: #000; 47 | font-family: Arial, Helvetica, sans-serif; 48 | } 49 | 50 | h1 51 | { 52 | font-size: 2em; 53 | padding-bottom: 0; 54 | margin-bottom: 0; 55 | } 56 | h2 57 | { 58 | padding: 0 0 10px 0; 59 | } 60 | h3 61 | { 62 | font-size: 1.2em; 63 | } 64 | h4 65 | { 66 | font-size: 1.1em; 67 | } 68 | h5, h6 69 | { 70 | font-size: 1em; 71 | } 72 | 73 | /* this rule styles

tags that are the 74 | first child of the left and right table columns */ 75 | .rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2 76 | { 77 | margin-top: 0; 78 | } 79 | 80 | /* PRIMARY LAYOUT ELEMENTS 81 | ----------------------------------------------------------*/ 82 | 83 | /* you can specify a greater or lesser percentage for the 84 | page width. Or, you can specify an exact pixel width. */ 85 | .page 86 | { 87 | width: 90%; 88 | margin-left: auto; 89 | margin-right: auto; 90 | } 91 | 92 | #header 93 | { 94 | position: relative; 95 | margin-bottom: 0px; 96 | color: #000; 97 | padding: 0; 98 | } 99 | 100 | #header h1 101 | { 102 | font-weight: bold; 103 | padding: 5px 0; 104 | margin: 0; 105 | color: #fff; 106 | border: none; 107 | line-height: 2em; 108 | font-family: Arial, Helvetica, sans-serif; 109 | font-size: 32px !important; 110 | } 111 | 112 | #main 113 | { 114 | padding: 30px 30px 15px 30px; 115 | background-color: #fff; 116 | margin-bottom: 30px; 117 | _height: 1px; /* only IE6 applies CSS properties starting with an underscore */ 118 | } 119 | 120 | #footer 121 | { 122 | color: #999; 123 | padding: 10px 0; 124 | text-align: center; 125 | line-height: normal; 126 | margin: 0; 127 | font-size: .9em; 128 | } 129 | 130 | /* TAB MENU 131 | ----------------------------------------------------------*/ 132 | ul#menu 133 | { 134 | border-bottom: 1px #5C87B2 solid; 135 | padding: 0 0 2px; 136 | position: relative; 137 | margin: 0; 138 | text-align: right; 139 | } 140 | 141 | ul#menu li 142 | { 143 | display: inline; 144 | list-style: none; 145 | } 146 | 147 | ul#menu li#greeting 148 | { 149 | padding: 10px 20px; 150 | font-weight: bold; 151 | text-decoration: none; 152 | line-height: 2.8em; 153 | color: #fff; 154 | } 155 | 156 | ul#menu li a 157 | { 158 | padding: 10px 20px; 159 | font-weight: bold; 160 | text-decoration: none; 161 | line-height: 2.8em; 162 | background-color: #e8eef4; 163 | color: #034af3; 164 | } 165 | 166 | ul#menu li a:hover 167 | { 168 | background-color: #fff; 169 | text-decoration: none; 170 | } 171 | 172 | ul#menu li a:active 173 | { 174 | background-color: #a6e2a6; 175 | text-decoration: none; 176 | } 177 | 178 | ul#menu li.selected a 179 | { 180 | background-color: #fff; 181 | color: #000; 182 | } 183 | 184 | /* FORM LAYOUT ELEMENTS 185 | ----------------------------------------------------------*/ 186 | 187 | fieldset 188 | { 189 | margin: 1em 0; 190 | padding: 1em; 191 | border: 1px solid #CCC; 192 | } 193 | 194 | fieldset p 195 | { 196 | margin: 2px 12px 10px 10px; 197 | } 198 | 199 | legend 200 | { 201 | font-size: 1.1em; 202 | font-weight: 600; 203 | padding: 2px 4px 8px 4px; 204 | } 205 | 206 | input[type="text"] 207 | { 208 | width: 200px; 209 | border: 1px solid #CCC; 210 | } 211 | 212 | input[type="password"] 213 | { 214 | width: 200px; 215 | border: 1px solid #CCC; 216 | } 217 | 218 | /* TABLE 219 | ----------------------------------------------------------*/ 220 | 221 | table 222 | { 223 | border: solid 1px #e8eef4; 224 | border-collapse: collapse; 225 | } 226 | 227 | table td 228 | { 229 | padding: 5px; 230 | border: solid 1px #e8eef4; 231 | } 232 | 233 | table th 234 | { 235 | padding: 6px 5px; 236 | text-align: left; 237 | background-color: #e8eef4; 238 | border: solid 1px #e8eef4; 239 | } 240 | 241 | /* MISC 242 | ----------------------------------------------------------*/ 243 | .clear 244 | { 245 | clear: both; 246 | } 247 | 248 | .error 249 | { 250 | color:Red; 251 | } 252 | 253 | #menucontainer 254 | { 255 | margin-top:40px; 256 | } 257 | 258 | div#title 259 | { 260 | display:block; 261 | float:left; 262 | text-align:left; 263 | } 264 | 265 | #logindisplay 266 | { 267 | font-size:1.1em; 268 | display:block; 269 | text-align:right; 270 | margin:10px; 271 | color:White; 272 | } 273 | 274 | #logindisplay a:link 275 | { 276 | color: white; 277 | text-decoration: underline; 278 | } 279 | 280 | #logindisplay a:visited 281 | { 282 | color: white; 283 | text-decoration: underline; 284 | } 285 | 286 | #logindisplay a:hover 287 | { 288 | color: white; 289 | text-decoration: none; 290 | } 291 | 292 | /* Styles for validation helpers 293 | -----------------------------------------------------------*/ 294 | .field-validation-error 295 | { 296 | color: #ff0000; 297 | } 298 | 299 | .field-validation-valid 300 | { 301 | display: none; 302 | } 303 | 304 | .input-validation-error 305 | { 306 | border: 1px solid #ff0000; 307 | background-color: #ffeeee; 308 | } 309 | 310 | .validation-summary-errors 311 | { 312 | font-weight: bold; 313 | color: #ff0000; 314 | } 315 | 316 | .validation-summary-valid 317 | { 318 | display: none; 319 | } 320 | 321 | /* Styles for editor and display helpers 322 | ----------------------------------------------------------*/ 323 | .display-label, 324 | .editor-label, 325 | .display-field, 326 | .editor-field 327 | { 328 | margin: 0.5em 0; 329 | } 330 | 331 | .text-box 332 | { 333 | width: 30em; 334 | } 335 | 336 | .text-box.multi-line 337 | { 338 | height: 6.5em; 339 | } 340 | 341 | .tri-state 342 | { 343 | width: 6em; 344 | } 345 | -------------------------------------------------------------------------------- /Approval.Web.old/Controllers/ApprovalController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace Approval.Web.Controllers { 8 | public class ApprovalController : Controller { 9 | 10 | public ActionResult Approve(string id) { 11 | ApprovalWorkflowService.ServiceClient serviceClient = new ApprovalWorkflowService.ServiceClient(); 12 | serviceClient.Approve(id); 13 | return View(); 14 | } 15 | 16 | public ActionResult Decline(string id) { 17 | ApprovalWorkflowService.ServiceClient serviceClient = new ApprovalWorkflowService.ServiceClient(); 18 | serviceClient.Decline(id); 19 | return View(); 20 | } 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Approval.Web.old/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace Approval.Web.Controllers { 8 | [HandleError] 9 | public class HomeController : Controller { 10 | public ActionResult Index() { 11 | ViewData["Message"] = "Welcome to ASP.NET MVC!"; 12 | 13 | return View(); 14 | } 15 | 16 | public ActionResult About() { 17 | return View(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Approval.Web.old/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Approval.Web.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Approval.Web.old/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Approval.Web { 9 | // Note: For instructions on enabling IIS6 or IIS7 classic mode, 10 | // visit http://go.microsoft.com/?LinkId=9394801 11 | 12 | public class MvcApplication : System.Web.HttpApplication { 13 | public static void RegisterRoutes(RouteCollection routes) { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | "Default", // Route name 18 | "{controller}/{action}/{id}", // URL with parameters 19 | new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults 20 | ); 21 | 22 | } 23 | 24 | protected void Application_Start() { 25 | AreaRegistration.RegisterAllAreas(); 26 | 27 | RegisterRoutes(RouteTable.Routes); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Approval.Web.old/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("Approval.Web")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Approval.Web")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 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("c1c9a9b2-98de-4469-ad98-955dbf747f5c")] 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 | -------------------------------------------------------------------------------- /Approval.Web.old/Scripts/MicrosoftMvcAjax.debug.js: -------------------------------------------------------------------------------- 1 | //!---------------------------------------------------------- 2 | //! Copyright (C) Microsoft Corporation. All rights reserved. 3 | //!---------------------------------------------------------- 4 | //! MicrosoftMvcAjax.js 5 | 6 | Type.registerNamespace('Sys.Mvc'); 7 | 8 | //////////////////////////////////////////////////////////////////////////////// 9 | // Sys.Mvc.AjaxOptions 10 | 11 | Sys.Mvc.$create_AjaxOptions = function Sys_Mvc_AjaxOptions() { return {}; } 12 | 13 | 14 | //////////////////////////////////////////////////////////////////////////////// 15 | // Sys.Mvc.InsertionMode 16 | 17 | Sys.Mvc.InsertionMode = function() { 18 | /// 19 | /// 20 | /// 21 | /// 22 | /// 23 | /// 24 | }; 25 | Sys.Mvc.InsertionMode.prototype = { 26 | replace: 0, 27 | insertBefore: 1, 28 | insertAfter: 2 29 | } 30 | Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode', false); 31 | 32 | 33 | //////////////////////////////////////////////////////////////////////////////// 34 | // Sys.Mvc.AjaxContext 35 | 36 | Sys.Mvc.AjaxContext = function Sys_Mvc_AjaxContext(request, updateTarget, loadingElement, insertionMode) { 37 | /// 38 | /// 39 | /// 40 | /// 41 | /// 42 | /// 43 | /// 44 | /// 45 | /// 46 | /// 47 | /// 48 | /// 49 | /// 50 | /// 51 | /// 52 | /// 53 | /// 54 | /// 55 | this._request = request; 56 | this._updateTarget = updateTarget; 57 | this._loadingElement = loadingElement; 58 | this._insertionMode = insertionMode; 59 | } 60 | Sys.Mvc.AjaxContext.prototype = { 61 | _insertionMode: 0, 62 | _loadingElement: null, 63 | _response: null, 64 | _request: null, 65 | _updateTarget: null, 66 | 67 | get_data: function Sys_Mvc_AjaxContext$get_data() { 68 | /// 69 | if (this._response) { 70 | return this._response.get_responseData(); 71 | } 72 | else { 73 | return null; 74 | } 75 | }, 76 | 77 | get_insertionMode: function Sys_Mvc_AjaxContext$get_insertionMode() { 78 | /// 79 | return this._insertionMode; 80 | }, 81 | 82 | get_loadingElement: function Sys_Mvc_AjaxContext$get_loadingElement() { 83 | /// 84 | return this._loadingElement; 85 | }, 86 | 87 | get_object: function Sys_Mvc_AjaxContext$get_object() { 88 | /// 89 | var executor = this.get_response(); 90 | return (executor) ? executor.get_object() : null; 91 | }, 92 | 93 | get_response: function Sys_Mvc_AjaxContext$get_response() { 94 | /// 95 | return this._response; 96 | }, 97 | set_response: function Sys_Mvc_AjaxContext$set_response(value) { 98 | /// 99 | this._response = value; 100 | return value; 101 | }, 102 | 103 | get_request: function Sys_Mvc_AjaxContext$get_request() { 104 | /// 105 | return this._request; 106 | }, 107 | 108 | get_updateTarget: function Sys_Mvc_AjaxContext$get_updateTarget() { 109 | /// 110 | return this._updateTarget; 111 | } 112 | } 113 | 114 | 115 | //////////////////////////////////////////////////////////////////////////////// 116 | // Sys.Mvc.AsyncHyperlink 117 | 118 | Sys.Mvc.AsyncHyperlink = function Sys_Mvc_AsyncHyperlink() { 119 | } 120 | Sys.Mvc.AsyncHyperlink.handleClick = function Sys_Mvc_AsyncHyperlink$handleClick(anchor, evt, ajaxOptions) { 121 | /// 122 | /// 123 | /// 124 | /// 125 | /// 126 | /// 127 | evt.preventDefault(); 128 | Sys.Mvc.MvcHelpers._asyncRequest(anchor.href, 'post', '', anchor, ajaxOptions); 129 | } 130 | 131 | 132 | //////////////////////////////////////////////////////////////////////////////// 133 | // Sys.Mvc.MvcHelpers 134 | 135 | Sys.Mvc.MvcHelpers = function Sys_Mvc_MvcHelpers() { 136 | } 137 | Sys.Mvc.MvcHelpers._serializeSubmitButton = function Sys_Mvc_MvcHelpers$_serializeSubmitButton(element, offsetX, offsetY) { 138 | /// 139 | /// 140 | /// 141 | /// 142 | /// 143 | /// 144 | /// 145 | if (element.disabled) { 146 | return null; 147 | } 148 | var name = element.name; 149 | if (name) { 150 | var tagName = element.tagName.toUpperCase(); 151 | var encodedName = encodeURIComponent(name); 152 | var inputElement = element; 153 | if (tagName === 'INPUT') { 154 | var type = inputElement.type; 155 | if (type === 'submit') { 156 | return encodedName + '=' + encodeURIComponent(inputElement.value); 157 | } 158 | else if (type === 'image') { 159 | return encodedName + '.x=' + offsetX + '&' + encodedName + '.y=' + offsetY; 160 | } 161 | } 162 | else if ((tagName === 'BUTTON') && (name.length) && (inputElement.type === 'submit')) { 163 | return encodedName + '=' + encodeURIComponent(inputElement.value); 164 | } 165 | } 166 | return null; 167 | } 168 | Sys.Mvc.MvcHelpers._serializeForm = function Sys_Mvc_MvcHelpers$_serializeForm(form) { 169 | /// 170 | /// 171 | /// 172 | var formElements = form.elements; 173 | var formBody = new Sys.StringBuilder(); 174 | var count = formElements.length; 175 | for (var i = 0; i < count; i++) { 176 | var element = formElements[i]; 177 | var name = element.name; 178 | if (!name || !name.length) { 179 | continue; 180 | } 181 | var tagName = element.tagName.toUpperCase(); 182 | if (tagName === 'INPUT') { 183 | var inputElement = element; 184 | var type = inputElement.type; 185 | if ((type === 'text') || (type === 'password') || (type === 'hidden') || (((type === 'checkbox') || (type === 'radio')) && element.checked)) { 186 | formBody.append(encodeURIComponent(name)); 187 | formBody.append('='); 188 | formBody.append(encodeURIComponent(inputElement.value)); 189 | formBody.append('&'); 190 | } 191 | } 192 | else if (tagName === 'SELECT') { 193 | var selectElement = element; 194 | var optionCount = selectElement.options.length; 195 | for (var j = 0; j < optionCount; j++) { 196 | var optionElement = selectElement.options[j]; 197 | if (optionElement.selected) { 198 | formBody.append(encodeURIComponent(name)); 199 | formBody.append('='); 200 | formBody.append(encodeURIComponent(optionElement.value)); 201 | formBody.append('&'); 202 | } 203 | } 204 | } 205 | else if (tagName === 'TEXTAREA') { 206 | formBody.append(encodeURIComponent(name)); 207 | formBody.append('='); 208 | formBody.append(encodeURIComponent((element.value))); 209 | formBody.append('&'); 210 | } 211 | } 212 | var additionalInput = form._additionalInput; 213 | if (additionalInput) { 214 | formBody.append(additionalInput); 215 | formBody.append('&'); 216 | } 217 | return formBody.toString(); 218 | } 219 | Sys.Mvc.MvcHelpers._asyncRequest = function Sys_Mvc_MvcHelpers$_asyncRequest(url, verb, body, triggerElement, ajaxOptions) { 220 | /// 221 | /// 222 | /// 223 | /// 224 | /// 225 | /// 226 | /// 227 | /// 228 | /// 229 | /// 230 | if (ajaxOptions.confirm) { 231 | if (!confirm(ajaxOptions.confirm)) { 232 | return; 233 | } 234 | } 235 | if (ajaxOptions.url) { 236 | url = ajaxOptions.url; 237 | } 238 | if (ajaxOptions.httpMethod) { 239 | verb = ajaxOptions.httpMethod; 240 | } 241 | if (body.length > 0 && !body.endsWith('&')) { 242 | body += '&'; 243 | } 244 | body += 'X-Requested-With=XMLHttpRequest'; 245 | var upperCaseVerb = verb.toUpperCase(); 246 | var isGetOrPost = (upperCaseVerb === 'GET' || upperCaseVerb === 'POST'); 247 | if (!isGetOrPost) { 248 | body += '&'; 249 | body += 'X-HTTP-Method-Override=' + upperCaseVerb; 250 | } 251 | var requestBody = ''; 252 | if (upperCaseVerb === 'GET' || upperCaseVerb === 'DELETE') { 253 | if (url.indexOf('?') > -1) { 254 | if (!url.endsWith('&')) { 255 | url += '&'; 256 | } 257 | url += body; 258 | } 259 | else { 260 | url += '?'; 261 | url += body; 262 | } 263 | } 264 | else { 265 | requestBody = body; 266 | } 267 | var request = new Sys.Net.WebRequest(); 268 | request.set_url(url); 269 | if (isGetOrPost) { 270 | request.set_httpVerb(verb); 271 | } 272 | else { 273 | request.set_httpVerb('POST'); 274 | request.get_headers()['X-HTTP-Method-Override'] = upperCaseVerb; 275 | } 276 | request.set_body(requestBody); 277 | if (verb.toUpperCase() === 'PUT') { 278 | request.get_headers()['Content-Type'] = 'application/x-www-form-urlencoded;'; 279 | } 280 | request.get_headers()['X-Requested-With'] = 'XMLHttpRequest'; 281 | var updateElement = null; 282 | if (ajaxOptions.updateTargetId) { 283 | updateElement = $get(ajaxOptions.updateTargetId); 284 | } 285 | var loadingElement = null; 286 | if (ajaxOptions.loadingElementId) { 287 | loadingElement = $get(ajaxOptions.loadingElementId); 288 | } 289 | var ajaxContext = new Sys.Mvc.AjaxContext(request, updateElement, loadingElement, ajaxOptions.insertionMode); 290 | var continueRequest = true; 291 | if (ajaxOptions.onBegin) { 292 | continueRequest = ajaxOptions.onBegin(ajaxContext) !== false; 293 | } 294 | if (loadingElement) { 295 | Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), true); 296 | } 297 | if (continueRequest) { 298 | request.add_completed(Function.createDelegate(null, function(executor) { 299 | Sys.Mvc.MvcHelpers._onComplete(request, ajaxOptions, ajaxContext); 300 | })); 301 | request.invoke(); 302 | } 303 | } 304 | Sys.Mvc.MvcHelpers._onComplete = function Sys_Mvc_MvcHelpers$_onComplete(request, ajaxOptions, ajaxContext) { 305 | /// 306 | /// 307 | /// 308 | /// 309 | /// 310 | /// 311 | ajaxContext.set_response(request.get_executor()); 312 | if (ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext) === false) { 313 | return; 314 | } 315 | var statusCode = ajaxContext.get_response().get_statusCode(); 316 | if ((statusCode >= 200 && statusCode < 300) || statusCode === 304 || statusCode === 1223) { 317 | if (statusCode !== 204 && statusCode !== 304 && statusCode !== 1223) { 318 | var contentType = ajaxContext.get_response().getResponseHeader('Content-Type'); 319 | if ((contentType) && (contentType.indexOf('application/x-javascript') !== -1)) { 320 | eval(ajaxContext.get_data()); 321 | } 322 | else { 323 | Sys.Mvc.MvcHelpers.updateDomElement(ajaxContext.get_updateTarget(), ajaxContext.get_insertionMode(), ajaxContext.get_data()); 324 | } 325 | } 326 | if (ajaxOptions.onSuccess) { 327 | ajaxOptions.onSuccess(ajaxContext); 328 | } 329 | } 330 | else { 331 | if (ajaxOptions.onFailure) { 332 | ajaxOptions.onFailure(ajaxContext); 333 | } 334 | } 335 | if (ajaxContext.get_loadingElement()) { 336 | Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), false); 337 | } 338 | } 339 | Sys.Mvc.MvcHelpers.updateDomElement = function Sys_Mvc_MvcHelpers$updateDomElement(target, insertionMode, content) { 340 | /// 341 | /// 342 | /// 343 | /// 344 | /// 345 | /// 346 | if (target) { 347 | switch (insertionMode) { 348 | case Sys.Mvc.InsertionMode.replace: 349 | target.innerHTML = content; 350 | break; 351 | case Sys.Mvc.InsertionMode.insertBefore: 352 | if (content && content.length > 0) { 353 | target.innerHTML = content + target.innerHTML.trimStart(); 354 | } 355 | break; 356 | case Sys.Mvc.InsertionMode.insertAfter: 357 | if (content && content.length > 0) { 358 | target.innerHTML = target.innerHTML.trimEnd() + content; 359 | } 360 | break; 361 | } 362 | } 363 | } 364 | 365 | 366 | //////////////////////////////////////////////////////////////////////////////// 367 | // Sys.Mvc.AsyncForm 368 | 369 | Sys.Mvc.AsyncForm = function Sys_Mvc_AsyncForm() { 370 | } 371 | Sys.Mvc.AsyncForm.handleClick = function Sys_Mvc_AsyncForm$handleClick(form, evt) { 372 | /// 373 | /// 374 | /// 375 | /// 376 | var additionalInput = Sys.Mvc.MvcHelpers._serializeSubmitButton(evt.target, evt.offsetX, evt.offsetY); 377 | form._additionalInput = additionalInput; 378 | } 379 | Sys.Mvc.AsyncForm.handleSubmit = function Sys_Mvc_AsyncForm$handleSubmit(form, evt, ajaxOptions) { 380 | /// 381 | /// 382 | /// 383 | /// 384 | /// 385 | /// 386 | evt.preventDefault(); 387 | var validationCallbacks = form.validationCallbacks; 388 | if (validationCallbacks) { 389 | for (var i = 0; i < validationCallbacks.length; i++) { 390 | var callback = validationCallbacks[i]; 391 | if (!callback()) { 392 | return; 393 | } 394 | } 395 | } 396 | var body = Sys.Mvc.MvcHelpers._serializeForm(form); 397 | Sys.Mvc.MvcHelpers._asyncRequest(form.action, form.method || 'post', body, form, ajaxOptions); 398 | } 399 | 400 | 401 | Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext'); 402 | Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink'); 403 | Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers'); 404 | Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm'); 405 | 406 | // ---- Do not remove this footer ---- 407 | // Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) 408 | // ----------------------------------- 409 | -------------------------------------------------------------------------------- /Approval.Web.old/Scripts/MicrosoftMvcAjax.js: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------- 2 | // Copyright (C) Microsoft Corporation. All rights reserved. 3 | //---------------------------------------------------------- 4 | // MicrosoftMvcAjax.js 5 | 6 | Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_AjaxOptions=function(){return {};} 7 | Sys.Mvc.InsertionMode=function(){};Sys.Mvc.InsertionMode.prototype = {replace:0,insertBefore:1,insertAfter:2} 8 | Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode',false);Sys.Mvc.AjaxContext=function(request,updateTarget,loadingElement,insertionMode){this.$3=request;this.$4=updateTarget;this.$1=loadingElement;this.$0=insertionMode;} 9 | Sys.Mvc.AjaxContext.prototype={$0:0,$1:null,$2:null,$3:null,$4:null,get_data:function(){if(this.$2){return this.$2.get_responseData();}else{return null;}},get_insertionMode:function(){return this.$0;},get_loadingElement:function(){return this.$1;},get_object:function(){var $0=this.get_response();return ($0)?$0.get_object():null;},get_response:function(){return this.$2;},set_response:function(value){this.$2=value;return value;},get_request:function(){return this.$3;},get_updateTarget:function(){return this.$4;}} 10 | Sys.Mvc.AsyncHyperlink=function(){} 11 | Sys.Mvc.AsyncHyperlink.handleClick=function(anchor,evt,ajaxOptions){evt.preventDefault();Sys.Mvc.MvcHelpers.$2(anchor.href,'post','',anchor,ajaxOptions);} 12 | Sys.Mvc.MvcHelpers=function(){} 13 | Sys.Mvc.MvcHelpers.$0=function($p0,$p1,$p2){if($p0.disabled){return null;}var $0=$p0.name;if($0){var $1=$p0.tagName.toUpperCase();var $2=encodeURIComponent($0);var $3=$p0;if($1==='INPUT'){var $4=$3.type;if($4==='submit'){return $2+'='+encodeURIComponent($3.value);}else if($4==='image'){return $2+'.x='+$p1+'&'+$2+'.y='+$p2;}}else if(($1==='BUTTON')&&($0.length)&&($3.type==='submit')){return $2+'='+encodeURIComponent($3.value);}}return null;} 14 | Sys.Mvc.MvcHelpers.$1=function($p0){var $0=$p0.elements;var $1=new Sys.StringBuilder();var $2=$0.length;for(var $4=0;$4<$2;$4++){var $5=$0[$4];var $6=$5.name;if(!$6||!$6.length){continue;}var $7=$5.tagName.toUpperCase();if($7==='INPUT'){var $8=$5;var $9=$8.type;if(($9==='text')||($9==='password')||($9==='hidden')||((($9==='checkbox')||($9==='radio'))&&$5.checked)){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($8.value));$1.append('&');}}else if($7==='SELECT'){var $A=$5;var $B=$A.options.length;for(var $C=0;$C<$B;$C++){var $D=$A.options[$C];if($D.selected){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($D.value));$1.append('&');}}}else if($7==='TEXTAREA'){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent(($5.value)));$1.append('&');}}var $3=$p0._additionalInput;if($3){$1.append($3);$1.append('&');}return $1.toString();} 15 | Sys.Mvc.MvcHelpers.$2=function($p0,$p1,$p2,$p3,$p4){if($p4.confirm){if(!confirm($p4.confirm)){return;}}if($p4.url){$p0=$p4.url;}if($p4.httpMethod){$p1=$p4.httpMethod;}if($p2.length>0&&!$p2.endsWith('&')){$p2+='&';}$p2+='X-Requested-With=XMLHttpRequest';var $0=$p1.toUpperCase();var $1=($0==='GET'||$0==='POST');if(!$1){$p2+='&';$p2+='X-HTTP-Method-Override='+$0;}var $2='';if($0==='GET'||$0==='DELETE'){if($p0.indexOf('?')>-1){if(!$p0.endsWith('&')){$p0+='&';}$p0+=$p2;}else{$p0+='?';$p0+=$p2;}}else{$2=$p2;}var $3=new Sys.Net.WebRequest();$3.set_url($p0);if($1){$3.set_httpVerb($p1);}else{$3.set_httpVerb('POST');$3.get_headers()['X-HTTP-Method-Override']=$0;}$3.set_body($2);if($p1.toUpperCase()==='PUT'){$3.get_headers()['Content-Type']='application/x-www-form-urlencoded;';}$3.get_headers()['X-Requested-With']='XMLHttpRequest';var $4=null;if($p4.updateTargetId){$4=$get($p4.updateTargetId);}var $5=null;if($p4.loadingElementId){$5=$get($p4.loadingElementId);}var $6=new Sys.Mvc.AjaxContext($3,$4,$5,$p4.insertionMode);var $7=true;if($p4.onBegin){$7=$p4.onBegin($6)!==false;}if($5){Sys.UI.DomElement.setVisible($6.get_loadingElement(),true);}if($7){$3.add_completed(Function.createDelegate(null,function($p1_0){ 16 | Sys.Mvc.MvcHelpers.$3($3,$p4,$6);}));$3.invoke();}} 17 | Sys.Mvc.MvcHelpers.$3=function($p0,$p1,$p2){$p2.set_response($p0.get_executor());if($p1.onComplete&&$p1.onComplete($p2)===false){return;}var $0=$p2.get_response().get_statusCode();if(($0>=200&&$0<300)||$0===304||$0===1223){if($0!==204&&$0!==304&&$0!==1223){var $1=$p2.get_response().getResponseHeader('Content-Type');if(($1)&&($1.indexOf('application/x-javascript')!==-1)){eval($p2.get_data());}else{Sys.Mvc.MvcHelpers.updateDomElement($p2.get_updateTarget(),$p2.get_insertionMode(),$p2.get_data());}}if($p1.onSuccess){$p1.onSuccess($p2);}}else{if($p1.onFailure){$p1.onFailure($p2);}}if($p2.get_loadingElement()){Sys.UI.DomElement.setVisible($p2.get_loadingElement(),false);}} 18 | Sys.Mvc.MvcHelpers.updateDomElement=function(target,insertionMode,content){if(target){switch(insertionMode){case 0:target.innerHTML=content;break;case 1:if(content&&content.length>0){target.innerHTML=content+target.innerHTML.trimStart();}break;case 2:if(content&&content.length>0){target.innerHTML=target.innerHTML.trimEnd()+content;}break;}}} 19 | Sys.Mvc.AsyncForm=function(){} 20 | Sys.Mvc.AsyncForm.handleClick=function(form,evt){var $0=Sys.Mvc.MvcHelpers.$0(evt.target,evt.offsetX,evt.offsetY);form._additionalInput = $0;} 21 | Sys.Mvc.AsyncForm.handleSubmit=function(form,evt,ajaxOptions){evt.preventDefault();var $0=form.validationCallbacks;if($0){for(var $2=0;$2<$0.length;$2++){var $3=$0[$2];if(!$3()){return;}}}var $1=Sys.Mvc.MvcHelpers.$1(form);Sys.Mvc.MvcHelpers.$2(form.action,form.method||'post',$1,form,ajaxOptions);} 22 | Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm'); 23 | // ---- Do not remove this footer ---- 24 | // Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) 25 | // ----------------------------------- 26 | -------------------------------------------------------------------------------- /Approval.Web.old/Scripts/MicrosoftMvcValidation.js: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------- 2 | // Copyright (C) Microsoft Corporation. All rights reserved. 3 | //---------------------------------------------------------- 4 | // MicrosoftMvcValidation.js 5 | 6 | Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_Validation=function(){return {};} 7 | Sys.Mvc.$create_JsonValidationField=function(){return {};} 8 | Sys.Mvc.$create_JsonValidationOptions=function(){return {};} 9 | Sys.Mvc.$create_JsonValidationRule=function(){return {};} 10 | Sys.Mvc.$create_ValidationContext=function(){return {};} 11 | Sys.Mvc.NumberValidator=function(){} 12 | Sys.Mvc.NumberValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.NumberValidator(),new Sys.Mvc.NumberValidator().validate);} 13 | Sys.Mvc.NumberValidator.prototype={validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0));}} 14 | Sys.Mvc.FormContext=function(formElement,validationSummaryElement){this.$5=[];this.fields=new Array(0);this.$9=formElement;this.$7=validationSummaryElement;formElement['__MVC_FormValidation'] = this;if(validationSummaryElement){var $0=validationSummaryElement.getElementsByTagName('ul');if($0.length>0){this.$8=$0[0];}}this.$3=Function.createDelegate(this,this.$D);this.$4=Function.createDelegate(this,this.$E);} 15 | Sys.Mvc.FormContext._Application_Load=function(){var $0=window.mvcClientValidationMetadata;if($0){while($0.length>0){var $1=$0.pop();Sys.Mvc.FormContext.$12($1);}}} 16 | Sys.Mvc.FormContext.$F=function($p0,$p1){var $0=[];var $1=document.getElementsByName($p1);for(var $2=0;$2<$1.length;$2++){var $3=$1[$2];if(Sys.Mvc.FormContext.$10($p0,$3)){Array.add($0,$3);}}return $0;} 17 | Sys.Mvc.FormContext.getValidationForForm=function(formElement){return formElement['__MVC_FormValidation'];} 18 | Sys.Mvc.FormContext.$10=function($p0,$p1){while($p1){if($p0===$p1){return true;}$p1=$p1.parentNode;}return false;} 19 | Sys.Mvc.FormContext.$12=function($p0){var $0=$get($p0.FormId);var $1=(!Sys.Mvc._ValidationUtil.$1($p0.ValidationSummaryId))?$get($p0.ValidationSummaryId):null;var $2=new Sys.Mvc.FormContext($0,$1);$2.enableDynamicValidation();$2.replaceValidationSummary=$p0.ReplaceValidationSummary;for(var $4=0;$4<$p0.Fields.length;$4++){var $5=$p0.Fields[$4];var $6=Sys.Mvc.FormContext.$F($0,$5.FieldName);var $7=(!Sys.Mvc._ValidationUtil.$1($5.ValidationMessageId))?$get($5.ValidationMessageId):null;var $8=new Sys.Mvc.FieldContext($2);Array.addRange($8.elements,$6);$8.validationMessageElement=$7;$8.replaceValidationMessageContents=$5.ReplaceValidationMessageContents;for(var $9=0;$9<$5.ValidationRules.length;$9++){var $A=$5.ValidationRules[$9];var $B=Sys.Mvc.ValidatorRegistry.getValidator($A);if($B){var $C=Sys.Mvc.$create_Validation();$C.fieldErrorMessage=$A.ErrorMessage;$C.validator=$B;Array.add($8.validations,$C);}}$8.enableDynamicValidation();Array.add($2.fields,$8);}var $3=$0.validationCallbacks;if(!$3){$3=[];$0.validationCallbacks = $3;}$3.push(Function.createDelegate(null,function(){ 20 | return Sys.Mvc._ValidationUtil.$0($2.validate('submit'));}));return $2;} 21 | Sys.Mvc.FormContext.prototype={$3:null,$4:null,$6:null,$7:null,$8:null,$9:null,replaceValidationSummary:false,addError:function(message){this.addErrors([message]);},addErrors:function(messages){if(!Sys.Mvc._ValidationUtil.$0(messages)){Array.addRange(this.$5,messages);this.$11();}},clearErrors:function(){Array.clear(this.$5);this.$11();},$A:function(){if(this.$7){if(this.$8){Sys.Mvc._ValidationUtil.$3(this.$8);for(var $0=0;$0=8){Sys.UI.DomEvent.addHandler($2,'propertychange',this.$9);}}else{Sys.UI.DomEvent.addHandler($2,'input',this.$8);}Sys.UI.DomEvent.addHandler($2,'change',this.$7);Sys.UI.DomEvent.addHandler($2,'blur',this.$6);}},$11:function($p0,$p1){var $0=$p1||this.defaultErrorMessage;if(Boolean.isInstanceOfType($p0)){return ($p0)?null:$0;}if(String.isInstanceOfType($p0)){return (($p0).length)?$p0:$0;}return null;},$12:function(){var $0=this.elements;return ($0.length>0)?$0[0].value:null;},$13:function(){var $0=this.elements;for(var $1=0;$1<$0.length;$1++){var $2=$0[$1];$2['__MVC_HasValidationFired'] = true;}},$14:function(){if(!this.$A.length){this.$C();}else{this.$B();}},validate:function(eventName){var $0=this.validations;var $1=[];var $2=this.$12();for(var $3=0;$3<$0.length;$3++){var $4=$0[$3];var $5=Sys.Mvc.$create_ValidationContext();$5.eventName=eventName;$5.fieldContext=this;$5.validation=$4;var $6=$4.validator($2,$5);var $7=this.$11($6,$4.fieldErrorMessage);if(!Sys.Mvc._ValidationUtil.$1($7)){Array.add($1,$7);}}this.$13();this.clearErrors();this.addErrors($1);return $1;}} 24 | Sys.Mvc.RangeValidator=function(minimum,maximum){this.$0=minimum;this.$1=maximum;} 25 | Sys.Mvc.RangeValidator.create=function(rule){var $0=rule.ValidationParameters['minimum'];var $1=rule.ValidationParameters['maximum'];return Function.createDelegate(new Sys.Mvc.RangeValidator($0,$1),new Sys.Mvc.RangeValidator($0,$1).validate);} 26 | Sys.Mvc.RangeValidator.prototype={$0:null,$1:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0)&&this.$0<=$0&&$0<=this.$1);}} 27 | Sys.Mvc.RegularExpressionValidator=function(pattern){this.$0=pattern;} 28 | Sys.Mvc.RegularExpressionValidator.create=function(rule){var $0=rule.ValidationParameters['pattern'];return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator($0),new Sys.Mvc.RegularExpressionValidator($0).validate);} 29 | Sys.Mvc.RegularExpressionValidator.prototype={$0:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=new RegExp(this.$0);var $1=$0.exec(value);return (!Sys.Mvc._ValidationUtil.$0($1)&&$1[0].length===value.length);}} 30 | Sys.Mvc.RequiredValidator=function(){} 31 | Sys.Mvc.RequiredValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.RequiredValidator(),new Sys.Mvc.RequiredValidator().validate);} 32 | Sys.Mvc.RequiredValidator.$0=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();if($0==='RADIO'){return true;}}return false;} 33 | Sys.Mvc.RequiredValidator.$1=function($p0){if($p0.tagName.toUpperCase()==='SELECT'){return true;}return false;} 34 | Sys.Mvc.RequiredValidator.$2=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();switch($0){case 'TEXT':case 'PASSWORD':case 'FILE':return true;}}if($p0.tagName.toUpperCase()==='TEXTAREA'){return true;}return false;} 35 | Sys.Mvc.RequiredValidator.$3=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.checked){return true;}}return false;} 36 | Sys.Mvc.RequiredValidator.$4=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.selected){if(!Sys.Mvc._ValidationUtil.$1($1.value)){return true;}}}return false;} 37 | Sys.Mvc.RequiredValidator.$5=function($p0){return (!Sys.Mvc._ValidationUtil.$1($p0.value));} 38 | Sys.Mvc.RequiredValidator.prototype={validate:function(value,context){var $0=context.fieldContext.elements;if(!$0.length){return true;}var $1=$0[0];if(Sys.Mvc.RequiredValidator.$2($1)){return Sys.Mvc.RequiredValidator.$5($1);}if(Sys.Mvc.RequiredValidator.$0($1)){return Sys.Mvc.RequiredValidator.$3($0);}if(Sys.Mvc.RequiredValidator.$1($1)){return Sys.Mvc.RequiredValidator.$4(($1).options);}return true;}} 39 | Sys.Mvc.StringLengthValidator=function(minLength,maxLength){this.$1=minLength;this.$0=maxLength;} 40 | Sys.Mvc.StringLengthValidator.create=function(rule){var $0=rule.ValidationParameters['minimumLength'];var $1=rule.ValidationParameters['maximumLength'];return Function.createDelegate(new Sys.Mvc.StringLengthValidator($0,$1),new Sys.Mvc.StringLengthValidator($0,$1).validate);} 41 | Sys.Mvc.StringLengthValidator.prototype={$0:0,$1:0,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}return (this.$1<=value.length&&value.length<=this.$0);}} 42 | Sys.Mvc._ValidationUtil=function(){} 43 | Sys.Mvc._ValidationUtil.$0=function($p0){return (!$p0||!$p0.length);} 44 | Sys.Mvc._ValidationUtil.$1=function($p0){return (!$p0||!$p0.length);} 45 | Sys.Mvc._ValidationUtil.$2=function($p0,$p1){return ($p1 in $p0);} 46 | Sys.Mvc._ValidationUtil.$3=function($p0){while($p0.firstChild){$p0.removeChild($p0.firstChild);}} 47 | Sys.Mvc._ValidationUtil.$4=function($p0,$p1){var $0=document.createTextNode($p1);Sys.Mvc._ValidationUtil.$3($p0);$p0.appendChild($0);} 48 | Sys.Mvc.ValidatorRegistry=function(){} 49 | Sys.Mvc.ValidatorRegistry.getValidator=function(rule){var $0=Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType];return ($0)?$0(rule):null;} 50 | Sys.Mvc.ValidatorRegistry.$0=function(){return {required:Function.createDelegate(null,Sys.Mvc.RequiredValidator.create),stringLength:Function.createDelegate(null,Sys.Mvc.StringLengthValidator.create),regularExpression:Function.createDelegate(null,Sys.Mvc.RegularExpressionValidator.create),range:Function.createDelegate(null,Sys.Mvc.RangeValidator.create),number:Function.createDelegate(null,Sys.Mvc.NumberValidator.create)};} 51 | Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator');Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext');Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext');Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator');Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator');Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator');Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator');Sys.Mvc._ValidationUtil.registerClass('Sys.Mvc._ValidationUtil');Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry');Sys.Mvc.ValidatorRegistry.validators=Sys.Mvc.ValidatorRegistry.$0(); 52 | // ---- Do not remove this footer ---- 53 | // Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) 54 | // ----------------------------------- 55 | Sys.Application.add_load(function(){Sys.Application.remove_load(arguments.callee);Sys.Mvc.FormContext._Application_Load();}); -------------------------------------------------------------------------------- /Approval.Web.old/Service References/ApprovalWorkflowService/Reference.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Approval.Web.ApprovalWorkflowService { 12 | 13 | 14 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 15 | [System.ServiceModel.ServiceContractAttribute(ConfigurationName="ApprovalWorkflowService.IService")] 16 | public interface IService { 17 | 18 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/BeginApprovalProcess", ReplyAction="http://tempuri.org/IService/BeginApprovalProcessResponse")] 19 | void BeginApprovalProcess(string[] approverEmails, string messageToApprove, string yourEmail); 20 | 21 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Approve", ReplyAction="http://tempuri.org/IService/ApproveResponse")] 22 | void Approve(string approverId); 23 | 24 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Decline", ReplyAction="http://tempuri.org/IService/DeclineResponse")] 25 | void Decline(string approverId); 26 | } 27 | 28 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 29 | public interface IServiceChannel : Approval.Web.ApprovalWorkflowService.IService, System.ServiceModel.IClientChannel { 30 | } 31 | 32 | [System.Diagnostics.DebuggerStepThroughAttribute()] 33 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 34 | public partial class ServiceClient : System.ServiceModel.ClientBase, Approval.Web.ApprovalWorkflowService.IService { 35 | 36 | public ServiceClient() { 37 | } 38 | 39 | public ServiceClient(string endpointConfigurationName) : 40 | base(endpointConfigurationName) { 41 | } 42 | 43 | public ServiceClient(string endpointConfigurationName, string remoteAddress) : 44 | base(endpointConfigurationName, remoteAddress) { 45 | } 46 | 47 | public ServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 48 | base(endpointConfigurationName, remoteAddress) { 49 | } 50 | 51 | public ServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 52 | base(binding, remoteAddress) { 53 | } 54 | 55 | public void BeginApprovalProcess(string[] approverEmails, string messageToApprove, string yourEmail) { 56 | base.Channel.BeginApprovalProcess(approverEmails, messageToApprove, yourEmail); 57 | } 58 | 59 | public void Approve(string approverId) { 60 | base.Channel.Approve(approverId); 61 | } 62 | 63 | public void Decline(string approverId) { 64 | base.Channel.Decline(approverId); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Approval.Web.old/Service References/ApprovalWorkflowService/Reference.svcmap: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | true 6 | 7 | false 8 | false 9 | false 10 | 11 | 12 | true 13 | Auto 14 | true 15 | true 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Approval.Web.old/Service References/ApprovalWorkflowService/Workflow.disco: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Approval.Web.old/Service References/ApprovalWorkflowService/Workflow.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | EncryptAndSign 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | net.pipe://petehomedesktop/TechEdNZ/ApprovalWorkflow/Workflow.xamlx 140 | 141 | host/PeteHomeDesktop 142 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /Approval.Web.old/Service References/ApprovalWorkflowService/Workflow.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Approval.Web.old/Service References/ApprovalWorkflowService/Workflow1.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Approval.Web.old/Service References/ApprovalWorkflowService/Workflow2.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Approval.Web.old/Service References/ApprovalWorkflowService/configuration.svcinfo: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Approval.Web.old/Views/Approval/Approve.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 | 3 | 4 | Approve 5 | 6 | 7 | 8 | 9 |

Approve

10 |

Thank you, you have selected to approve the message task

11 |
12 | -------------------------------------------------------------------------------- /Approval.Web.old/Views/Approval/Decline.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 | 3 | 4 | Decline 5 | 6 | 7 | 8 | 9 |

Decline

10 |

Thank you, you have selected to decline the message task

11 |
12 | -------------------------------------------------------------------------------- /Approval.Web.old/Views/Home/About.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 | 3 | 4 | About Us 5 | 6 | 7 | 8 |

About

9 |

10 | Put content here. 11 |

12 |
13 | -------------------------------------------------------------------------------- /Approval.Web.old/Views/Home/Index.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 | 3 | 4 | Home Page 5 | 6 | 7 | 8 |

<%: ViewData["Message"] %>

9 |

10 | To learn more about ASP.NET MVC visit http://asp.net/mvc. 11 |

12 |
13 | -------------------------------------------------------------------------------- /Approval.Web.old/Views/Shared/Error.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 | 3 | 4 | Error 5 | 6 | 7 | 8 |

9 | Sorry, an error occurred while processing your request. 10 |

11 |
12 | -------------------------------------------------------------------------------- /Approval.Web.old/Views/Shared/Site.Master: -------------------------------------------------------------------------------- 1 | <%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %> 2 | 3 | 4 | 5 | 6 | <asp:ContentPlaceHolder ID="TitleContent" runat="server" /> 7 | 8 | 9 | 10 | 11 |
12 | 13 | 19 | 20 |
21 | 22 | 23 | 25 |
26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /Approval.Web.old/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Approval.Web.old/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Approval.Web.old/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /Approval.Web.old/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 86 | 88 | 89 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /Approval.Web/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace Approval.Web 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Approval.Web/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Approval.Web 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Approval.Web/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web.Http; 5 | 6 | namespace Approval.Web 7 | { 8 | public static class WebApiConfig 9 | { 10 | public static void Register(HttpConfiguration config) 11 | { 12 | config.Routes.MapHttpRoute( 13 | name: "DefaultApi", 14 | routeTemplate: "api/{controller}/{id}", 15 | defaults: new { id = RouteParameter.Optional } 16 | ); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Approval.Web/Approval.Web.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 8 | 9 | 2.0 10 | {7F898646-16DB-4715-92F5-D7AACB1BCDE8} 11 | {E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 12 | Library 13 | Properties 14 | Approval.Web 15 | Approval.Web 16 | v4.5 17 | false 18 | true 19 | 20 | 21 | 22 | 23 | 24 | 25 | true 26 | full 27 | false 28 | bin\ 29 | DEBUG;TRACE 30 | prompt 31 | 4 32 | 33 | 34 | pdbonly 35 | true 36 | bin\ 37 | TRACE 38 | prompt 39 | 4 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | True 65 | ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll 66 | 67 | 68 | True 69 | ..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.0\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll 70 | 71 | 72 | ..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll 73 | 74 | 75 | 76 | 77 | ..\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll 78 | 79 | 80 | 81 | 82 | True 83 | ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll 84 | 85 | 86 | ..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll 87 | 88 | 89 | ..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.20710.0\lib\net40\System.Web.Http.WebHost.dll 90 | 91 | 92 | True 93 | ..\packages\Microsoft.AspNet.Mvc.4.0.20710.0\lib\net40\System.Web.Mvc.dll 94 | 95 | 96 | True 97 | ..\packages\Microsoft.AspNet.Razor.2.0.20715.0\lib\net40\System.Web.Razor.dll 98 | 99 | 100 | True 101 | ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll 102 | 103 | 104 | True 105 | ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll 106 | 107 | 108 | True 109 | ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll 110 | 111 | 112 | 113 | 114 | 115 | 116 | Global.asax 117 | 118 | 119 | 120 | True 121 | True 122 | Reference.svcmap 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | WCF Proxy Generator 135 | Reference.cs 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | Web.config 145 | 146 | 147 | Web.config 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | Designer 171 | 172 | 173 | Designer 174 | 175 | 176 | Designer 177 | 178 | 179 | 180 | 10.0 181 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | False 194 | False 195 | 51959 196 | / 197 | http://localhost:51959/ 198 | False 199 | False 200 | 201 | 202 | False 203 | 204 | 205 | 206 | 207 | 213 | -------------------------------------------------------------------------------- /Approval.Web/Controllers/ApprovalController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace Approval.Web.Controllers { 8 | public class ApprovalController : Controller { 9 | 10 | public ActionResult Approve(string id) { 11 | var serviceClient = new ApprovalWorkflowService.ServiceClient(); 12 | serviceClient.Approve(id); 13 | return View(); 14 | } 15 | 16 | public ActionResult Decline(string id) { 17 | var serviceClient = new ApprovalWorkflowService.ServiceClient(); 18 | serviceClient.Decline(id); 19 | return View(); 20 | } 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Approval.Web/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace Approval.Web.Controllers { 8 | [HandleError] 9 | public class HomeController : Controller { 10 | public ActionResult Index() { 11 | ViewData["Message"] = "Welcome to ASP.NET MVC!"; 12 | 13 | return View(); 14 | } 15 | 16 | public ActionResult About() { 17 | return View(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Approval.Web/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Approval.Web.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Approval.Web/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Mvc; 7 | using System.Web.Routing; 8 | 9 | namespace Approval.Web 10 | { 11 | // Note: For instructions on enabling IIS6 or IIS7 classic mode, 12 | // visit http://go.microsoft.com/?LinkId=9394801 13 | public class MvcApplication : System.Web.HttpApplication 14 | { 15 | protected void Application_Start() 16 | { 17 | AreaRegistration.RegisterAllAreas(); 18 | 19 | WebApiConfig.Register(GlobalConfiguration.Configuration); 20 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 21 | RouteConfig.RegisterRoutes(RouteTable.Routes); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Approval.Web/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("Approval.Web")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Approval.Web")] 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("1ca69ddc-af37-4a23-8bc6-135cf6190708")] 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 | -------------------------------------------------------------------------------- /Approval.Web/Service References/ApprovalWorkflowService/Reference.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.33440 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Approval.Web.ApprovalWorkflowService { 12 | 13 | 14 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 15 | [System.ServiceModel.ServiceContractAttribute(ConfigurationName="ApprovalWorkflowService.IService")] 16 | public interface IService { 17 | 18 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/BeginApprovalProcess", ReplyAction="http://tempuri.org/IService/BeginApprovalProcessResponse")] 19 | void BeginApprovalProcess(string[] approverEmails, string messageToApprove, string yourEmail); 20 | 21 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/BeginApprovalProcess", ReplyAction="http://tempuri.org/IService/BeginApprovalProcessResponse")] 22 | System.Threading.Tasks.Task BeginApprovalProcessAsync(string[] approverEmails, string messageToApprove, string yourEmail); 23 | 24 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Approve", ReplyAction="http://tempuri.org/IService/ApproveResponse")] 25 | void Approve(string approverId); 26 | 27 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Approve", ReplyAction="http://tempuri.org/IService/ApproveResponse")] 28 | System.Threading.Tasks.Task ApproveAsync(string approverId); 29 | 30 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Decline", ReplyAction="http://tempuri.org/IService/DeclineResponse")] 31 | void Decline(string approverId); 32 | 33 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Decline", ReplyAction="http://tempuri.org/IService/DeclineResponse")] 34 | System.Threading.Tasks.Task DeclineAsync(string approverId); 35 | } 36 | 37 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 38 | public interface IServiceChannel : Approval.Web.ApprovalWorkflowService.IService, System.ServiceModel.IClientChannel { 39 | } 40 | 41 | [System.Diagnostics.DebuggerStepThroughAttribute()] 42 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 43 | public partial class ServiceClient : System.ServiceModel.ClientBase, Approval.Web.ApprovalWorkflowService.IService { 44 | 45 | public ServiceClient() { 46 | } 47 | 48 | public ServiceClient(string endpointConfigurationName) : 49 | base(endpointConfigurationName) { 50 | } 51 | 52 | public ServiceClient(string endpointConfigurationName, string remoteAddress) : 53 | base(endpointConfigurationName, remoteAddress) { 54 | } 55 | 56 | public ServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 57 | base(endpointConfigurationName, remoteAddress) { 58 | } 59 | 60 | public ServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 61 | base(binding, remoteAddress) { 62 | } 63 | 64 | public void BeginApprovalProcess(string[] approverEmails, string messageToApprove, string yourEmail) { 65 | base.Channel.BeginApprovalProcess(approverEmails, messageToApprove, yourEmail); 66 | } 67 | 68 | public System.Threading.Tasks.Task BeginApprovalProcessAsync(string[] approverEmails, string messageToApprove, string yourEmail) { 69 | return base.Channel.BeginApprovalProcessAsync(approverEmails, messageToApprove, yourEmail); 70 | } 71 | 72 | public void Approve(string approverId) { 73 | base.Channel.Approve(approverId); 74 | } 75 | 76 | public System.Threading.Tasks.Task ApproveAsync(string approverId) { 77 | return base.Channel.ApproveAsync(approverId); 78 | } 79 | 80 | public void Decline(string approverId) { 81 | base.Channel.Decline(approverId); 82 | } 83 | 84 | public System.Threading.Tasks.Task DeclineAsync(string approverId) { 85 | return base.Channel.DeclineAsync(approverId); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Approval.Web/Service References/ApprovalWorkflowService/Reference.svcmap: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | true 6 | true 7 | 8 | false 9 | false 10 | false 11 | 12 | 13 | true 14 | Auto 15 | true 16 | true 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Approval.Web/Service References/ApprovalWorkflowService/Workflow.disco: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Approval.Web/Service References/ApprovalWorkflowService/Workflow.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Approval.Web/Service References/ApprovalWorkflowService/Workflow.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Approval.Web/Service References/ApprovalWorkflowService/Workflow1.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Approval.Web/Service References/ApprovalWorkflowService/Workflow2.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Approval.Web/Service References/ApprovalWorkflowService/configuration.svcinfo: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Approval.Web/Service References/ApprovalWorkflowService/configuration91.svcinfo: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | BasicHttpBinding_IService 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | StrongWildcard 29 | 30 | 31 | 32 | 33 | 34 | 65536 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement 44 | 45 | 46 | 0 47 | 48 | 49 | 0 50 | 51 | 52 | 0 53 | 54 | 55 | 0 56 | 57 | 58 | 0 59 | 60 | 61 | System.Text.UTF8Encoding 62 | 63 | 64 | Buffered 65 | 66 | 67 | 68 | 69 | 70 | Text 71 | 72 | 73 | System.ServiceModel.Configuration.BasicHttpSecurityElement 74 | 75 | 76 | None 77 | 78 | 79 | System.ServiceModel.Configuration.HttpTransportSecurityElement 80 | 81 | 82 | None 83 | 84 | 85 | None 86 | 87 | 88 | System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement 89 | 90 | 91 | Never 92 | 93 | 94 | TransportSelected 95 | 96 | 97 | (Collection) 98 | 99 | 100 | 101 | 102 | 103 | System.ServiceModel.Configuration.BasicHttpMessageSecurityElement 104 | 105 | 106 | UserName 107 | 108 | 109 | Default 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | http://localhost:1708/Workflow.xamlx 119 | 120 | 121 | 122 | 123 | 124 | basicHttpBinding 125 | 126 | 127 | BasicHttpBinding_IService 128 | 129 | 130 | ApprovalWorkflowService.IService 131 | 132 | 133 | System.ServiceModel.Configuration.AddressHeaderCollectionElement 134 | 135 | 136 | <Header /> 137 | 138 | 139 | System.ServiceModel.Configuration.IdentityElement 140 | 141 | 142 | System.ServiceModel.Configuration.UserPrincipalNameElement 143 | 144 | 145 | 146 | 147 | 148 | System.ServiceModel.Configuration.ServicePrincipalNameElement 149 | 150 | 151 | 152 | 153 | 154 | System.ServiceModel.Configuration.DnsElement 155 | 156 | 157 | 158 | 159 | 160 | System.ServiceModel.Configuration.RsaElement 161 | 162 | 163 | 164 | 165 | 166 | System.ServiceModel.Configuration.CertificateElement 167 | 168 | 169 | 170 | 171 | 172 | System.ServiceModel.Configuration.CertificateReferenceElement 173 | 174 | 175 | My 176 | 177 | 178 | LocalMachine 179 | 180 | 181 | FindBySubjectDistinguishedName 182 | 183 | 184 | 185 | 186 | 187 | False 188 | 189 | 190 | BasicHttpBinding_IService 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /Approval.Web/Views/Approval/Approve.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 | 3 | 4 | Approve 5 | 6 | 7 | 8 | 9 |

Approve

10 |

Thank you, you have selected to approve the message task

11 |
12 | -------------------------------------------------------------------------------- /Approval.Web/Views/Approval/Decline.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 | 3 | 4 | Decline 5 | 6 | 7 | 8 | 9 |

Decline

10 |

Thank you, you have selected to decline the message task

11 |
12 | -------------------------------------------------------------------------------- /Approval.Web/Views/Home/About.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 | 3 | 4 | About Us 5 | 6 | 7 | 8 |

About

9 |

10 | Put content here. 11 |

12 |
13 | -------------------------------------------------------------------------------- /Approval.Web/Views/Home/Index.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 | 3 | 4 | Home Page 5 | 6 | 7 | 8 |

<%: ViewData["Message"] %>

9 |

10 | To learn more about ASP.NET MVC visit http://asp.net/mvc. 11 |

12 |
13 | -------------------------------------------------------------------------------- /Approval.Web/Views/Shared/Error.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 | 3 | 4 | Error 5 | 6 | 7 | 8 |

9 | Sorry, an error occurred while processing your request. 10 |

11 |
12 | -------------------------------------------------------------------------------- /Approval.Web/Views/Shared/Site.Master: -------------------------------------------------------------------------------- 1 | <%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %> 2 | 3 | 4 | 5 | 6 | <asp:ContentPlaceHolder ID="TitleContent" runat="server" /> 7 | 8 | 9 | 10 | 11 |
12 | 13 | 19 | 20 |
21 | 22 | 23 | 25 |
26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /Approval.Web/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Approval.Web/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Approval.Web/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /Approval.Web/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /Approval.Web/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ApprovalSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApproverClient", "ApproverClient\ApproverClient.csproj", "{0A67E55C-F5BD-4E2A-A857-13935EC0C08A}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012} = {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012} 7 | EndProjectSection 8 | EndProject 9 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApprovalWorkflow", "ApprovalWorkflow\ApprovalWorkflow.csproj", "{FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012}" 10 | EndProject 11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Approval.Web", "Approval.Web\Approval.Web.csproj", "{7F898646-16DB-4715-92F5-D7AACB1BCDE8}" 12 | ProjectSection(ProjectDependencies) = postProject 13 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012} = {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012} 14 | EndProjectSection 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Debug|Mixed Platforms = Debug|Mixed Platforms 20 | Debug|x86 = Debug|x86 21 | Release|Any CPU = Release|Any CPU 22 | Release|Mixed Platforms = Release|Mixed Platforms 23 | Release|x86 = Release|x86 24 | EndGlobalSection 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 26 | {0A67E55C-F5BD-4E2A-A857-13935EC0C08A}.Debug|Any CPU.ActiveCfg = Debug|x86 27 | {0A67E55C-F5BD-4E2A-A857-13935EC0C08A}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 28 | {0A67E55C-F5BD-4E2A-A857-13935EC0C08A}.Debug|Mixed Platforms.Build.0 = Debug|x86 29 | {0A67E55C-F5BD-4E2A-A857-13935EC0C08A}.Debug|x86.ActiveCfg = Debug|x86 30 | {0A67E55C-F5BD-4E2A-A857-13935EC0C08A}.Debug|x86.Build.0 = Debug|x86 31 | {0A67E55C-F5BD-4E2A-A857-13935EC0C08A}.Release|Any CPU.ActiveCfg = Release|x86 32 | {0A67E55C-F5BD-4E2A-A857-13935EC0C08A}.Release|Mixed Platforms.ActiveCfg = Release|x86 33 | {0A67E55C-F5BD-4E2A-A857-13935EC0C08A}.Release|Mixed Platforms.Build.0 = Release|x86 34 | {0A67E55C-F5BD-4E2A-A857-13935EC0C08A}.Release|x86.ActiveCfg = Release|x86 35 | {0A67E55C-F5BD-4E2A-A857-13935EC0C08A}.Release|x86.Build.0 = Release|x86 36 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 39 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 40 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012}.Debug|x86.ActiveCfg = Debug|Any CPU 41 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012}.Release|Any CPU.ActiveCfg = Release|Any CPU 42 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012}.Release|Any CPU.Build.0 = Release|Any CPU 43 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 44 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012}.Release|Mixed Platforms.Build.0 = Release|Any CPU 45 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012}.Release|x86.ActiveCfg = Release|Any CPU 46 | {7F898646-16DB-4715-92F5-D7AACB1BCDE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {7F898646-16DB-4715-92F5-D7AACB1BCDE8}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {7F898646-16DB-4715-92F5-D7AACB1BCDE8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 49 | {7F898646-16DB-4715-92F5-D7AACB1BCDE8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 50 | {7F898646-16DB-4715-92F5-D7AACB1BCDE8}.Debug|x86.ActiveCfg = Debug|Any CPU 51 | {7F898646-16DB-4715-92F5-D7AACB1BCDE8}.Release|Any CPU.ActiveCfg = Release|Any CPU 52 | {7F898646-16DB-4715-92F5-D7AACB1BCDE8}.Release|Any CPU.Build.0 = Release|Any CPU 53 | {7F898646-16DB-4715-92F5-D7AACB1BCDE8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 54 | {7F898646-16DB-4715-92F5-D7AACB1BCDE8}.Release|Mixed Platforms.Build.0 = Release|Any CPU 55 | {7F898646-16DB-4715-92F5-D7AACB1BCDE8}.Release|x86.ActiveCfg = Release|Any CPU 56 | EndGlobalSection 57 | GlobalSection(SolutionProperties) = preSolution 58 | HideSolutionNode = FALSE 59 | EndGlobalSection 60 | EndGlobal 61 | -------------------------------------------------------------------------------- /ApprovalSample.sln.ide/graph/ApprovalSample.sln.ide: -------------------------------------------------------------------------------- 1 |  2 | 0001-01-01T00:00:00Z 3 | -------------------------------------------------------------------------------- /ApprovalWorkflow/ApprovalWorkflow.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 10.0 8 | 2.0 9 | {FD5BD0B7-79DE-47FF-B7DD-0CD40C18B012} 10 | {32f31d43-81cc-4c15-9de6-3fc5453562b6};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 11 | Library 12 | Properties 13 | ApprovalWorkflow 14 | ApprovalWorkflow 15 | v4.0 16 | 17 | 18 | 19 | 20 | 4.0 21 | true 22 | 23 | 24 | 25 | 26 | 27 | 28 | true 29 | full 30 | false 31 | bin\ 32 | DEBUG;TRACE 33 | prompt 34 | 4 35 | 36 | 37 | pdbonly 38 | true 39 | bin\ 40 | TRACE 41 | prompt 42 | 4 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | Designer 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | Designer 78 | MSBuild:Compile 79 | 80 | 81 | 82 | 10.0 83 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | False 93 | False 94 | 1708 95 | / 96 | http://localhost:1708/ 97 | False 98 | False 99 | 100 | 101 | False 102 | 103 | 104 | 105 | 106 | 113 | -------------------------------------------------------------------------------- /ApprovalWorkflow/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("ApprovalSample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("ApprovalSample")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 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("b1a46949-a3c5-4829-8a0f-10919d519b01")] 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 | -------------------------------------------------------------------------------- /ApprovalWorkflow/SendEmail.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Activities; 3 | using System.Configuration; 4 | using System.Diagnostics; 5 | using System.Net; 6 | using System.Net.Mail; 7 | using System.Threading; 8 | 9 | namespace ApprovalWorkflow { 10 | public class SendEmail : AsyncCodeActivity { 11 | 12 | [RequiredArgument] 13 | public InArgument ToAddress { get; set;} 14 | 15 | [RequiredArgument] 16 | public InArgument FromAddress { get; set; } 17 | 18 | [RequiredArgument] 19 | public InArgument Subject { get; set; } 20 | 21 | [RequiredArgument] 22 | public InArgument Body { get; set; } 23 | 24 | protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state) { 25 | MailMessage mail = new MailMessage(); 26 | mail.To.Add(ToAddress.Get(context)); 27 | 28 | mail.From = new MailAddress(FromAddress.Get(context)); 29 | 30 | mail.Subject = Subject.Get(context); 31 | 32 | 33 | mail.Body = Body.Get(context); 34 | 35 | mail.IsBodyHtml = true; 36 | SmtpClient smtp = new SmtpClient() ; 37 | 38 | Action action = () => { 39 | ManualResetEvent manualResetEvent = new ManualResetEvent(false); 40 | smtp.SendCompleted += (o, args) => { 41 | manualResetEvent.Set(); 42 | Debug.WriteLine("Send Mail Completed"); 43 | }; 44 | smtp.SendAsync(mail, null); 45 | manualResetEvent.WaitOne(TimeSpan.FromSeconds(30)); 46 | }; 47 | 48 | context.UserState = action; 49 | 50 | return action.BeginInvoke(callback, state); 51 | } 52 | 53 | protected override void EndExecute(AsyncCodeActivityContext context, IAsyncResult result) { 54 | Action action = context.UserState as Action; 55 | action.EndInvoke(result); 56 | } 57 | 58 | 59 | } 60 | } -------------------------------------------------------------------------------- /ApprovalWorkflow/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /ApprovalWorkflow/Workflow.xamlx: -------------------------------------------------------------------------------- 1 |  28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | True 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | [approverEmails] 49 | [messageToApprove] 50 | [yourEmail] 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | True 69 | 70 | 71 | 72 | 73 | [approverId.ToString()] 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | True 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | http://tempuri.org/ 93 | 94 | sm:body()/xgSc:Approve/xgSc:approverId 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | [approvalCount] 111 | 112 | 113 | [approvalCount + 1] 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | True 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | http://tempuri.org/ 134 | 135 | sm:body()/xgSc:Decline/xgSc:approverId 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /ApproverClient/ApproverClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {0A67E55C-F5BD-4E2A-A857-13935EC0C08A} 9 | Exe 10 | Properties 11 | ApproverClient 12 | ApproverClient 13 | v4.0 14 | Client 15 | 512 16 | 17 | 18 | x86 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | x86 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | True 52 | True 53 | Reference.svcmap 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | Designer 64 | 65 | 66 | Designer 67 | 68 | 69 | Designer 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | WCF Proxy Generator 87 | Reference.cs 88 | 89 | 90 | 91 | 98 | -------------------------------------------------------------------------------- /ApproverClient/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ApproverClient { 4 | class Program { 5 | static void Main(string[] args) { 6 | var client = new ApprovalWorkflowService.ServiceClient(); 7 | client.BeginApprovalProcess(new[] { 8 | "approver1@foo.com", 9 | "approver2@foo.com", 10 | "approver3@foo.com" 11 | }, 12 | "Holiday approval for Joe Bloggs from 2nd December to 12th January?", 13 | "joe.bloggs@foo.com"); 14 | 15 | Console.ReadKey(false); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ApproverClient/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("ApproverClient")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("ApproverClient")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 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("9937bfea-f3fd-46f7-82e9-0abfd226bdbe")] 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 | -------------------------------------------------------------------------------- /ApproverClient/Service References/ApprovalWorkflowService/Reference.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ApproverClient.ApprovalWorkflowService { 12 | 13 | 14 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 15 | [System.ServiceModel.ServiceContractAttribute(ConfigurationName="ApprovalWorkflowService.IService")] 16 | public interface IService { 17 | 18 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/BeginApprovalProcess", ReplyAction="http://tempuri.org/IService/BeginApprovalProcessResponse")] 19 | void BeginApprovalProcess(string[] approverEmails, string messageToApprove, string yourEmail); 20 | 21 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Approve", ReplyAction="http://tempuri.org/IService/ApproveResponse")] 22 | void Approve(string approverId); 23 | 24 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Decline", ReplyAction="http://tempuri.org/IService/DeclineResponse")] 25 | void Decline(string approverId); 26 | } 27 | 28 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 29 | public interface IServiceChannel : ApproverClient.ApprovalWorkflowService.IService, System.ServiceModel.IClientChannel { 30 | } 31 | 32 | [System.Diagnostics.DebuggerStepThroughAttribute()] 33 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 34 | public partial class ServiceClient : System.ServiceModel.ClientBase, ApproverClient.ApprovalWorkflowService.IService { 35 | 36 | public ServiceClient() { 37 | } 38 | 39 | public ServiceClient(string endpointConfigurationName) : 40 | base(endpointConfigurationName) { 41 | } 42 | 43 | public ServiceClient(string endpointConfigurationName, string remoteAddress) : 44 | base(endpointConfigurationName, remoteAddress) { 45 | } 46 | 47 | public ServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 48 | base(endpointConfigurationName, remoteAddress) { 49 | } 50 | 51 | public ServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 52 | base(binding, remoteAddress) { 53 | } 54 | 55 | public void BeginApprovalProcess(string[] approverEmails, string messageToApprove, string yourEmail) { 56 | base.Channel.BeginApprovalProcess(approverEmails, messageToApprove, yourEmail); 57 | } 58 | 59 | public void Approve(string approverId) { 60 | base.Channel.Approve(approverId); 61 | } 62 | 63 | public void Decline(string approverId) { 64 | base.Channel.Decline(approverId); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /ApproverClient/Service References/ApprovalWorkflowService/Reference.svcmap: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | true 6 | 7 | false 8 | false 9 | false 10 | 11 | 12 | true 13 | Auto 14 | true 15 | true 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /ApproverClient/Service References/ApprovalWorkflowService/Service1.disco: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ApproverClient/Service References/ApprovalWorkflowService/Service1.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /ApproverClient/Service References/ApprovalWorkflowService/Service1.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ApproverClient/Service References/ApprovalWorkflowService/Service11.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ApproverClient/Service References/ApprovalWorkflowService/Service12.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ApproverClient/Service References/ApprovalWorkflowService/configuration.svcinfo: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ApproverClient/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 12 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2013 Peter Goodman 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Workflow Email Approval Sample 2 | 3 | This is the code from my blog post describing a [workflow based email approval app](http://blog.petegoo.com/index.php/2010/08/22/workflow-4-email-approval-sample/) 4 | 5 | ## Pre-requisites 6 | 1. Use a local SMTP / email server like [Papercut](http://papercut.codeplex.com/) so that you can send emails from the workflow and see them appear. 7 | 2. You will need to set all 3 projects to startup. Right-click the solution in VS, choose Set startup projects and make sure all 3 are set to start. 8 | 9 | ## Running the sample 10 | 1. Run the code. 11 | 2. Check your email app (Papercut). 12 | 3. You should see 3 emails, approve or decline as desired. 13 | 4. You should receive another email summarising the approval responses once they are all complete. 14 | 15 | ## Common Issues 16 | Check that you have the correct URLs in the code. Visual Studio may decide to use different ports. URLs are hard coded at the following locations 17 | 18 | * ApproverClient\app.config 19 | * ApprovalWorkflow\Workflow.xamlx (Send Approval Email activity) 20 | * Approval.Web\Web.config 21 | 22 | If you decide to push this into IIS rather than IIS Express, the above URLs will change. 23 | --------------------------------------------------------------------------------