Error compiling template "Designs/Dwsimple/eCom/Productlist/SparePartsProductListPDF.cshtml"
Line 55: '"Services" ist veraltet: "Use Dynamicweb.Content.Services instead."
Line 55: '"Services.Pages" ist veraltet: "Use Dynamicweb.Content.Services.Pages instead."
Line 203: Der Name "GetProductImage" ist im aktuellen Kontext nicht vorhanden.
Line 991: Die Variable "pageSize" ist zugewiesen, ihr Wert wird aber nie verwendet.

1 //------------------------------------------------------------------------------ 2 // <auto-generated> 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319.42000 5 // 6 // Changes to this file may cause incorrect behavior and will be lost if 7 // the code is regenerated. 8 // </auto-generated> 9 //------------------------------------------------------------------------------ 10 11 namespace CompiledRazorTemplates.Dynamic { 12 13 #line 3 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 14 using System; 15 16 #line default 17 #line hidden 18 19 #line 6 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 20 using System.Collections.Generic; 21 22 #line default 23 #line hidden 24 using System.Linq; 25 26 #line 2 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 27 using Dynamicweb.Content.Items; 28 29 #line default 30 #line hidden 31 32 #line 4 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 33 using System.IO; 34 35 #line default 36 #line hidden 37 38 #line 5 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 39 using System.Web; 40 41 #line default 42 #line hidden 43 44 45 public class RazorEngine_4c32067bee3c4e069fb5ac8e8e651016 : Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> { 46 47 #line hidden 48 49 #line 9 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 50 51 public string GetParentSettingsItem(string systemName) 52 { 53 string item = null; 54 55 Dynamicweb.Content.Page current = Dynamicweb.Services.Pages.GetPage(Pageview.Page.ID); 56 while (current != null && current.Parent != current) 57 { 58 var temp = current.Item != null ? current.Item[systemName] : ""; 59 60 if (temp != null) 61 { 62 item = temp.ToString(); 63 64 if (!String.IsNullOrEmpty(item) && !String.Equals("default", item, StringComparison.OrdinalIgnoreCase)) 65 { 66 break; 67 } 68 } 69 70 current = current.Parent; 71 } 72 73 return item; 74 } 75 76 #line default 77 #line hidden 78 79 80 #line 37 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 81 82 int heightBuffer; 83 int contentHeight; 84 int contentWidth; 85 int productItemHeight; 86 string pageOrientation; 87 int pageNumber; 88 89 #line default 90 #line hidden 91 92 93 #line 107 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 94 public RazorEngine.Templating.TemplateWriter RenderProductSheet(dynamic products) 95 { 96 #line default 97 #line hidden 98 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => { 99 100 #line 108 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 101 102 string pageMargin = GetParentSettingsItem("Margin") != null ? GetParentSettingsItem("Margin") : "10"; 103 104 105 106 107 #line default 108 #line hidden 109 WriteLiteralTo(__razor_helper_writer, " <section"); 110 111 WriteLiteralTo(__razor_helper_writer, " class=\"sheet\""); 112 113 WriteLiteralTo(__razor_helper_writer, ">\r\n <div"); 114 115 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-container sheet-container--flex-col\""); 116 117 WriteLiteralTo(__razor_helper_writer, ">\r\n"); 118 119 WriteLiteralTo(__razor_helper_writer, " "); 120 121 122 #line 114 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 123 WriteTo(__razor_helper_writer, RenderPaperHeader()); 124 125 126 #line default 127 #line hidden 128 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n <div"); 129 130 WriteAttributeTo(__razor_helper_writer, "class", Tuple.Create(" class=\"", 2985), Tuple.Create("\"", 3067) 131 , Tuple.Create(Tuple.Create("", 2993), Tuple.Create("sheet-container__content", 2993), true) 132 , Tuple.Create(Tuple.Create(" ", 3017), Tuple.Create("sheet-container__content--padding-", 3018), true) 133 134 #line 116 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 135 , Tuple.Create(Tuple.Create("", 3052), Tuple.Create<System.Object, System.Int32>(pageMargin 136 137 #line default 138 #line hidden 139 , 3052), false) 140 , Tuple.Create(Tuple.Create("", 3065), Tuple.Create("mm", 3065), true) 141 ); 142 143 WriteAttributeTo(__razor_helper_writer, "style", Tuple.Create(" style=\"", 3068), Tuple.Create("\"", 3117) 144 , Tuple.Create(Tuple.Create("", 3076), Tuple.Create("height:", 3076), true) 145 146 #line 116 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 147 , Tuple.Create(Tuple.Create(" ", 3083), Tuple.Create<System.Object, System.Int32>(contentHeight + heightBuffer 148 149 #line default 150 #line hidden 151 , 3084), false) 152 , Tuple.Create(Tuple.Create("", 3115), Tuple.Create("mm", 3115), true) 153 ); 154 155 WriteLiteralTo(__razor_helper_writer, ">\r\n <table"); 156 157 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-product-table\""); 158 159 WriteLiteralTo(__razor_helper_writer, ">\r\n\r\n"); 160 161 162 #line 119 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 163 164 165 #line default 166 #line hidden 167 168 #line 119 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 169 foreach (LoopItem product in products) 170 { 171 string productName = product.GetString("Ecom:Product.Name"); 172 productName += !String.IsNullOrEmpty(product.GetString("Ecom:Product.SelectedVariantComboName")) ? ", " + product.GetString("Ecom:Product.SelectedVariantComboName") : ""; 173 string productPrice = product.GetString("Ecom:Product.Discount.Price.PriceFormatted") != product.GetString("Ecom:Product.Price.PriceFormatted") ? product.GetString("Ecom:Product.Discount.Price.PriceFormatted") : product.GetString("Ecom:Product.Price.PriceFormatted"); 174 string productBeforePrice = product.GetString("Ecom:Product.Discount.Price.PriceFormatted") != product.GetString("Ecom:Product.Price.PriceFormatted") ? product.GetString("Ecom:Product.Price.PriceFormatted") : ""; 175 string productNameWidth = productItemHeight < 20 ? "width: 40mm; " : ""; 176 int productImageHeight = productItemHeight < 15 ? 6 : productItemHeight - 4; 177 178 179 180 #line default 181 #line hidden 182 WriteLiteralTo(__razor_helper_writer, " <tr"); 183 184 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-product-table-item\""); 185 186 WriteAttributeTo(__razor_helper_writer, "style", Tuple.Create(" style=\"", 4335), Tuple.Create("\"", 4373) 187 , Tuple.Create(Tuple.Create("", 4343), Tuple.Create("height:", 4343), true) 188 189 #line 128 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 190 , Tuple.Create(Tuple.Create(" ", 4350), Tuple.Create<System.Object, System.Int32>(productItemHeight 191 192 #line default 193 #line hidden 194 , 4351), false) 195 , Tuple.Create(Tuple.Create("", 4371), Tuple.Create("mm", 4371), true) 196 ); 197 198 WriteLiteralTo(__razor_helper_writer, ">\r\n\r\n <td>\r\n <img"); 199 200 WriteAttributeTo(__razor_helper_writer, "src", Tuple.Create(" src=\"", 4449), Tuple.Create("\"", 4499) 201 202 #line 131 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 203 , Tuple.Create(Tuple.Create("", 4455), Tuple.Create<System.Object, System.Int32>(GetProductImage(product) 204 205 #line default 206 #line hidden 207 , 4455), false) 208 , Tuple.Create(Tuple.Create("", 4480), Tuple.Create("?hash=", 4480), true) 209 210 #line 131 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 211 , Tuple.Create(Tuple.Create("", 4486), Tuple.Create<System.Object, System.Int32>(DateTime.Now 212 213 #line default 214 #line hidden 215 , 4486), false) 216 ); 217 218 WriteAttributeTo(__razor_helper_writer, "style", Tuple.Create(" style=\"", 4500), Tuple.Create("\"", 4539) 219 , Tuple.Create(Tuple.Create("", 4508), Tuple.Create("height:", 4508), true) 220 221 #line 131 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 222 , Tuple.Create(Tuple.Create(" ", 4515), Tuple.Create<System.Object, System.Int32>(productImageHeight 223 224 #line default 225 #line hidden 226 , 4516), false) 227 , Tuple.Create(Tuple.Create("", 4537), Tuple.Create("mm", 4537), true) 228 ); 229 230 WriteLiteralTo(__razor_helper_writer, " />\r\n </td>\r\n\r\n <td>\r\n " + 231 " <div"); 232 233 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-product-number\""); 234 235 WriteLiteralTo(__razor_helper_writer, ">"); 236 237 238 #line 135 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 239 WriteTo(__razor_helper_writer, product.GetString("Ecom:Product.Number")); 240 241 242 #line default 243 #line hidden 244 WriteLiteralTo(__razor_helper_writer, "</div>\r\n <div"); 245 246 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-product-title\""); 247 248 WriteLiteralTo(__razor_helper_writer, ">"); 249 250 251 #line 136 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 252 WriteTo(__razor_helper_writer, productName); 253 254 255 #line default 256 #line hidden 257 WriteLiteralTo(__razor_helper_writer, "</div>\r\n </td>\r\n\r\n"); 258 259 260 #line 139 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 261 262 263 #line default 264 #line hidden 265 266 #line 139 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 267 if (!Convert.ToBoolean(Pageview.CurrentParagraph.Item["HidePrice"])) 268 { 269 270 271 #line default 272 #line hidden 273 WriteLiteralTo(__razor_helper_writer, " <td"); 274 275 WriteLiteralTo(__razor_helper_writer, " style=\"width: 30mm\""); 276 277 WriteLiteralTo(__razor_helper_writer, ">\r\n <div"); 278 279 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-product-price\""); 280 281 WriteLiteralTo(__razor_helper_writer, ">"); 282 283 284 #line 142 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 285 WriteTo(__razor_helper_writer, productPrice); 286 287 288 #line default 289 #line hidden 290 WriteLiteralTo(__razor_helper_writer, "</div>\r\n <div"); 291 292 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-product-before-price\""); 293 294 WriteLiteralTo(__razor_helper_writer, ">"); 295 296 297 #line 143 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 298 WriteTo(__razor_helper_writer, productBeforePrice); 299 300 301 #line default 302 #line hidden 303 WriteLiteralTo(__razor_helper_writer, "</div>\r\n </td>\r\n"); 304 305 306 #line 145 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 307 } 308 309 310 #line default 311 #line hidden 312 WriteLiteralTo(__razor_helper_writer, " </tr>\r\n"); 313 314 315 #line 147 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 316 } 317 318 319 #line default 320 #line hidden 321 WriteLiteralTo(__razor_helper_writer, " </table>\r\n </div>\r\n"); 322 323 WriteLiteralTo(__razor_helper_writer, " "); 324 325 326 #line 150 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 327 WriteTo(__razor_helper_writer, RenderPaperFooter()); 328 329 330 #line default 331 #line hidden 332 WriteLiteralTo(__razor_helper_writer, "\r\n </div>\r\n </section>\r\n"); 333 334 335 #line 153 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 336 337 338 #line default 339 #line hidden 340 }); 341 342 #line 153 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 343 } 344 #line default 345 #line hidden 346 347 348 #line 154 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 349 public RazorEngine.Templating.TemplateWriter RenderPaperHeader() 350 { 351 #line default 352 #line hidden 353 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => { 354 355 #line 155 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 356 357 string pageMargin = GetParentSettingsItem("Margin") != null ? GetParentSettingsItem("Margin") : "10"; 358 359 var colorService = new ColorSwatchService(); 360 var headerSettings = Dynamicweb.Content.Items.Item.GetItemById("SparePartsHeader", GetParentSettingsItem("Header")); 361 362 string headerBackgroundColor = headerSettings["BackgroundColor"] != null ? headerSettings["BackgroundColor"].ToString() : ""; 363 headerBackgroundColor = !headerBackgroundColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, headerBackgroundColor) : headerBackgroundColor; 364 365 string headerFontColor = headerSettings["FontColor"] != null ? headerSettings["FontColor"].ToString() : ""; 366 headerFontColor = !headerFontColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, headerFontColor) : headerFontColor; 367 368 string headerLayout = headerSettings["Layout"] != null ? headerSettings["Layout"].ToString() : "1"; 369 370 371 372 #line default 373 #line hidden 374 WriteLiteralTo(__razor_helper_writer, " <div"); 375 376 WriteAttributeTo(__razor_helper_writer, "class", Tuple.Create(" class=\"", 6443), Tuple.Create("\"", 6523) 377 , Tuple.Create(Tuple.Create("", 6451), Tuple.Create("sheet-container__header", 6451), true) 378 , Tuple.Create(Tuple.Create(" ", 6474), Tuple.Create("sheet-container__header--padding-", 6475), true) 379 380 #line 169 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 381 , Tuple.Create(Tuple.Create("", 6508), Tuple.Create<System.Object, System.Int32>(pageMargin 382 383 #line default 384 #line hidden 385 , 6508), false) 386 , Tuple.Create(Tuple.Create("", 6521), Tuple.Create("mm", 6521), true) 387 ); 388 389 WriteAttributeTo(__razor_helper_writer, "style", Tuple.Create(" style=\"", 6524), Tuple.Create("\"", 6601) 390 , Tuple.Create(Tuple.Create("", 6532), Tuple.Create("background-color:", 6532), true) 391 392 #line 169 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 393 , Tuple.Create(Tuple.Create(" ", 6549), Tuple.Create<System.Object, System.Int32>(headerBackgroundColor 394 395 #line default 396 #line hidden 397 , 6550), false) 398 , Tuple.Create(Tuple.Create("", 6574), Tuple.Create(";", 6574), true) 399 , Tuple.Create(Tuple.Create(" ", 6575), Tuple.Create("color:", 6576), true) 400 401 #line 169 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 402 , Tuple.Create(Tuple.Create(" ", 6582), Tuple.Create<System.Object, System.Int32>(headerFontColor 403 404 #line default 405 #line hidden 406 , 6583), false) 407 ); 408 409 WriteLiteralTo(__razor_helper_writer, ">\r\n\r\n"); 410 411 WriteLiteralTo(__razor_helper_writer, " "); 412 413 414 #line 171 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 415 WriteTo(__razor_helper_writer, RenderHeaderLayout1()); 416 417 418 #line default 419 #line hidden 420 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n </div>\r\n"); 421 422 423 #line 174 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 424 425 426 #line default 427 #line hidden 428 }); 429 430 #line 174 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 431 } 432 #line default 433 #line hidden 434 435 436 #line 175 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 437 public RazorEngine.Templating.TemplateWriter RenderHeaderLayout1() 438 { 439 #line default 440 #line hidden 441 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => { 442 443 #line 176 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 444 445 DateTime serverTime = DateTime.Now; 446 string date = serverTime.Date.ToString("dd/MM/yyyy"); 447 var headerSettings = Dynamicweb.Content.Items.Item.GetItemById("SparePartsHeader", GetParentSettingsItem("Header")); 448 449 450 451 #line default 452 #line hidden 453 WriteLiteralTo(__razor_helper_writer, " <div"); 454 455 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-header-left\""); 456 457 WriteLiteralTo(__razor_helper_writer, ">\r\n"); 458 459 460 #line 182 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 461 462 463 #line default 464 #line hidden 465 466 #line 182 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 467 if (headerSettings["Logo"] != null) 468 { 469 if (!String.IsNullOrEmpty(headerSettings["Logo"].ToString())) 470 { 471 472 473 #line default 474 #line hidden 475 WriteLiteralTo(__razor_helper_writer, " <div"); 476 477 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-footer-logo\""); 478 479 WriteLiteralTo(__razor_helper_writer, ">\r\n <img"); 480 481 WriteAttributeTo(__razor_helper_writer, "src", Tuple.Create(" src=\"", 7171), Tuple.Create("\"", 7211) 482 483 #line 187 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 484 , Tuple.Create(Tuple.Create("", 7177), Tuple.Create<System.Object, System.Int32>(headerSettings["Logo"].ToString() 485 486 #line default 487 #line hidden 488 , 7177), false) 489 ); 490 491 WriteLiteralTo(__razor_helper_writer, " />\r\n </div>\r\n"); 492 493 494 #line 189 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 495 } 496 else 497 { 498 499 500 #line default 501 #line hidden 502 WriteLiteralTo(__razor_helper_writer, " "); 503 504 WriteLiteralTo(__razor_helper_writer, "&nbsp;"); 505 506 WriteLiteralTo(__razor_helper_writer, "\r\n"); 507 508 509 #line 193 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 510 } 511 } 512 else 513 { 514 515 516 #line default 517 #line hidden 518 WriteLiteralTo(__razor_helper_writer, " "); 519 520 WriteLiteralTo(__razor_helper_writer, "&nbsp;"); 521 522 WriteLiteralTo(__razor_helper_writer, "\r\n"); 523 524 525 #line 198 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 526 } 527 528 529 #line default 530 #line hidden 531 WriteLiteralTo(__razor_helper_writer, " </div>\r\n"); 532 533 WriteLiteralTo(__razor_helper_writer, " <div"); 534 535 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-header-center\""); 536 537 WriteLiteralTo(__razor_helper_writer, ">\r\n"); 538 539 540 #line 201 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 541 542 543 #line default 544 #line hidden 545 546 #line 201 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 547 if (!String.IsNullOrEmpty(Pageview.CurrentParagraph.Item["Title"].ToString())) 548 { 549 550 551 #line default 552 #line hidden 553 WriteLiteralTo(__razor_helper_writer, " <div"); 554 555 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-header-title\""); 556 557 WriteLiteralTo(__razor_helper_writer, ">"); 558 559 560 #line 203 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 561 WriteTo(__razor_helper_writer, Pageview.CurrentParagraph.Item["Title"]); 562 563 564 #line default 565 #line hidden 566 WriteLiteralTo(__razor_helper_writer, "</div>\r\n"); 567 568 569 #line 204 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 570 } 571 else 572 { 573 574 575 #line default 576 #line hidden 577 WriteLiteralTo(__razor_helper_writer, " "); 578 579 WriteLiteralTo(__razor_helper_writer, "&nbsp;"); 580 581 WriteLiteralTo(__razor_helper_writer, "\r\n"); 582 583 584 #line 208 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 585 } 586 587 588 #line default 589 #line hidden 590 WriteLiteralTo(__razor_helper_writer, " </div>\r\n"); 591 592 WriteLiteralTo(__razor_helper_writer, " <div"); 593 594 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-header-right\""); 595 596 WriteLiteralTo(__razor_helper_writer, ">\r\n"); 597 598 599 #line 211 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 600 601 602 #line default 603 #line hidden 604 605 #line 211 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 606 if (Convert.ToBoolean(headerSettings["ShowDate"])) 607 { 608 609 610 #line default 611 #line hidden 612 WriteLiteralTo(__razor_helper_writer, " <div"); 613 614 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-header-date\""); 615 616 WriteLiteralTo(__razor_helper_writer, ">"); 617 618 619 #line 213 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 620 WriteTo(__razor_helper_writer, date); 621 622 623 #line default 624 #line hidden 625 WriteLiteralTo(__razor_helper_writer, "</div>\r\n"); 626 627 628 #line 214 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 629 } 630 else 631 { 632 633 634 #line default 635 #line hidden 636 WriteLiteralTo(__razor_helper_writer, " "); 637 638 WriteLiteralTo(__razor_helper_writer, "&nbsp;"); 639 640 WriteLiteralTo(__razor_helper_writer, "\r\n"); 641 642 643 #line 218 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 644 } 645 646 647 #line default 648 #line hidden 649 WriteLiteralTo(__razor_helper_writer, " </div>\r\n"); 650 651 652 #line 220 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 653 654 655 #line default 656 #line hidden 657 }); 658 659 #line 220 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 660 } 661 #line default 662 #line hidden 663 664 665 #line 221 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 666 public RazorEngine.Templating.TemplateWriter RenderPaperFooter() 667 { 668 #line default 669 #line hidden 670 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => { 671 672 #line 222 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 673 674 string pageMargin = GetParentSettingsItem("Margin") != null ? GetParentSettingsItem("Margin") : "10"; 675 676 pageNumber = 1; 677 if (System.Web.HttpContext.Current.Items.Contains("PaperPageNumber")) 678 { 679 pageNumber = Convert.ToInt32(System.Web.HttpContext.Current.Items["PaperPageNumber"]); 680 pageNumber++; 681 System.Web.HttpContext.Current.Items["PaperPageNumber"] = pageNumber; 682 } 683 else 684 { 685 System.Web.HttpContext.Current.Items.Add("PaperPageNumber", pageNumber); 686 } 687 688 var colorService = new ColorSwatchService(); 689 var footerSettings = Dynamicweb.Content.Items.Item.GetItemById("SparePartsFooter", GetParentSettingsItem("Footer")); 690 691 string footerBackgroundColor = footerSettings["BackgroundColor"] != null ? footerSettings["BackgroundColor"].ToString() : ""; 692 footerBackgroundColor = !footerBackgroundColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, footerBackgroundColor) : footerBackgroundColor; 693 694 string footerFontColor = footerSettings["FontColor"] != null ? footerSettings["FontColor"].ToString() : ""; 695 footerFontColor = !footerFontColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, footerFontColor) : footerFontColor; 696 697 string footerLayout = footerSettings["Layout"] != null ? footerSettings["Layout"].ToString() : "1"; 698 699 700 701 #line default 702 #line hidden 703 WriteLiteralTo(__razor_helper_writer, " <div"); 704 705 WriteAttributeTo(__razor_helper_writer, "class", Tuple.Create(" class=\"", 9403), Tuple.Create("\"", 9483) 706 , Tuple.Create(Tuple.Create("", 9411), Tuple.Create("sheet-container__footer", 9411), true) 707 , Tuple.Create(Tuple.Create(" ", 9434), Tuple.Create("sheet-container__footer--padding-", 9435), true) 708 709 #line 248 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 710 , Tuple.Create(Tuple.Create("", 9468), Tuple.Create<System.Object, System.Int32>(pageMargin 711 712 #line default 713 #line hidden 714 , 9468), false) 715 , Tuple.Create(Tuple.Create("", 9481), Tuple.Create("mm", 9481), true) 716 ); 717 718 WriteAttributeTo(__razor_helper_writer, "style", Tuple.Create(" style=\"", 9484), Tuple.Create("\"", 9561) 719 , Tuple.Create(Tuple.Create("", 9492), Tuple.Create("background-color:", 9492), true) 720 721 #line 248 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 722 , Tuple.Create(Tuple.Create(" ", 9509), Tuple.Create<System.Object, System.Int32>(footerBackgroundColor 723 724 #line default 725 #line hidden 726 , 9510), false) 727 , Tuple.Create(Tuple.Create("", 9534), Tuple.Create(";", 9534), true) 728 , Tuple.Create(Tuple.Create(" ", 9535), Tuple.Create("color:", 9536), true) 729 730 #line 248 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 731 , Tuple.Create(Tuple.Create(" ", 9542), Tuple.Create<System.Object, System.Int32>(footerFontColor 732 733 #line default 734 #line hidden 735 , 9543), false) 736 ); 737 738 WriteLiteralTo(__razor_helper_writer, ">\r\n"); 739 740 WriteLiteralTo(__razor_helper_writer, " "); 741 742 743 #line 249 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 744 WriteTo(__razor_helper_writer, RenderFooterLayout1()); 745 746 747 #line default 748 #line hidden 749 WriteLiteralTo(__razor_helper_writer, "\r\n </div>\r\n"); 750 751 752 #line 251 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 753 754 755 #line default 756 #line hidden 757 }); 758 759 #line 251 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 760 } 761 #line default 762 #line hidden 763 764 765 #line 252 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 766 public RazorEngine.Templating.TemplateWriter RenderFooterLayout1() 767 { 768 #line default 769 #line hidden 770 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => { 771 772 #line 253 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 773 774 var footerSettings = Dynamicweb.Content.Items.Item.GetItemById("SparePartsFooter", GetParentSettingsItem("Footer")); 775 776 777 778 #line default 779 #line hidden 780 WriteLiteralTo(__razor_helper_writer, " <div"); 781 782 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-footer-left\""); 783 784 WriteLiteralTo(__razor_helper_writer, ">\r\n"); 785 786 787 #line 257 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 788 789 790 #line default 791 #line hidden 792 793 #line 257 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 794 if (footerSettings["Logo"] != null) 795 { 796 if (!String.IsNullOrEmpty(footerSettings["Logo"].ToString())) 797 { 798 string logo = footerSettings["Logo"].ToString(); 799 if (Path.GetExtension(logo).ToLower() != ".svg") 800 { 801 logo = "/Admin/Public/GetImage.ashx?height=20&amp;crop=5&amp;Compression=75&amp;image=" + logo; 802 } 803 else 804 { 805 logo = HttpUtility.UrlDecode(logo); 806 } 807 808 809 810 811 #line default 812 #line hidden 813 WriteLiteralTo(__razor_helper_writer, " <div"); 814 815 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-footer-logo\""); 816 817 WriteLiteralTo(__razor_helper_writer, ">\r\n <img"); 818 819 WriteAttributeTo(__razor_helper_writer, "src", Tuple.Create(" src=\"", 10435), Tuple.Create("\"", 10446) 820 821 #line 273 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 822 , Tuple.Create(Tuple.Create("", 10441), Tuple.Create<System.Object, System.Int32>(logo 823 824 #line default 825 #line hidden 826 , 10441), false) 827 ); 828 829 WriteLiteralTo(__razor_helper_writer, " />\r\n </div>\r\n"); 830 831 832 #line 275 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 833 } 834 else 835 { 836 837 838 #line default 839 #line hidden 840 WriteLiteralTo(__razor_helper_writer, " "); 841 842 WriteLiteralTo(__razor_helper_writer, "&nbsp;"); 843 844 WriteLiteralTo(__razor_helper_writer, "\r\n"); 845 846 847 #line 279 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 848 } 849 } 850 else 851 { 852 853 854 #line default 855 #line hidden 856 WriteLiteralTo(__razor_helper_writer, " "); 857 858 WriteLiteralTo(__razor_helper_writer, "&nbsp;"); 859 860 WriteLiteralTo(__razor_helper_writer, "\r\n"); 861 862 863 #line 284 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 864 } 865 866 867 #line default 868 #line hidden 869 WriteLiteralTo(__razor_helper_writer, " </div>\r\n"); 870 871 WriteLiteralTo(__razor_helper_writer, " <div"); 872 873 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-footer-center\""); 874 875 WriteLiteralTo(__razor_helper_writer, ">\r\n &nbsp;\r\n </div>\r\n"); 876 877 WriteLiteralTo(__razor_helper_writer, " <div"); 878 879 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-footer-right\""); 880 881 WriteLiteralTo(__razor_helper_writer, ">\r\n"); 882 883 884 #line 290 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 885 886 887 #line default 888 #line hidden 889 890 #line 290 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 891 if (footerSettings["ShowPageNumber"] != null) 892 { 893 if (Convert.ToBoolean(footerSettings["ShowPageNumber"])) 894 { 895 896 897 #line default 898 #line hidden 899 WriteLiteralTo(__razor_helper_writer, " <div"); 900 901 WriteLiteralTo(__razor_helper_writer, " class=\"sheet-footer-page-number\""); 902 903 WriteLiteralTo(__razor_helper_writer, ">\r\n"); 904 905 WriteLiteralTo(__razor_helper_writer, " "); 906 907 908 #line 295 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 909 WriteTo(__razor_helper_writer, pageNumber); 910 911 912 #line default 913 #line hidden 914 WriteLiteralTo(__razor_helper_writer, "\r\n </div>\r\n"); 915 916 917 #line 297 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 918 } 919 else 920 { 921 922 923 #line default 924 #line hidden 925 WriteLiteralTo(__razor_helper_writer, " "); 926 927 WriteLiteralTo(__razor_helper_writer, "&nbsp;"); 928 929 WriteLiteralTo(__razor_helper_writer, "\r\n"); 930 931 932 #line 301 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 933 } 934 } 935 else 936 { 937 938 939 #line default 940 #line hidden 941 WriteLiteralTo(__razor_helper_writer, " "); 942 943 WriteLiteralTo(__razor_helper_writer, "&nbsp;"); 944 945 WriteLiteralTo(__razor_helper_writer, "\r\n"); 946 947 948 #line 306 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 949 } 950 951 952 #line default 953 #line hidden 954 WriteLiteralTo(__razor_helper_writer, " </div>\r\n"); 955 956 957 #line 308 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 958 959 960 #line default 961 #line hidden 962 }); 963 964 #line 308 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 965 } 966 #line default 967 #line hidden 968 969 970 public RazorEngine_4c32067bee3c4e069fb5ac8e8e651016() { 971 } 972 973 public override void Execute() { 974 WriteLiteral("\r\n\r\n"); 975 976 WriteLiteral("[Include file \'../../GetProductImage.cshtml\' not found in \'Templates/Designs/Dwsi" + 977 "mple/eCom/Productlist/SparePartsProductListPDF.cshtml\']\r\n\r\n"); 978 979 WriteLiteral("\r\n"); 980 981 982 #line 46 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 983 984 int productsOnSheet = 14; 985 int sheetMargin = GetParentSettingsItem("Margin") != null ? Convert.ToInt32(GetParentSettingsItem("Margin")) : 10; 986 int sheetHeight = 296; 987 int sheetWidth = 210; 988 int headerHeight = 15; 989 int footerHeight = 15; 990 991 string pageSize = "a4"; 992 pageOrientation = "portrait"; 993 994 if (pageOrientation == "portrait") 995 { 996 sheetHeight = 296; 997 sheetWidth = 210; 998 } 999 else 1000 { 1001 sheetHeight = 209; 1002 sheetWidth = 296; 1003 } 1004 1005 1006 productsOnSheet = 22; 1007 1008 1009 //Add a buffer to the height 1010 heightBuffer = 30; 1011 sheetHeight = sheetHeight - heightBuffer; 1012 1013 contentHeight = (sheetHeight - (headerHeight + footerHeight + (sheetMargin * 2))); 1014 contentWidth = (sheetWidth - (sheetMargin * 2)); 1015 productItemHeight = (contentHeight - 2) / productsOnSheet; 1016 1017 List<LoopItem> productListPart = new List<LoopItem>(); 1018 int count = 1; 1019 1020 foreach (LoopItem product in GetLoop("Products")) 1021 { 1022 productListPart.Add(product); 1023 1024 if (count < productsOnSheet) 1025 { 1026 count++; 1027 } 1028 else 1029 { 1030 1031 1032 #line default 1033 #line hidden 1034 1035 #line 93 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 1036 Write(RenderProductSheet(productListPart)); 1037 1038 1039 #line default 1040 #line hidden 1041 1042 #line 93 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 1043 ; 1044 1045 productListPart.Clear(); 1046 count = 1; 1047 } 1048 } 1049 1050 if (count != 1) 1051 { 1052 1053 1054 #line default 1055 #line hidden 1056 1057 #line 102 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 1058 Write(RenderProductSheet(productListPart)); 1059 1060 1061 #line default 1062 #line hidden 1063 1064 #line 102 "D:\dynamicweb.net\Solutions\interspiro.cloud.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\eCom\Productlist\SparePartsProductListPDF.cshtml" 1065 ; 1066 } 1067 1068 1069 #line default 1070 #line hidden 1071 WriteLiteral("\r\n\r\n\r\n"); 1072 1073 } 1074 } 1075 } 1076

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using Dynamicweb.Content.Items 3 @using System 4 @using System.IO 5 @using System.Web 6 @using System.Collections.Generic; 7 8 9 @functions{ 10 public string GetParentSettingsItem(string systemName) 11 { 12 string item = null; 13 14 Dynamicweb.Content.Page current = Dynamicweb.Services.Pages.GetPage(Pageview.Page.ID); 15 while (current != null && current.Parent != current) 16 { 17 var temp = current.Item != null ? current.Item[systemName] : ""; 18 19 if (temp != null) 20 { 21 item = temp.ToString(); 22 23 if (!String.IsNullOrEmpty(item) && !String.Equals("default", item, StringComparison.OrdinalIgnoreCase)) 24 { 25 break; 26 } 27 } 28 29 current = current.Parent; 30 } 31 32 return item; 33 } 34 } 35 [Include file '../../GetProductImage.cshtml' not found in 'Templates/Designs/Dwsimple/eCom/Productlist/SparePartsProductListPDF.cshtml'] 36 37 @functions { 38 int heightBuffer; 39 int contentHeight; 40 int contentWidth; 41 int productItemHeight; 42 string pageOrientation; 43 int pageNumber; 44 } 45 46 @{ 47 int productsOnSheet = 14; 48 int sheetMargin = GetParentSettingsItem("Margin") != null ? Convert.ToInt32(GetParentSettingsItem("Margin")) : 10; 49 int sheetHeight = 296; 50 int sheetWidth = 210; 51 int headerHeight = 15; 52 int footerHeight = 15; 53 54 string pageSize = "a4"; 55 pageOrientation = "portrait"; 56 57 if (pageOrientation == "portrait") 58 { 59 sheetHeight = 296; 60 sheetWidth = 210; 61 } 62 else 63 { 64 sheetHeight = 209; 65 sheetWidth = 296; 66 } 67 68 69 productsOnSheet = 22; 70 71 72 //Add a buffer to the height 73 heightBuffer = 30; 74 sheetHeight = sheetHeight - heightBuffer; 75 76 contentHeight = (sheetHeight - (headerHeight + footerHeight + (sheetMargin * 2))); 77 contentWidth = (sheetWidth - (sheetMargin * 2)); 78 productItemHeight = (contentHeight - 2) / productsOnSheet; 79 80 List<LoopItem> productListPart = new List<LoopItem>(); 81 int count = 1; 82 83 foreach (LoopItem product in GetLoop("Products")) 84 { 85 productListPart.Add(product); 86 87 if (count < productsOnSheet) 88 { 89 count++; 90 } 91 else 92 { 93 @RenderProductSheet(productListPart); 94 95 productListPart.Clear(); 96 count = 1; 97 } 98 } 99 100 if (count != 1) 101 { 102 @RenderProductSheet(productListPart); 103 } 104 } 105 106 107 @helper RenderProductSheet(dynamic products) 108 { 109 string pageMargin = GetParentSettingsItem("Margin") != null ? GetParentSettingsItem("Margin") : "10"; 110 111 112 <section class="sheet"> 113 <div class="sheet-container sheet-container--flex-col"> 114 @RenderPaperHeader() 115 116 <div class="sheet-container__content sheet-container__content--padding-@(pageMargin)mm" style="height: @(contentHeight + heightBuffer)mm"> 117 <table class="sheet-product-table"> 118 119 @foreach (LoopItem product in products) 120 { 121 string productName = product.GetString("Ecom:Product.Name"); 122 productName += !String.IsNullOrEmpty(product.GetString("Ecom:Product.SelectedVariantComboName")) ? ", " + product.GetString("Ecom:Product.SelectedVariantComboName") : ""; 123 string productPrice = product.GetString("Ecom:Product.Discount.Price.PriceFormatted") != product.GetString("Ecom:Product.Price.PriceFormatted") ? product.GetString("Ecom:Product.Discount.Price.PriceFormatted") : product.GetString("Ecom:Product.Price.PriceFormatted"); 124 string productBeforePrice = product.GetString("Ecom:Product.Discount.Price.PriceFormatted") != product.GetString("Ecom:Product.Price.PriceFormatted") ? product.GetString("Ecom:Product.Price.PriceFormatted") : ""; 125 string productNameWidth = productItemHeight < 20 ? "width: 40mm; " : ""; 126 int productImageHeight = productItemHeight < 15 ? 6 : productItemHeight - 4; 127 128 <tr class="sheet-product-table-item" style="height: @(productItemHeight)mm"> 129 130 <td> 131 <img src="@GetProductImage(product)?hash=@DateTime.Now" style="height: @(productImageHeight)mm" /> 132 </td> 133 134 <td> 135 <div class="sheet-product-number">@product.GetString("Ecom:Product.Number")</div> 136 <div class="sheet-product-title">@productName</div> 137 </td> 138 139 @if (!Convert.ToBoolean(Pageview.CurrentParagraph.Item["HidePrice"])) 140 { 141 <td style="width: 30mm"> 142 <div class="sheet-product-price">@productPrice</div> 143 <div class="sheet-product-before-price">@productBeforePrice</div> 144 </td> 145 } 146 </tr> 147 } 148 </table> 149 </div> 150 @RenderPaperFooter() 151 </div> 152 </section> 153 } 154 @helper RenderPaperHeader() 155 { 156 string pageMargin = GetParentSettingsItem("Margin") != null ? GetParentSettingsItem("Margin") : "10"; 157 158 var colorService = new ColorSwatchService(); 159 var headerSettings = Dynamicweb.Content.Items.Item.GetItemById("SparePartsHeader", GetParentSettingsItem("Header")); 160 161 string headerBackgroundColor = headerSettings["BackgroundColor"] != null ? headerSettings["BackgroundColor"].ToString() : ""; 162 headerBackgroundColor = !headerBackgroundColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, headerBackgroundColor) : headerBackgroundColor; 163 164 string headerFontColor = headerSettings["FontColor"] != null ? headerSettings["FontColor"].ToString() : ""; 165 headerFontColor = !headerFontColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, headerFontColor) : headerFontColor; 166 167 string headerLayout = headerSettings["Layout"] != null ? headerSettings["Layout"].ToString() : "1"; 168 169 <div class="sheet-container__header sheet-container__header--padding-@(pageMargin)mm" style="background-color: @(headerBackgroundColor); color: @(headerFontColor)"> 170 171 @RenderHeaderLayout1() 172 173 </div> 174 } 175 @helper RenderHeaderLayout1() 176 { 177 DateTime serverTime = DateTime.Now; 178 string date = serverTime.Date.ToString("dd/MM/yyyy"); 179 var headerSettings = Dynamicweb.Content.Items.Item.GetItemById("SparePartsHeader", GetParentSettingsItem("Header")); 180 181 <div class="sheet-header-left"> 182 @if (headerSettings["Logo"] != null) 183 { 184 if (!String.IsNullOrEmpty(headerSettings["Logo"].ToString())) 185 { 186 <div class="sheet-footer-logo"> 187 <img src="@headerSettings["Logo"].ToString()" /> 188 </div> 189 } 190 else 191 { 192 <text>&nbsp;</text> 193 } 194 } 195 else 196 { 197 <text>&nbsp;</text> 198 } 199 </div> 200 <div class="sheet-header-center"> 201 @if (!String.IsNullOrEmpty(Pageview.CurrentParagraph.Item["Title"].ToString())) 202 { 203 <div class="sheet-header-title">@Pageview.CurrentParagraph.Item["Title"]</div> 204 } 205 else 206 { 207 <text>&nbsp;</text> 208 } 209 </div> 210 <div class="sheet-header-right"> 211 @if (Convert.ToBoolean(headerSettings["ShowDate"])) 212 { 213 <div class="sheet-header-date">@date</div> 214 } 215 else 216 { 217 <text>&nbsp;</text> 218 } 219 </div> 220 } 221 @helper RenderPaperFooter() 222 { 223 string pageMargin = GetParentSettingsItem("Margin") != null ? GetParentSettingsItem("Margin") : "10"; 224 225 pageNumber = 1; 226 if (System.Web.HttpContext.Current.Items.Contains("PaperPageNumber")) 227 { 228 pageNumber = Convert.ToInt32(System.Web.HttpContext.Current.Items["PaperPageNumber"]); 229 pageNumber++; 230 System.Web.HttpContext.Current.Items["PaperPageNumber"] = pageNumber; 231 } 232 else 233 { 234 System.Web.HttpContext.Current.Items.Add("PaperPageNumber", pageNumber); 235 } 236 237 var colorService = new ColorSwatchService(); 238 var footerSettings = Dynamicweb.Content.Items.Item.GetItemById("SparePartsFooter", GetParentSettingsItem("Footer")); 239 240 string footerBackgroundColor = footerSettings["BackgroundColor"] != null ? footerSettings["BackgroundColor"].ToString() : ""; 241 footerBackgroundColor = !footerBackgroundColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, footerBackgroundColor) : footerBackgroundColor; 242 243 string footerFontColor = footerSettings["FontColor"] != null ? footerSettings["FontColor"].ToString() : ""; 244 footerFontColor = !footerFontColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, footerFontColor) : footerFontColor; 245 246 string footerLayout = footerSettings["Layout"] != null ? footerSettings["Layout"].ToString() : "1"; 247 248 <div class="sheet-container__footer sheet-container__footer--padding-@(pageMargin)mm" style="background-color: @(footerBackgroundColor); color: @(footerFontColor)"> 249 @RenderFooterLayout1() 250 </div> 251 } 252 @helper RenderFooterLayout1() 253 { 254 var footerSettings = Dynamicweb.Content.Items.Item.GetItemById("SparePartsFooter", GetParentSettingsItem("Footer")); 255 256 <div class="sheet-footer-left"> 257 @if (footerSettings["Logo"] != null) 258 { 259 if (!String.IsNullOrEmpty(footerSettings["Logo"].ToString())) 260 { 261 string logo = footerSettings["Logo"].ToString(); 262 if (Path.GetExtension(logo).ToLower() != ".svg") 263 { 264 logo = "/Admin/Public/GetImage.ashx?height=20&amp;crop=5&amp;Compression=75&amp;image=" + logo; 265 } 266 else 267 { 268 logo = HttpUtility.UrlDecode(logo); 269 } 270 271 272 <div class="sheet-footer-logo"> 273 <img src="@logo" /> 274 </div> 275 } 276 else 277 { 278 <text>&nbsp;</text> 279 } 280 } 281 else 282 { 283 <text>&nbsp;</text> 284 } 285 </div> 286 <div class="sheet-footer-center"> 287 &nbsp; 288 </div> 289 <div class="sheet-footer-right"> 290 @if (footerSettings["ShowPageNumber"] != null) 291 { 292 if (Convert.ToBoolean(footerSettings["ShowPageNumber"])) 293 { 294 <div class="sheet-footer-page-number"> 295 @pageNumber 296 </div> 297 } 298 else 299 { 300 <text>&nbsp;</text> 301 } 302 } 303 else 304 { 305 <text>&nbsp;</text> 306 } 307 </div> 308 } 309

Akzeptiere Cookies von dieser Seite

Diese Website verwendet Cookies, um Ihre Erfahrung auf der Website zu verbessern. Indem Sie auf „Akzeptiere“ klicken, stimmen Sie unserer Datenschutz-Richtlinie und Cookie-Richtlinie zu.