Elma Instruments AS
Error executing template "Designs/Tapas/eCom/GroupList/frontgroups.cshtml"
System.Data.SqlClient.SqlException (0x80131904): Transaction (Process ID 63) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)
   at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
   at System.Data.SqlClient.SqlDataReader.Read()
   at Dynamicweb.Ecommerce.Products.ProductRepository.GetProductsBySql(CommandBuilder query, Boolean doRefactoring, Boolean bulkFill, Boolean useAssortments)
   at Dynamicweb.Ecommerce.Products.Group.get_Products()
   at CompiledRazorTemplates.Dynamic.RazorEngine_28dd556188464f58b67af91203ad2b17.<>c__DisplayClass0_0.<GetGroupList>b__0(TextWriter __razor_helper_writer) in E:\Websites\elma.LIVE\Files\Templates\Designs\Tapas\eCom\GroupList\frontgroups.cshtml:line 34
   at CompiledRazorTemplates.Dynamic.RazorEngine_28dd556188464f58b67af91203ad2b17.Execute() in E:\Websites\elma.LIVE\Files\Templates\Designs\Tapas\eCom\GroupList\frontgroups.cshtml:line 79
   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()
ClientConnectionId:e8ca3762-53e4-44be-b865-63fdccb5280a
Error Number:1205,State:51,Class:13

1 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 2 @using Dynamicweb.Rendering 3 @using Dynamicweb.Environment 4 5 @{ 6 bool ajaxRequest = Dynamicweb.Context.Current.Request.GetBoolean("ajaxTapas"); 7 } 8 9 @helper GetGroupList(IEnumerable<LoopItem> Loop) 10 { 11 var groupService = new Dynamicweb.Ecommerce.Products.GroupService(); 12 List<string> list = new List<string>(); 13 if (Loop.Any()) 14 { 15 16 17 <div class="row margin-top-desktop margin-bottom-desktop"> 18 <div class="alphabetic-wrapper col-sm-12"> 19 <ol class="alphabetic-list list-unstyled filterrows elma-card elma-card--white elma-card--padded"> 20 @foreach (LoopItem Group in Loop.OrderBy(x => x.GetString("Ecom:Group.Name"))) 21 { 22 bool clickable = Group.GetBoolean("Ecom:Group.Clickable"); 23 if (clickable) 24 { 25 string groupName = Group.GetString("Ecom:Group.Name"); 26 string groupId = Group.GetString("Ecom:Group.ID"); 27 var dwGroup = groupService.GetGroup(groupId); 28 if (!list.Contains(groupId)) 29 { 30 list.Add(groupId); 31 32 string groupLink = Group.GetString("Ecom:Group.Link.Clean"); 33 bool hasChildGroups = (Group.GetLoop("Childgroups").Count() > 0); 34 bool hasProducts = dwGroup.Products.Count > 0; 35 if (!string.IsNullOrEmpty(groupName) && !string.IsNullOrEmpty(groupLink) && (hasChildGroups || hasProducts)) 36 //if (!string.IsNullOrEmpty(groupName) && !string.IsNullOrEmpty(groupLink)) 37 { 38 <li class="filterrow" ftw-filter-freetext="@groupName"> 39 <a href="@groupLink" class="product-group-link margin-bottom-quarter elma-link"> 40 <span>@groupName</span> 41 </a> 42 </li> 43 } 44 } 45 } 46 } 47 </ol> 48 </div> 49 </div> 50 } 51 } 52 53 @if (!ajaxRequest) 54 { 55 <div class="container"> 56 <h1 class="line-bottom line-bottom--dark clearfix margin-bottom-desktop"> 57 @Translate("frontgroups", "Alle varegrupper") 58 </h1> 59 60 <div class="form-inline"> 61 <input type="hidden" name="ID" value="@Pageview.Page.ID"> 62 63 <div class="filter all-categories-filter" data-bind="filter"> 64 <div class="row filters margin-top-desktop margin-bottom-half"> 65 <div class="form-inline col-sm-8"> 66 <div class="form-group textfilter"> 67 <input class="freetext form-control large-search-input" type="text" _id="seachField" _name="seachField" placeholder="@Translate("Categories.SearchField.Placeholder", "S&oslash;g efter kategorier")..." autocomplete="off" style="width:300px;"> 68 </div> 69 <div class="form-group reset"> 70 <button class="instant-search-icon pointers-events resetbtn btn btn-primary" type="button">@Translate("reset", "Nulstil")</button> 71 </div> 72 </div> 73 </div> 74 75 </div> 76 77 </div> 78 79 @GetGroupList(GetLoop("Groups")) 80 </div> 81 }