L. Critonius Plebian Aedil of the Roman Republic from 86 BC to 86 BC.
L. Critonius was plebian aedil in 86 BC, and in that respect struck a joint issue with his colleague M. Fannius.

Gens Critonia was a plebeian family at Rome. It is known chiefly from a single individual, Lucius Critonius, who was one of the first aediles cerealis after the institution of that office by Caesar in 44 BC. Critonius had belonged to Caesar's party, but objected to having to pay in order to honour his memory during the Cerealia following Caesar's murder.
L. Critonius
Error executing template "QueryPublisher/Coins.cshtml"
System.IO.IOException: The process cannot access the file 'd:\dynamicweb.net\Solutions\Dynamicweb\cboll.net.dynamicweb-cms.com\Files\Templates\Designs\Blogtheme\json\AllEntitiesTest.json' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at CompiledRazorTemplates.Dynamic.RazorEngine_04b763cbf43d4054833840db80c4a1fc.Execute() in d:\dynamicweb.net\Solutions\Dynamicweb\cboll.net.dynamicweb-cms.com\Files\Templates\QueryPublisher\Coins.cshtml:line 70
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using System.Web 2 @using System.Net; 3 @using Newtonsoft.Json; 4 @using Newtonsoft.Json.Linq; 5 6 @functions { 7 public class RootObject 8 { 9 public string tableName { get; set; } 10 public List<Entity> entityList { get; set; } 11 } 12 13 public class Entity 14 { 15 public string Id { get; set; } 16 public int Sort { get; set; } 17 public string ItemInstanceType { get; set; } 18 public string Title { get; set; } 19 public string Type { get; set; } 20 public string Description { get; set; } 21 public string Image { get; set; } 22 public string Culture { get; set; } 23 public string Greek_Subcultures { get; set; } 24 public string Roman_Republican_Subcultures { get; set; } 25 public string Roman_Imperial_Subcultures { get; set; } 26 public string Celtic_Subcultures { get; set; } 27 public string Roman_Provincial_Subcultures { get; set; } 28 public string Islamic_Subcultures { get; set; } 29 public string Eastern_Subcultures { get; set; } 30 public string European_Medieval_Subcultures { get; set; } 31 public string Indian_Subcultures { get; set; } 32 public string Byzantine_Subcultures { get; set; } 33 public string Phoenician_Subcultures { get; set; } 34 public string Chinese_Subcultures { get; set; } 35 public string Zone { get; set; } 36 public string Region { get; set; } 37 public string Location { get; set; } 38 public string Modern_Location { get; set; } 39 public string Ruler_Title { get; set; } 40 public string Ruler_Title_English { get; set; } 41 public string Epithet { get; set; } 42 public string EpithetEnglish { get; set; } 43 public string Domain { get; set; } 44 public string Doman_English { get; set; } 45 public string StartOf_Rule { get; set; } 46 public string EndOf_Rule { get; set; } 47 public string OwnerID { get; set; } 48 public string OwnerName { get; set; } 49 public string ShortDescription { get; set; } 50 public string Focus { get; set; } 51 public string IsPatron { get; set; } 52 public string IsFolder { get; set; } 53 public string IsDeleted { get; set; } 54 public string MetalsList { get; set; } 55 public string MintedByList { get; set; } 56 public string IncludeInMenu { get; set; } 57 public string NameReadable { get; set; } 58 public string PreviousText { get; set; } 59 public string NextText { get; set; } 60 public string RelevantPageID { get; set; } 61 public string RelevantParagraphID { get; set; } 62 public string RelevantAreaID { get; set; } 63 } 64 65 } 66 67 68 @{ 69 70 string AllEntitiesRaw = System.IO.File.ReadAllText(HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Blogtheme/json/AllEntitiesTest.json")); 71 int AllEntitiesRawLength = AllEntitiesRaw.Length; 72 73 var AllEntitiesJSON = JsonConvert.DeserializeObject<List<Entity>>(@AllEntitiesRaw.Substring(49, @AllEntitiesRawLength - 55)); 74 75 76 string[] stringSeparators = new string[] { ", ", " and ", "|", "," }; 77 78 char[] charsToTrim = { '?' }; 79 80 int Count = 0; 81 int CoinsInAlbum = 1; 82 83 string PID = "8"; @* Where to send links *@ 84 85 string userid = @GetGlobalValue("Global:Extranet.UserID"); 86 87 string print = System.Web.HttpContext.Current.Request.QueryString["print"]; 88 89 } 90 91 @if (@GetInteger("QueryResult.Count") < 1) 92 { 93 <div align="center" class="font-description">No coins matching the search term(s)</div> 94 } 95 96 97 <!--Search bar --> 98 99 @if (@GetInteger("QueryResult.Count") > 0 && @print != "1") 100 { 101 <div class="input-group input-group-lg" id="filteringGroup" style="padding-left:10px;padding-right:10px;"> 102 <input class="form-control" type="text" id="inputFilter" placeholder="Type here to filter..."> 103 <span class="input-group-btn" id="buttonReset"><button class="btn btn-default brn-primary">X</button></span> 104 </div> 105 } 106 107 <div id="coin-items-list" class="row card-deck"> 108 109 110 111 @foreach (var coin in GetLoop("QueryResultItem")) 112 { 113 if (@coin.GetBoolean("Coin2_IsDeleted") != true && @coin.GetString("PageItemType") != "Entity") 114 { 115 116 string title = @coin.GetString("Coin2_Title"); 117 string[] titles = @title.Split(stringSeparators, StringSplitOptions.None); 118 119 string Mint = @coin.GetString("Coin2_Mint"); 120 string[] mints = @Mint.Split(stringSeparators, StringSplitOptions.None); 121 string region = @coin.GetString("Coin2_Region"); 122 string zone = @coin.GetString("Coin2_Zone"); 123 string year = coin.GetString("Coin2_Year"); 124 125 string Denomination = @coin.GetString("Coin2_Denomination"); 126 string[] denominations = @Denomination.Split(stringSeparators, StringSplitOptions.None); 127 128 string obverse = @coin.GetString("Coin2_Obverse_Legend"); 129 string reverse = @coin.GetString("Coin2_Reverse_Legend"); 130 string references = @coin.GetString("Coin2_References"); 131 string metal = @coin.GetString("Coin2_Metal"); 132 133 134 string category = @coin.GetString("Coin2_Category"); 135 string subcategorytype = "Coin2_" + @category + "Subcategory"; 136 string subcategory = @coin.GetString(@subcategorytype); 137 138 int sortvalue = @coin.GetInteger("Coin2_CustomSort"); 139 string ownerid = @coin.GetString("Coin2_BelongsToUser"); 140 141 string tab1 = "tab1" + coin.GetString("PageItemId"); 142 string tab2 = "tab2" + coin.GetString("PageItemId"); 143 string tab3 = "tab3" + coin.GetString("PageItemId"); 144 string tab4 = "tab4" + coin.GetString("PageItemId"); 145 146 <div class="card mb-4 coin-item bg-light"> 147 <!--Header--> 148 149 <div class="card-header font-coin-title coin-item-info"> 150 (@CoinsInAlbum) 151 @foreach (var titleElement in @titles) 152 { 153 bool TitleRendered = false; 154 foreach (var entity in AllEntitiesJSON) 155 { 156 string[] entityTitles; 157 string rawTitles = entity.Title; 158 entityTitles = rawTitles.Split(stringSeparators, StringSplitOptions.None); 159 160 if (@entityTitles[0] == @titleElement && @entity.Type == "Subcategory" && @entity.Culture == @category) 161 { 162 <a href='/Default.aspx?ID=@PID&@entity.Type=@titleElement.Replace(' ','_')&Category=@entity.Culture'> @titleElement</a> 163 TitleRendered = true; 164 } 165 else if (@entityTitles[0] == @titleElement && @entity.Type == "Ruler" && @entity.Culture != "Roman_Imperial" && @entity.Title != "Anonymous" && @entity.Roman_Republican_Subcultures == @subcategory || 166 entityTitles[0] == @titleElement && @entity.Type == "Ruler" && @entity.Culture != "Roman_Imperial" && @entity.Title != "Anonymous" && @entity.Roman_Imperial_Subcultures == @subcategory || 167 entityTitles[0] == @titleElement && @entity.Type == "Ruler" && @entity.Culture != "Roman_Imperial" && @entity.Title != "Anonymous" && @entity.Celtic_Subcultures == @subcategory || 168 entityTitles[0] == @titleElement && @entity.Type == "Ruler" && @entity.Culture != "Roman_Imperial" && @entity.Title != "Anonymous" && @entity.Roman_Provincial_Subcultures == @subcategory || 169 entityTitles[0] == @titleElement && @entity.Type == "Ruler" && @entity.Culture != "Roman_Imperial" && @entity.Title != "Anonymous" && @entity.Islamic_Subcultures == @subcategory || 170 entityTitles[0] == @titleElement && @entity.Type == "Ruler" && @entity.Culture != "Roman_Imperial" && @entity.Title != "Anonymous" && @entity.Eastern_Subcultures == @subcategory || 171 entityTitles[0] == @titleElement && @entity.Type == "Ruler" && @entity.Culture != "Roman_Imperial" && @entity.Title != "Anonymous" && @entity.European_Medieval_Subcultures == @subcategory || 172 entityTitles[0] == @titleElement && @entity.Type == "Ruler" && @entity.Culture != "Roman_Imperial" && @entity.Title != "Anonymous" && @entity.Indian_Subcultures == @subcategory || 173 entityTitles[0] == @titleElement && @entity.Type == "Ruler" && @entity.Culture != "Roman_Imperial" && @entity.Title != "Anonymous" && @entity.Byzantine_Subcultures == @subcategory || 174 entityTitles[0] == @titleElement && @entity.Type == "Ruler" && @entity.Culture != "Roman_Imperial" && @entity.Title != "Anonymous" && @entity.Phoenician_Subcultures == @subcategory || 175 entityTitles[0] == @titleElement && @entity.Type == "Ruler" && @entity.Culture != "Roman_Imperial" && @entity.Title != "Anonymous" && @entity.Chinese_Subcultures == @subcategory || 176 entityTitles[0] == @titleElement && @entity.Type == "Ruler" && @entity.Culture != "Roman_Imperial" && @entity.Title != "Anonymous" && @entity.Greek_Subcultures == @subcategory) 177 { 178 <a href='/Default.aspx?ID=@PID&@entity.Type=@titleElement&Category=@entity.Culture'> @titleElement</a> 179 TitleRendered = true; 180 } 181 else if (@entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.Roman_Republican_Subcultures == @subcategory || 182 @entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.Roman_Imperial_Subcultures == @subcategory || 183 @entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.Celtic_Subcultures == @subcategory || 184 @entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.Roman_Provincial_Subcultures == @subcategory || 185 @entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.Islamic_Subcultures == @subcategory || 186 @entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.Eastern_Subcultures == @subcategory || 187 @entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.European_Medieval_Subcultures == @subcategory || 188 @entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.Indian_Subcultures == @subcategory || 189 @entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.Byzantine_Subcultures == @subcategory || 190 @entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.Phoenician_Subcultures == @subcategory || 191 @entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.Chinese_Subcultures == @subcategory || 192 @entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.Greek_Subcultures == @subcategory) 193 194 { 195 <a href='/Default.aspx?ID=@PID&@entity.Type=@titleElement'> @titleElement</a> 196 TitleRendered = true; 197 } 198 else if (@entityTitles.Contains(@titleElement.TrimEnd(charsToTrim)) && @entity.Type == "Mint") 199 { 200 <a href="/Default.aspx?ID=@PID&Mint=@entity.Title">@titleElement</a> 201 TitleRendered = true; 202 } 203 else if (@entityTitles[0] == @titleElement && @entity.Type != "Subcategory" && @entity.Type != "Ruler" && @entity.Type != "Collection") 204 { 205 <a href='/Default.aspx?ID=@PID&@entity.Type=@titleElement'> @titleElement</a> 206 TitleRendered = true; 207 } 208 } 209 if (TitleRendered == false) 210 { 211 <text>@titleElement</text> 212 } 213 if (@titleElement == titles.Last()) 214 { 215 <span></span> 216 } 217 else 218 { 219 <span>|</span> 220 } 221 } 222 223 </div> 224 <!--Image--> 225 <a href='/Default.aspx?ID=@coin.GetString("PageIdString")'><img class="card-img-top" src='@coin.GetValue("Coin2_Image")' alt='@coin.GetValue("Coin2_Image")'></a> 226 <!--Coin summary--> 227 <div class="coin-summary-block text-center"> 228 <span class="coin-item-info font-coin-subtitle"> 229 An 230 <a href="//Default.aspx?ID=@PID&Metal=@metal">@metal.Replace("_", " ")</a> 231 @if (@Denomination.Length > 1) 232 { 233 foreach (var denominationElement in @denominations) 234 { 235 bool DenominationRendered = false; 236 foreach (var entity in AllEntitiesJSON) 237 { 238 string[] entityTitles; 239 string rawTitles = entity.Title; 240 entityTitles = rawTitles.Split(stringSeparators, StringSplitOptions.None); 241 242 if (@entityTitles.Contains(@denominationElement.TrimEnd(charsToTrim)) && @entity.Type == "Denomination") 243 { 244 <a href='/Default.aspx?ID=@PID&@entity.Type=@entity.Title'>@denominationElement</a> 245 DenominationRendered = true; 246 } 247 } 248 if (DenominationRendered == false) 249 { 250 <text>@denominationElement</text> 251 } 252 if (@denominationElement == denominations.Last()) 253 { 254 <span></span> 255 } 256 else 257 { 258 <span>|</span> 259 } 260 } 261 } 262 else 263 { 264 <span>unit</span> 265 } 266 267 struck @if (!string.IsNullOrWhiteSpace(@coin.GetString("Coin2_Year"))) 268 { 269 <span>@coin.GetString("Coin2_Year")</span> 270 } 271 else 272 { 273 <span>an unknown year</span> 274 } in 275 276 @if (@Mint.Length > 1) 277 { 278 foreach (var mintElement in @mints) 279 { 280 bool MintRendered = false; 281 foreach (var entity in AllEntitiesJSON) 282 { 283 string[] entityTitles; 284 string rawTitles = entity.Title; 285 entityTitles = rawTitles.Split(stringSeparators, StringSplitOptions.None); 286 287 if (@entityTitles.Contains(@mintElement.TrimEnd(charsToTrim)) && @entity.Type == "Mint") 288 { 289 <span class="coin-item-info "><a href="/Default.aspx?ID=@PID&Mint=@entity.Title">@mintElement</a></span> 290 MintRendered = true; 291 } 292 else if (@entityTitles.Contains(@mintElement.TrimEnd(charsToTrim)) && @entity.Type == "Subcategory" && @entity.Culture == @category) 293 { 294 <span class="coin-item-info"><a href="/Default.aspx?ID=@PID&@entity.Type=@entity.Title&Category=@entity.Culture">@mintElement</a></span> 295 MintRendered = true; 296 } 297 298 } 299 if (MintRendered == false) 300 { 301 <span class="coin-item-info">@mintElement</span> 302 } 303 if (@mintElement == mints.Last()) 304 { 305 <span></span> 306 } 307 else 308 { 309 <span style="">|</span> 310 } 311 } 312 } 313 else if (@region.Length > 1) 314 { 315 <span class="coin-item-info"><a href="/Default.aspx?ID=@PID&Region=@region">@region.Replace("_", " ")</a></span> 316 } 317 else if (@zone.Length > 1) 318 { 319 <span class="coin-item-info"><a href="/Default.aspx?ID=@PID&Zone=@zone">@zone.Replace("_", " ")</a></span> 320 } 321 else 322 { 323 <span class="coin-item-info">an unknown location</span> 324 } 325 326 </span> 327 </div> 328 329 <!--Tabs--> 330 <div class="card-header"> 331 332 <ul class="nav nav-tabs card-header-tabs font-reference" id="tabs-list" role="tablist"> 333 <li class="nav-item"> 334 <a class="nav-link active" href="#@tab1" role="tab" aria-controls="description" aria-selected="true">Description</a> 335 </li> 336 <li class="nav-item"> 337 <a class="nav-link" href="#@tab2" role="tab" aria-controls="history" aria-selected="false">Measurements</a> 338 </li> 339 <li class="nav-item"> 340 <a class="nav-link" href="#@tab3" role="tab" aria-controls="deals" aria-selected="false">Notes </a> 341 </li> 342 <li class="nav-item"> 343 <a class="nav-link" href="#@tab4" role="tab" aria-controls="deals" aria-selected="false">References</a> 344 </li> 345 </ul> 346 </div> 347 <!--Body--> 348 <div class="card-body"> 349 350 <div class="tab-content"> 351 <!--Tab 1 Description--> 352 <div class="tab-pane active" id="@tab1" role="tabpanel"> 353 <div class="card-text "> 354 <span class="font-coin-subtitle">Obverse:</span> <span class="font-coin-description coin-item-info">@obverse</span><br /> 355 </div> 356 <p class="card-text"> 357 <span class="font-coin-subtitle">Reverse:</span> <span class="font-coin-description coin-item-info">@reverse</span><br /> 358 </p> 359 </div> 360 <!--Tab 2 Measurements--> 361 <div class="tab-pane" id="@tab2" role="tabpanel"> 362 <!--Diameter--> 363 <span class="font-coin-subtitle">Diameter: </span> 364 @if (!string.IsNullOrWhiteSpace(@coin.GetString("Coin2_Diameter"))) 365 { 366 <span class="font-coin-description">@coin.GetString("Coin2_Diameter") mm</span> 367 } 368 else 369 { 370 <span>-</span> 371 } 372 <br /> 373 <!--Die Orientation--> 374 <span class="font-coin-subtitle">Die Orientation: </span> 375 @if (!string.IsNullOrWhiteSpace(@coin.GetString("Coin2_DieOrientation"))) 376 { 377 <span class="font-coin-description">@coin.GetString("Coin2_DieOrientation") H</span> 378 } 379 else 380 { 381 <span>-</span> 382 } 383 <br /> 384 <!--Weight--> 385 <span class="font-coin-subtitle">Weight: </span> 386 @if (!string.IsNullOrWhiteSpace(@coin.GetString("Coin2_Weight"))) 387 { 388 <span class="font-coin-description">@coin.GetString("Coin2_Weight") g</span> 389 } 390 else 391 { 392 <span>-</span> 393 } 394 <br /> 395 <!--Custom Sort--> 396 @if (@userid == @ownerid && @GetGlobalValue("Global:Page.ID") == "908") 397 { 398 <span class="font-coin-subtitle">Custom sort value:</span><span class="font-coin-description">@sortvalue</span> 399 } 400 </div> 401 <!--Tab 3 Notes--> 402 <div class="tab-pane font-coin-description" id="@tab3" role="tabpanel"> 403 @if (!string.IsNullOrWhiteSpace(@coin.GetString("Coin2_Description"))) 404 { 405 @coin.GetString("Coin2_Description") 406 } 407 else 408 { 409 <div class="text-center">No notes for this coin</div> 410 } 411 </div> 412 <!--Tab 4 References--> 413 <div class="tab-pane" id="@tab4" role="tabpanel"> 414 415 @if (@references.Length > 0) 416 { 417 <span class="coin-item-info font-coin-description">@references</span> 418 } 419 else if (@references.Length < 1) 420 { 421 <div class="font-coin-description text-center">No references provided for this coin</div> 422 } 423 424 </div> 425 </div> 426 427 </div> 428 <div class="card-footer"> 429 @if (ownerid == userid) 430 {<span><i title="Your coin" class="fa fa-user-circle"></i></span>} 431 <small class="text-muted"> 432 @if (!string.IsNullOrWhiteSpace(@category)) 433 { 434 <span class="coin-item-info font-category-small"> 435 <a href="/Default.aspx?ID=@PID&Category=@category">@category.Replace("_", " ")</a> @if (!string.IsNullOrWhiteSpace(@subcategory)) 436 {<a href="/Default.aspx?ID=@PID&Subcategory=@subcategory&Category=@category">(@subcategory.Replace("_", " "))</a>} 437 </span> 438 } 439 else 440 { 441 <span class="coin-item-info font-category-small">Uncategorized</span> 442 } 443 </small> 444 </div> 445 </div> 446 447 <!-- Counts & Breaks--> 448 CoinsInAlbum = CoinsInAlbum + 1; 449 Count++; 450 451 452 453 } 454 } 455 456 457 458 </div> 459 460 <script type="text/javascript" src="/Files/Templates/Designs/BlogTheme/js/CoinFilter.js"></script> 461 <script> 462 $('#tabs-list a').on('click', function (e) { 463 e.preventDefault() 464 $(this).tab('show') 465 }) 466 </script> 467 468 @if (@print == "1") 469 { 470 <body onload="window.print()"> 471 </body> 472 }
Error executing template "ItemCreator/Create/CreateCoin.cshtml"
System.IO.IOException: The process cannot access the file 'd:\dynamicweb.net\Solutions\Dynamicweb\cboll.net.dynamicweb-cms.com\Files\Templates\Designs\Blogtheme\json\AllEntitiesTest.json' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at CompiledRazorTemplates.Dynamic.RazorEngine_aa392d4ce78e4494a502d7b9540c6d75.Execute() in d:\dynamicweb.net\Solutions\Dynamicweb\cboll.net.dynamicweb-cms.com\Files\Templates\ItemCreator\Create\CreateCoin.cshtml:line 69
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using System.Web; 2 @using System.Net; 3 @using Newtonsoft.Json; 4 @using Newtonsoft.Json.Linq; 5 6 @functions { 7 public class RootObject 8 { 9 public string tableName { get; set; } 10 public List<Entity> entityList { get; set; } 11 } 12 13 public class Entity 14 { 15 public string Id { get; set; } 16 public int Sort { get; set; } 17 public string ItemInstanceType { get; set; } 18 public string Title { get; set; } 19 public string Type { get; set; } 20 public string Description { get; set; } 21 public string Image { get; set; } 22 public string Culture { get; set; } 23 public string Greek_Subcultures { get; set; } 24 public string Roman_Republican_Subcultures { get; set; } 25 public string Roman_Imperial_Subcultures { get; set; } 26 public string Celtic_Subcultures { get; set; } 27 public string Roman_Provincial_Subcultures { get; set; } 28 public string Islamic_Subcultures { get; set; } 29 public string Eastern_Subcultures { get; set; } 30 public string European_Medieval_Subcultures { get; set; } 31 public string Indian_Subcultures { get; set; } 32 public string Byzantine_Subcultures { get; set; } 33 public string Phoenician_Subcultures { get; set; } 34 public string Chinese_Subcultures { get; set; } 35 public string Zone { get; set; } 36 public string Region { get; set; } 37 public string Location { get; set; } 38 public string Modern_Location { get; set; } 39 public string Ruler_Title { get; set; } 40 public string Ruler_Title_English { get; set; } 41 public string Epithet { get; set; } 42 public string EpithetEnglish { get; set; } 43 public string Domain { get; set; } 44 public string Doman_English { get; set; } 45 public string StartOf_Rule { get; set; } 46 public string EndOf_Rule { get; set; } 47 public string OwnerID { get; set; } 48 public string OwnerName { get; set; } 49 public string ShortDescription { get; set; } 50 public string Focus { get; set; } 51 public string IsPatron { get; set; } 52 public string IsFolder { get; set; } 53 public string IsDeleted { get; set; } 54 public string MetalsList { get; set; } 55 public string MintedByList { get; set; } 56 public string IncludeInMenu { get; set; } 57 public string NameReadable { get; set; } 58 public string PreviousText { get; set; } 59 public string NextText { get; set; } 60 public string RelevantPageID { get; set; } 61 public string RelevantParagraphID { get; set; } 62 public string RelevantAreaID { get; set; } 63 } 64 65 } 66 67 68 @{ 69 string AllEntitiesRaw = System.IO.File.ReadAllText(HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Blogtheme/json/AllEntitiesTest.json")); 70 int AllEntitiesRawLength = AllEntitiesRaw.Length; 71 72 var AllEntitiesJSON = JsonConvert.DeserializeObject<List<Entity>>(@AllEntitiesRaw.Substring(49, @AllEntitiesRawLength - 55)); 73 74 var AllEntitiesSorted = AllEntitiesJSON.OrderBy(x => x.Title); 75 76 string today = DateTime.Now.ToString("yyyy-MM-dd"); 77 78 var user = Dynamicweb.Security.UserManagement.User.GetUserByID(Convert.ToInt32(@GetGlobalValue("Global:Extranet.UserID"))); 79 80 } 81 82 @if (user != null){ 83 <div class="modal fade" id="NewCoinModal" tabindex="-1" role="dialog"> 84 <div class="modal-dialog modal-lg" role="document"> 85 <div class="modal-content"> 86 @if (!string.IsNullOrWhiteSpace(user.Name)) 87 { 88 @GetString("ItemCreator:Edit.Form.Begin") 89 <div class="modal-header"> 90 <h5 class="modal-title" id="exampleModalLongTitle">Add a coin to your collection</h5> 91 <button type="button" class="close" data-dismiss="modal" aria-label="Close"> 92 <span aria-hidden="true">&times;</span> 93 </button> 94 </div> 95 <div class="modal-body"> 96 <script src="/Admin/Content/JsLib/dw/ItemGroupVisibilityHandler.js" type="text/javascript"></script> 97 @* Title and Year *@ 98 99 <div class="col-md-12 row" style="margin-top:10px;"> 100 <label for="authority" class="font-subtitle col-md-3">Authority </label> 101 <input id="authority" type="text" class="col-md-9" name="Title" autocomplete="off" maxlength="50" value="" /> 102 </div> 103 104 <div class="col-md-12 row" style="margin-top:10px;"> 105 <label class="font-subtitle col-md-3">Year </label> 106 <input type="text" class="col-md-9" name="Year" autocomplete="off" maxlength="15" value="" /> 107 </div> 108 109 @* Classification *@ 110 <div class="col-md-12 row" id="Classification_fieldSet" style="margin-top:10px;"> 111 <label class="font-subtitle col-md-3">Category</label> 112 <select class="col-md-9" id="Category" name="Category"> 113 <option selected="selected" value="">Nothing selected</option> 114 @foreach (var entity in AllEntitiesSorted) 115 { 116 if (entity.Title == @GetString("ItemPublisher:Item.Category") && entity.Type == "Category") 117 { 118 <option selected="selected" value='@entity.Title'>@entity.Title.Replace("_", " ")</option> 119 } 120 else if (entity.Type == "Category") 121 { 122 <option value='@entity.Title'>@entity.Title.Replace("_", " ")</option> 123 } 124 } 125 </select> 126 </div> 127 128 129 <!--Subcategories--> 130 @foreach (var entity in AllEntitiesJSON) 131 { 132 if (entity.Type == "Category") 133 { 134 string fieldsetstring = entity.Title + "_fieldSet"; 135 string selectstring = entity.Title + "Subcategory"; 136 string tagstring = "ItemPublisher:Item." + selectstring; 137 <div id="@fieldsetstring"> 138 <div class="col-md-12 row"> 139 <label class="font-subtitle col-md-3">Subcategory</label> 140 <select class="col-md-9" id="@selectstring" name="@selectstring"> 141 <option value="">Nothing selected</option> 142 @foreach (var subcategory in AllEntitiesJSON.OrderBy(x => x.Sort)) 143 { 144 if (subcategory.Type == "Subcategory" && subcategory.Culture == entity.Title) 145 { 146 <option value='@subcategory.Title'>@subcategory.Title.Replace("_", " ")</option> 147 } 148 } 149 </select> 150 </div> 151 152 </div> 153 } 154 } 155 156 @* Image *@ 157 <div class="col-md-12 row"> 158 <label class="font-subtitle col-md-3">Image </label> 159 <div class="col-md-9"> 160 <img class="img-fluid" id="blah" src="/Files/Images/Placeholder.png" alt="your image"> <img /> 161 <input type='file' name='Image' accept='' id="imgInp" /> 162 </div> 163 </div> 164 </div> 165 @* Obverse and Reverse *@ 166 167 <div class="col-md-12 row"> 168 <label class="font-subtitle col-md-3">Obverse </label> 169 <input type="text" class="col-md-9" name="Obverse_Legend" maxlength="255" value="" /> 170 </div> 171 172 <div class="col-md-12 row"> 173 <label class="font-subtitle col-md-3">Reverse </label> 174 <input type="text" class="col-md-9" name="Reverse_Legend" maxlength="255" value="" /> 175 </div> 176 177 @* Metal *@ 178 <div class="col-md-12 row"> 179 <label class="font-subtitle col-md-3">Metal </label> 180 <select class="col-md-9" id="Metal" name="Metal"> 181 <option selected="selected" value="">Nothing selected</option> 182 183 @foreach (var entity in AllEntitiesSorted) 184 { 185 if (entity.Type == "Metal") 186 { 187 string NameReadable = "(" + @entity.NameReadable + ")"; 188 <option value='@entity.Title'> 189 @entity.Title.Replace("_", " ") @if (!string.IsNullOrWhiteSpace(@entity.NameReadable)) 190 {@NameReadable} 191 </option> 192 } 193 } 194 </select> 195 </div> 196 197 @* Denomination *@ 198 <div class="col-md-12 row"> 199 <label class="font-subtitle col-md-3">Denomination</label> 200 <input id="denomination" type="text" class="col-md-9" name="Denomination" maxlength="255" value="" /> 201 </div> 202 203 @* Zone *@ 204 <div class="col-md-12 row"> 205 <label class="font-subtitle col-md-3">Zone </label> 206 <select class="col-md-9" id="Zone" name="Zone"> 207 <option selected="selected" value="">Nothing selected</option> 208 @foreach (var entity in AllEntitiesSorted) 209 { 210 if (entity.Type == "Zone") 211 { 212 <option value='@entity.Title'>@entity.Title.Replace("_", " ")</option> 213 } 214 } 215 </select> 216 </div> 217 218 @* Region *@ 219 <div class="col-md-12 row"> 220 <label class="font-subtitle col-md-3">Region </label> 221 <select class="col-md-9" id="Region" name="Region"> 222 <option selected="selected" value="">Nothing selected</option> 223 @foreach (var entity in AllEntitiesSorted) 224 { 225 if (entity.Type == "Region" && entity.Zone != null) 226 { 227 <option data-ref='@entity.Zone' value='@entity.Title'>@entity.Title</option> 228 } 229 } 230 </select> 231 </div> 232 233 @* Mint *@ 234 <div class="col-md-12 row"> 235 <label class="font-subtitle col-md-3">Mint</label> 236 <input id="mint" class="std item-field col-md-9" maxlength="255" name="Mint" type="text" value=""> 237 </div> 238 239 240 241 @* Notes *@ 242 <div class="col-md-12 row"> 243 <label class="font-subtitle col-md-3">Notes</label> 244 <textarea class="col-md-9" rows="8" id='Description' name='Description'> </textarea> 245 </div> 246 247 @* References *@ 248 <div class="col-md-12 row "> 249 <label class="font-subtitle col-md-3">References</label> 250 <input type="text" class="col-md-9" name="References" maxlength="255" value=""> 251 </div> 252 253 254 255 256 @* Measurements *@ 257 258 <div class="col-md-12 row"> 259 <label class="font-subtitle col-md-3">Weight </label> 260 <input class="col-md-9" name="Weight" type="number" value="" min="0" step="0.01"> 261 </div> 262 263 <div class="col-md-12 row"> 264 <label class="font-subtitle col-md-3">Diameter </label> 265 <input class="col-md-9" name="Diameter" type="number" value="" min="0" step="0.01"> 266 </div> 267 268 <div class="col-md-12 row"> 269 <label class="font-subtitle col-md-3">Die axis </label> 270 <input class="col-md-9" name="DieOrientation" type="number" min="0" max="12" value=""> 271 </div> 272 273 @* Purchase Info fields *@ 274 275 <div class="col-md-12 row"> 276 <label class="font-subtitle col-md-3">Price</label> 277 <input class="std item-field col-md-9" maxlength="255" name="PurchasePrice" type="number" value=""> 278 </div> 279 280 <div class="col-md-12 row"> 281 <label class="font-subtitle col-md-3">Source</label> 282 <input class="std item-field col-md-9" maxlength="255" name="PurchaseSource" type="text" value=""> 283 </div> 284 285 <div class="col-md-12 row"> 286 <label class="font-subtitle col-md-3">Date</label> 287 <input class="item-field col-md-9" name="PurchaseDate" type="date" value="@today"> 288 </div> 289 290 <!--Organisation--> 291 <div class="col-md-12 row"> 292 <label class="font-subtitle col-md-3">Sort value</label> 293 <input class="std item-field col-md-9" maxlength="255" name="CustomSort" type="number" value="99999"> 294 </div> 295 <div class="col-md-12 row"> 296 <label class="font-subtitle col-md-3">Folder</label> 297 <select class="col-md-9" id="Folder" name="Folder"> 298 <option selected="selected" value="">Nothing selected</option> 299 @foreach (var entity in AllEntitiesSorted) 300 { 301 if (entity.Type == "Collection" && entity.IsFolder == "true" && entity.OwnerID == user.ID.ToString()) 302 { 303 <option value='@entity.Title'>@entity.Title.Replace("_", " ")</option> 304 } 305 } 306 </select> 307 </div> 308 <hr /> 309 <div class="col-md-12 font-description"> 310 <b>Please note:</b> Your coin will not be visible immediately - all content on this website must be indexed before it becomes visible. We index all content roughly <b>every 5 minutes</b>. 311 </div> 312 313 314 @* Hidden fields *@ 315 <div> 316 <input class="item-field item-field-date" name="CreatedDate" type="hidden" value='@GetGlobalValue("Global:Server.Date")'> 317 <input class="std item-field form-control" maxlength="255" name="OwnerName" type="hidden" value='@GetGlobalValue("Global:Extranet.UserName")'> 318 <input class="std item-field form-control" maxlength="255" name="BelongsToUser" type="hidden" value='@GetGlobalValue("Global:Extranet.UserID")'> 319 </div> 320 <script type="text/javascript"> 321 Dynamicweb.Items.GroupVisibilityRule.get_current().add({ 322 "VisibilityRules": [{ 323 "VisibilityField": "Category", 324 "VisibilityTargetGroup": "Roman_Imperial", 325 "VisibilityCondition": "0", 326 "VisibilityFieldType": "3", 327 "VisibilityConditionValue": "Roman_Imperial", 328 "Group": "Classification" 329 }, { 330 "VisibilityField": "Category", 331 "VisibilityTargetGroup": "Roman_Republican", 332 "VisibilityCondition": "0", 333 "VisibilityFieldType": "3", 334 "VisibilityConditionValue": "Roman_Republican", 335 "Group": "Classification" 336 }, { 337 "VisibilityField": "Category", 338 "VisibilityTargetGroup": "Greek", 339 "VisibilityCondition": "0", 340 "VisibilityFieldType": "3", 341 "VisibilityConditionValue": "Greek", 342 "Group": "Classification" 343 }, { 344 "VisibilityField": "Category", 345 "VisibilityTargetGroup": "Islamic", 346 "VisibilityCondition": "0", 347 "VisibilityFieldType": "3", 348 "VisibilityConditionValue": "Islamic", 349 "Group": "Classification" 350 }, { 351 "VisibilityField": "Category", 352 "VisibilityTargetGroup": "Eastern", 353 "VisibilityCondition": "0", 354 "VisibilityFieldType": "3", 355 "VisibilityConditionValue": "Eastern", 356 "Group": "Classification" 357 }, { 358 "VisibilityField": "Category", 359 "VisibilityTargetGroup": "Roman_Provincial", 360 "VisibilityCondition": "0", 361 "VisibilityFieldType": "3", 362 "VisibilityConditionValue": "Roman_Provincial", 363 "Group": "Classification" 364 }, { 365 "VisibilityField": "Category", 366 "VisibilityTargetGroup": "Byzantine", 367 "VisibilityCondition": "0", 368 "VisibilityFieldType": "3", 369 "VisibilityConditionValue": "Byzantine", 370 "Group": "Classification" 371 }, { 372 "VisibilityField": "Category", 373 "VisibilityTargetGroup": "European_Medieval", 374 "VisibilityCondition": "0", 375 "VisibilityFieldType": "3", 376 "VisibilityConditionValue": "European_Medieval", 377 "Group": "Classification" 378 }, { 379 "VisibilityField": "Category", 380 "VisibilityTargetGroup": "Phoenician", 381 "VisibilityCondition": "0", 382 "VisibilityFieldType": "3", 383 "VisibilityConditionValue": "Phoenician", 384 "Group": "Classification" 385 }, { 386 "VisibilityField": "Category", 387 "VisibilityTargetGroup": "Celtic", 388 "VisibilityCondition": "0", 389 "VisibilityFieldType": "3", 390 "VisibilityConditionValue": "Celtic", 391 "Group": "Classification" 392 }], 393 "Groups": [{ 394 "GroupName": "General", 395 "IsVisible": true 396 }, { 397 "GroupName": "Classification", 398 "IsVisible": true 399 }, { 400 "GroupName": "Roman_Imperial", 401 "IsVisible": false 402 }, { 403 "GroupName": "Greek", 404 "IsVisible": false 405 }, { 406 "GroupName": "Islamic", 407 "IsVisible": false 408 }, { 409 "GroupName": "Chinese", 410 "IsVisible": false 411 }, { 412 "GroupName": "Roman_Provincial", 413 "IsVisible": false 414 }, { 415 "GroupName": "Indian", 416 "IsVisible": false 417 }, { 418 "GroupName": "Eastern", 419 "IsVisible": false 420 }, { 421 "GroupName": "Provincial", 422 "IsVisible": false 423 }, { 424 "GroupName": "Roman_Republican", 425 "IsVisible": false 426 }, { 427 "GroupName": "Celtic", 428 "IsVisible": false 429 }, { 430 "GroupName": "European_Medieval", 431 "IsVisible": false 432 }, { 433 "GroupName": "Byzantine", 434 "IsVisible": false 435 }, { 436 "GroupName": "Phoenician", 437 "IsVisible": false 438 }, { 439 "GroupName": "Relationships", 440 "IsVisible": true 441 }, { 442 "GroupName": "Measurements", 443 "IsVisible": true 444 }, { 445 "GroupName": "Trade", 446 "IsVisible": true 447 }, { 448 "GroupName": "Audit", 449 "IsVisible": true 450 }], 451 "Fields": [{ 452 "Id": "Title", 453 "Group": "General" 454 }, { 455 "Id": "Image", 456 "Group": "General" 457 }, { 458 "Id": "Obverse_Legend", 459 "Group": "General" 460 }, { 461 "Id": "Reverse_Legend", 462 "Group": "General" 463 }, { 464 "Id": "Description", 465 "Group": "General" 466 }, { 467 "Id": "Year", 468 "Group": "General" 469 }, { 470 "Id": "Category", 471 "Group": "Classification" 472 }, { 473 "Id": "References", 474 "Group": "Classification" 475 }, { 476 "Id": "Roman_ImperialSubcategory", 477 "Group": "Roman_Classification" 478 }, { 479 "Id": "DenominationRoman", 480 "Group": "Roman_Classification" 481 }, { 482 "Id": "Mintmark", 483 "Group": "Roman_Classification" 484 }, { 485 "Id": "GreekSubcategory", 486 "Group": "Greek_Classification" 487 }, { 488 "Id": "DenominationGreek", 489 "Group": "Greek_Classification" 490 }, { 491 "Id": "IslamicSubcategory", 492 "Group": "Islamic_Classification" 493 }, { 494 "Id": "DenominationIslamic", 495 "Group": "Islamic_Classification" 496 }, { 497 "Id": "EasternSubcategory", 498 "Group": "Eastern_Classification" 499 }, { 500 "Id": "DenominationEastern", 501 "Group": "Eastern_Classification" 502 }, { 503 "Id": "BelongsToUser", 504 "Group": "Relationships" 505 }, { 506 "Id": "OwnerName", 507 "Group": "Relationships" 508 }, { 509 "Id": "Metal", 510 "Group": "Measurements" 511 }, { 512 "Id": "Weight", 513 "Group": "Measurements" 514 }, { 515 "Id": "Diameter", 516 "Group": "Measurements" 517 }, { 518 "Id": "DieOrientation", 519 "Group": "Measurements" 520 }, { 521 "Id": "PurchasePrice", 522 "Group": "Trade" 523 }, { 524 "Id": "PurchaseDate", 525 "Group": "Trade" 526 }, { 527 "Id": "PurchaseSource", 528 "Group": "Trade" 529 }, { 530 "Id": "Created", 531 "Group": "Audit" 532 }] 533 }); 534 </script> 535 <div class="modal-footer"> 536 <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> 537 <button type="submit" class="btn btn-primary">Add</button> 538 </div> 539 @GetString("ItemCreator:Edit.Form.End") 540 } 541 </div> 542 </div> 543 </div> 544 } 545 546 547 548 <script> 549 @* This code creates dropdown menus with suggestions for three text fields *@ 550 551 552 var authorities = { 553 url: "/Files/Templates/Designs/Blogtheme/json/authorities.txt", 554 555 556 getValue: "title", 557 adjustWidth: false, 558 559 list: { 560 match: { enabled: true } 561 }, 562 template: { 563 type: "custom", 564 method: function(value, item) { 565 return value + "<text class='font-description-tiny'> – " + item.ruler_title + " of " + item.domain + " from " + item.from + " to " + item.to + "</text>"; 566 } 567 } 568 }; 569 570 var denominations = { 571 url: "/Files/Templates/Designs/Blogtheme/json/Denominations.txt", 572 573 getValue: "title", 574 adjustWidth: false, 575 576 list: { 577 match: { enabled: true } 578 }, 579 template: { 580 type: "custom", 581 method: function (value, item) { 582 return item.title; 583 } 584 } 585 }; 586 587 588 var mints = { 589 url: "/Files/Templates/Designs/Blogtheme/json/mints.txt", 590 591 getValue: "title", 592 adjustWidth: false, 593 594 list: { 595 match: { enabled: true } 596 }, 597 template: { 598 type: "custom", 599 method: function(value, item) { 600 if (item.other_titles !== '') { 601 return value + "<text class='font-description-tiny'> " + "(" + item.other_titles + ")" + " - a settlement in " + item.region + "</text>"; 602 } else { 603 return value + "<text class='font-description-tiny'> - a settlement in " + item.region + "</text>"; 604 } 605 } 606 } 607 }; 608 609 $("#authority").easyAutocomplete(authorities); 610 $("#denomination").easyAutocomplete(denominations); 611 $("#mint").easyAutocomplete(mints); 612 613 </script> 614 615 616 <script> 617 @* This code tries to set the value of a Zone based on the Region value *@ 618 619 $(document).ready(function(){ 620 $('#Region').change(function(){ 621 $('#Zone').val($('#Region option:selected').data('ref')); 622 }); 623 624 $('#Zone').change(function(){ 625 $('#Region').val(""); 626 }); 627 628 }); 629 630 </script> 631 632 633 634 635 <script> 636 @* This code shows a preview of the selected image file when adding images to a new coin *@ 637 638 function readURL(input) { 639 if (input.files && input.files[0]) { 640 var reader = new FileReader(); 641 642 reader.onload = function (e) { 643 $('#blah').attr('src', e.target.result); 644 } 645 646 reader.readAsDataURL(input.files[0]); 647 } 648 } 649 650 $("#imgInp").change(function(){ 651 readURL(this); 652 }); 653 654 </script>