Error compiling template "/Designs/eCommerce/Paragraph/FavoriteList_Print.cshtml"
Line 44: The type or namespace name 'User' does not exist in the namespace 'Dynamicweb.Modules.UserManagement' (are you missing an assembly reference?)
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 using System;
13 using System.Collections.Generic;
14 using System.Linq;
15
16 #line 1 "C:\home\site\wwwroot\Files\Templates\Designs\eCommerce\Paragraph\FavoriteList_Print.cshtml"
17 using System.Web;
18
19 #line default
20 #line hidden
21
22
23 public class RazorEngine_78732ed017b6467b99fa380efc21063f : Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> {
24
25 #line hidden
26
27 public RazorEngine_78732ed017b6467b99fa380efc21063f() {
28 }
29
30 public override void Execute() {
31 WriteLiteral("<script");
32
33 WriteLiteral(" src=\"/scripts/bundled/html4Andhtml5/jquery.history.js\"");
34
35 WriteLiteral("></script>\r\n<style>\r\n table tr td {\r\n page-break-inside: avoid !imp" +
36 "ortant;\r\n }\r\n \r\n footer { display: none; }\r\n /*.avoidBreak {\r\n " +
37 " page-break-inside: avoid !important;\r\n margin: 4px 0 4px 0; \r\n }*/\r\n</sty" +
38 "le>\r\n");
39
40
41 #line 14 "C:\home\site\wwwroot\Files\Templates\Designs\eCommerce\Paragraph\FavoriteList_Print.cshtml"
42
43 var userName = "";
44 var user = Dynamicweb.Modules.UserManagement.User.GetCurrentUser();
45 if (String.IsNullOrEmpty(user.Company))
46 {
47 // userName = user.UserName;
48 userName = user.Company;
49
50 }
51 else
52 {
53 userName = user.Company;
54 }
55
56
57 #line default
58 #line hidden
59 WriteLiteral("\r\n<!--$$If Not(Global:Extranet.Groups<contains>\'3121\')-->\r\n<!--$$LoopStart(Favori" +
60 "teList)-->\r\n<input");
61
62 WriteLiteral(" class=\"masterFavlist\"");
63
64 WriteLiteral(" type=\"hidden\"");
65
66 WriteLiteral(" value=\"false\"");
67
68 WriteLiteral(" />\r\n<!--$$LoopEnd(FavoriteList)-->\r\n<!--$$Else-->\r\n<input");
69
70 WriteLiteral(" class=\"masterFavlist\"");
71
72 WriteLiteral(" type=\"hidden\"");
73
74 WriteLiteral(" value=\"true\"");
75
76 WriteLiteral(" />\r\n<!--$$EndIf-->\r\n<h3>Favoritliste ");
77
78
79 #line 35 "C:\home\site\wwwroot\Files\Templates\Designs\eCommerce\Paragraph\FavoriteList_Print.cshtml"
80 Write(userName);
81
82
83 #line default
84 #line hidden
85 WriteLiteral("</h3>\r\n<table");
86
87 WriteLiteral(" class=\"table table-bordered table-striped dontSplit\"");
88
89 WriteLiteral(">\r\n <thead>\r\n <tr><th");
90
91 WriteLiteral(" style=\"width: 150px;\"");
92
93 WriteLiteral(">Billede</th><th>Beskrivelse</th><th>Varenr.:</th><th>EAN</th><th>Pris (pr. stk. " +
94 "ekskl. moms)</th><th>Antal pr. kolli</th></tr>\r\n </thead>\r\n <tbody");
95
96 WriteLiteral(" id=\"ListProducts\"");
97
98 WriteLiteral("></tbody>\r\n</table>\r\n<div");
99
100 WriteLiteral(" class=\"hidden\"");
101
102 WriteLiteral(" id=\"ProductCountSupervisor\"");
103
104 WriteLiteral(" style=\"height: 10px;\"");
105
106 WriteLiteral(">\r\n <input");
107
108 WriteLiteral(" id=\"PageCount\"");
109
110 WriteLiteral(" type=\"text\"");
111
112 WriteLiteral(" value=\"1\"");
113
114 WriteLiteral(" />\r\n</div>\r\n<script>\r\n function getQS(name) {\r\n name = name.replace(/[" +
115 "\\[]/, \"\\\\\\[\").replace(/[\\]]/, \"\\\\\\]\");\r\n var regexS = \"[\\\\?&#\\b./#]\" + na" +
116 "me + \"=([^&#]*)\";\r\n var regex = new RegExp(regexS);\r\n var results " +
117 "= regex.exec(window.location);\r\n if (results == null)\r\n return" +
118 " \"\";\r\n else\r\n return decodeURIComponent(results[1].replace(/\\+" +
119 "/g, \" \"));\r\n }\r\n\r\n function setQS(name, val) {\r\n //Createde by Henr" +
120 "ik 04.02.2015. \r\n //Sets a querystring param by name and value.\r\n " +
121 "//This is a new version supporting HTML4\r\n //https://github.com/browserst" +
122 "ate/history.js\r\n name = name.replace(/[\\[]/, \"\\\\\\[\").replace(/[\\]]/, \"\\\\\\" +
123 "]\");\r\n var regexS = \"[\\\\?&]\" + name + \"=([^&#]*)\";\r\n var regex = n" +
124 "ew RegExp(regexS);\r\n var results = regex.exec(window.location.search);\r\n " +
125 " if (document.addEventListener && navigator.appVersion.indexOf(\"MSIE 9\") =" +
126 "= -1) {\r\n if (results == null) {\r\n if (window.location" +
127 ".search.indexOf(\'?\') > -1)\r\n History.pushState(\'\', \'\', locati" +
128 "on.href + \'&\' + name + \'=\' + val);\r\n else\r\n Hi" +
129 "story.pushState(\'\', \'\', location.href + \'?\' + name + \'=\' + val);\r\n }\r" +
130 "\n else {\r\n History.pushState(\'\', \'\', location.href.rep" +
131 "lace(name + \'=\' + results[1], name + \'=\' + val));\r\n }\r\n }\r\n " +
132 " else {\r\n if (results == null) {\r\n if (window.loca" +
133 "tion.search.indexOf(\'?\') > -1)\r\n History.pushState(null, null" +
134 ", name + \'=\' + val);\r\n else\r\n History.pushStat" +
135 "e(null, null, name + \'=\' + val);\r\n }\r\n else {\r\n " +
136 " History.pushState(null, null, location.href.replace(name + \'=\' + results[1]" +
137 ", name + \'=\' + val));\r\n }\r\n }\r\n }\r\n\r\n function prodClick" +
138 "ed(id, link) {\r\n $(\'#PageCount\').val(\"1\");\r\n setQS(\"pid\", \"\" + id)" +
139 ";\r\n window.location.href = link;\r\n }\r\n\r\n require([\'jquery\', \'json\']" +
140 ", function ($) {\r\n function ListProducts(result, listMode) {\r\n " +
141 " //Vars\r\n var template = \"\";\r\n //Generate products\r\n " +
142 " var pageCount = 0;\r\n var prodCount = 0;\r\n $.each(res" +
143 "ult.d, function () {\r\n $(\'#ListProducts\').append(\'<tr><td style=\"" +
144 "height: 100px;text-align:center;\"><img style=\"max-width:150px;max-height:100px;\"" +
145 " src=\"\' + \"/files\" + this.ImgSrc + \'\" /></td><td>\' + this.InfoText + \'</td><td>\'" +
146 " + this.ProductNumber + \'</td><td>\' + this.EAN + \'</td><td style=\"text-align:rig" +
147 "ht\">\' + this.Price + \'</td><td>\' + this.PriceText + \'</td></tr>\');\r\n " +
148 " prodCount++;\r\n if (prodCount == 5 && pageCount == 0) {\r\n " +
149 " \r\n\r\n pageCount++;\r\n prodCount =" +
150 " 0;\r\n // $(\'#ListProducts\').append(\'</tbody></table><div class" +
151 "=\"breakDiv\"></div><table class=\"table table-bordered table-striped dontSplit\"><t" +
152 "body>\');\r\n }\r\n else if (prodCount == 8)\r\n " +
153 " {\r\n \r\n // $(\'#ListProducts\').append(\'</tbo" +
154 "dy></table><div class=\"breakDiv\"></div><table class=\"table table-bordered table-" +
155 "striped dontSplit\"><tbody>\');\r\n pageCount++;\r\n " +
156 " prodCount = 0;\r\n }\r\n });\r\n $(\'#ListPro" +
157 "ducts img\').last().load(function () {\r\n window.print();\r\n " +
158 " // window.onfocus = function () { window.close(); }\r\n\r\n });\r\n\r" +
159 "\n //var ctlTd = $(\'.dontSplit td\');\r\n //if (ctlTd.length >" +
160 " 0) {\r\n // //console.log(\'Found ctlTd\');\r\n // ctlTd." +
161 "wrapInner(\'<div class=\"avoidBreak\" />\');\r\n //}\r\n }\r\n $." +
162 "fn.pVal = function () {\r\n var $this = $(this),\r\n val =" +
163 " $this.eq(0).val();\r\n if (val == $this.attr(\'placeholder\'))\r\n " +
164 " return \'\';\r\n else\r\n return val;\r\n }\r\n " +
165 " $(document).ready(function () {\r\n var path = $(\'#logo\').find(\'i" +
166 "mg\').attr(\'src\');\r\n $(\'#logo\').remove();\r\n $(\'body\').prepe" +
167 "nd(\'<img style=\"width:300px\" src=\"\' + path + \'\" />\');\r\n\r\n //Get produ" +
168 "cts\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"" +
169 "Services/AjaxRequests.asmx/FavoritesGetMasterList\",\r\n contentType" +
170 ": \"application/json; charset=utf-8\",\r\n dataType: \"json\",\r\n " +
171 " data: JSON.stringify({ masterList: $(\'.masterFavlist\').val() }),\r\n " +
172 " error: function (msg) {\r\n //console.log(JSON.strin" +
173 "gify(msg.d))\r\n },\r\n success: function (msg) {\r\n " +
174 " ListProducts(msg);\r\n },\r\n complet" +
175 "e: function (msg) {\r\n $(window).data(\'ajaxready\', true);\r\n " +
176 " }\r\n });\r\n });\r\n });\r\n</script>\r\n");
177
178 }
179 }
180 }
181
1 @using System.Web;
2 <script src="/scripts/bundled/html4Andhtml5/jquery.history.js"></script>
3 <style>
4 table tr td {
5 page-break-inside: avoid !important;
6 }
7
8 footer { display: none; }
9 /*.avoidBreak {
10 page-break-inside: avoid !important;
11 margin: 4px 0 4px 0;
12 }*/
13 </style>
14 @{
15 var userName = "";
16 var user = Dynamicweb.Modules.UserManagement.User.GetCurrentUser();
17 if (String.IsNullOrEmpty(user.Company))
18 {
19 // userName = user.UserName;
20 userName = user.Company;
21
22 }
23 else
24 {
25 userName = user.Company;
26 }
27 }
28 <!--@If Not(Global:Extranet.Groups<contains>'3121')-->
29 <!--@LoopStart(FavoriteList)-->
30 <input class="masterFavlist" type="hidden" value="false" />
31 <!--@LoopEnd(FavoriteList)-->
32 <!--@Else-->
33 <input class="masterFavlist" type="hidden" value="true" />
34 <!--@EndIf-->
35 <h3>Favoritliste @userName</h3>
36 <table class="table table-bordered table-striped dontSplit">
37 <thead>
38 <tr><th style="width: 150px;">Billede</th><th>Beskrivelse</th><th>Varenr.:</th><th>EAN</th><th>Pris (pr. stk. ekskl. moms)</th><th>Antal pr. kolli</th></tr>
39 </thead>
40 <tbody id="ListProducts"></tbody>
41 </table>
42 <div class="hidden" id="ProductCountSupervisor" style="height: 10px;">
43 <input id="PageCount" type="text" value="1" />
44 </div>
45 <script>
46 function getQS(name) {
47 name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
48 var regexS = "[\\?&#\b./#]" + name + "=([^&#]*)";
49 var regex = new RegExp(regexS);
50 var results = regex.exec(window.location);
51 if (results == null)
52 return "";
53 else
54 return decodeURIComponent(results[1].replace(/\+/g, " "));
55 }
56
57 function setQS(name, val) {
58 //Createde by Henrik 04.02.2015.
59 //Sets a querystring param by name and value.
60 //This is a new version supporting HTML4
61 //https://github.com/browserstate/history.js
62 name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
63 var regexS = "[\\?&]" + name + "=([^&#]*)";
64 var regex = new RegExp(regexS);
65 var results = regex.exec(window.location.search);
66 if (document.addEventListener && navigator.appVersion.indexOf("MSIE 9") == -1) {
67 if (results == null) {
68 if (window.location.search.indexOf('?') > -1)
69 History.pushState('', '', location.href + '&' + name + '=' + val);
70 else
71 History.pushState('', '', location.href + '?' + name + '=' + val);
72 }
73 else {
74 History.pushState('', '', location.href.replace(name + '=' + results[1], name + '=' + val));
75 }
76 }
77 else {
78 if (results == null) {
79 if (window.location.search.indexOf('?') > -1)
80 History.pushState(null, null, name + '=' + val);
81 else
82 History.pushState(null, null, name + '=' + val);
83 }
84 else {
85 History.pushState(null, null, location.href.replace(name + '=' + results[1], name + '=' + val));
86 }
87 }
88 }
89
90 function prodClicked(id, link) {
91 $('#PageCount').val("1");
92 setQS("pid", "" + id);
93 window.location.href = link;
94 }
95
96 require(['jquery', 'json'], function ($) {
97 function ListProducts(result, listMode) {
98 //Vars
99 var template = "";
100 //Generate products
101 var pageCount = 0;
102 var prodCount = 0;
103 $.each(result.d, function () {
104 $('#ListProducts').append('<tr><td style="height: 100px;text-align:center;"><img style="max-width:150px;max-height:100px;" src="' + "/files" + this.ImgSrc + '" /></td><td>' + this.InfoText + '</td><td>' + this.ProductNumber + '</td><td>' + this.EAN + '</td><td style="text-align:right">' + this.Price + '</td><td>' + this.PriceText + '</td></tr>');
105 prodCount++;
106 if (prodCount == 5 && pageCount == 0) {
107
108
109 pageCount++;
110 prodCount = 0;
111 // $('#ListProducts').append('</tbody></table><div class="breakDiv"></div><table class="table table-bordered table-striped dontSplit"><tbody>');
112 }
113 else if (prodCount == 8)
114 {
115
116 // $('#ListProducts').append('</tbody></table><div class="breakDiv"></div><table class="table table-bordered table-striped dontSplit"><tbody>');
117 pageCount++;
118 prodCount = 0;
119 }
120 });
121 $('#ListProducts img').last().load(function () {
122 window.print();
123 // window.onfocus = function () { window.close(); }
124
125 });
126
127 //var ctlTd = $('.dontSplit td');
128 //if (ctlTd.length > 0) {
129 // //console.log('Found ctlTd');
130 // ctlTd.wrapInner('<div class="avoidBreak" />');
131 //}
132 }
133 $.fn.pVal = function () {
134 var $this = $(this),
135 val = $this.eq(0).val();
136 if (val == $this.attr('placeholder'))
137 return '';
138 else
139 return val;
140 }
141 $(document).ready(function () {
142 var path = $('#logo').find('img').attr('src');
143 $('#logo').remove();
144 $('body').prepend('<img style="width:300px" src="' + path + '" />');
145
146 //Get products
147 $.ajax({
148 type: "POST",
149 url: "Services/AjaxRequests.asmx/FavoritesGetMasterList",
150 contentType: "application/json; charset=utf-8",
151 dataType: "json",
152 data: JSON.stringify({ masterList: $('.masterFavlist').val() }),
153 error: function (msg) {
154 //console.log(JSON.stringify(msg.d))
155 },
156 success: function (msg) {
157 ListProducts(msg);
158 },
159 complete: function (msg) {
160 $(window).data('ajaxready', true);
161 }
162 });
163 });
164 });
165 </script>
166