Error executing template "/Designs/SkanskaMaskin/Paragraph/_form_retur.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_3335e127255e4693819130786be49914.Execute() in D:\wwwroot\rental.skanska.se\Files\Templates\Designs\SkanskaMaskin\Paragraph\_form_retur.cshtml:line 29
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 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
2 @using Softgear.SkanskaMaskin.Data.Business
3 @using Softgear.SkanskaMaskin.Data.Entities.Rental
4 @using Softgear.SkanskaMaskin.DataAccess.Helpers
5
6 @{
7 var projectData = ProjectManager.GetProjectInfoByCode(AccountManager.getActiveProjectCode());
8 var customerCenters = CacheManager.GetFromCache<Dynamicweb.Security.UserManagement.UserCollection>(60, "customerCentersGroup4", () => Dynamicweb.Security.UserManagement.User.GetUsersByGroupID(4));
9 var choose = new Dynamicweb.Security.UserManagement.User();
10
11 var storeList = (from user in customerCenters.Where(y => y.Active && !y.GroupsIds.Contains(10) && !y.GroupsIds.Contains(11))
12 select new
13 {
14 value = Convert.ToString(user.ID),
15 text = user.Name
16 }).OrderBy(x => x.text).ToList();
17
18 storeList.Insert(0, new { value = "", text = Translate("Choose_KC", "Välj kundcenter") });
19
20 var storesData = new
21 {
22 baseUrl = "/service/storeinfo?storeid=",
23 name = "store",
24 required = "required",
25 className = "Control--light",
26 items = storeList.ToArray()
27 };
28
29 var preSelectedKc = ProjectManager.GetDefaultKcOnProject(projectData.ProjectId);
30 var preSelectedStoreInfo = AccountManager.GetKCShortInfo(preSelectedKc);
31 }
32
33 <form class="js-form" action="/dashboard/returer/ny" method="get" onsubmit="disableSubmitReturnButton()">
34 <div class="Grid Grid--equalPush">
35 <div class="Grid-cell">
36 <div class="Grid Grid--withGutter">
37 <div class="Grid-cell u-sizeFull">
38 <div class="Type">
39 <h2 class="Type-h1">Bekräfta och beställ retur</h2>
40 </div>
41 </div>
42 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2">
43 <p>Valt kundcenter</p>
44 <div class="Control Control--light" data-controller="control" data-baseurl="/service/storeinfo?storeid=">
45 <select name="store" class="Control-select js-controlSelect" required="">
46 @foreach (var store in storeList)
47 {
48 var selected = store.value.ToString() == @preSelectedKc ? "selected" : string.Empty;
49 <option value="@store.value" @selected>@store.text</option>
50 }
51 </select>
52 </div>
53 </div>
54 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"></div>
55 </div>
56 </div>
57 <div class="Grid-cell">
58 <div class="Grid Grid--withGutter">
59 <div class="Grid-cell u-sizeFull">
60 <div class="Return-summary">
61 <div class="js-returnSummaryText"></div>
62 <div class="Grid" style="margin-top: 10px" id="divToggle">
63 <span id="js-summaryListInfoToggle" class="Type-h4 js-summaryListInfoToggle u-pointer" listener="false">
64 <span id="summaryInfoText">
65 Visa information
66 </span>
67 <span class="Icon--arrow-down IconArrow"></span>
68 </span>
69 </div>
70 <input class="js-returnSummaryIdsInput" type="hidden" name="returnIds" value="">
71 <input class="js-returnSummaryNotesInput" type="hidden" name="returnNotes" value="">
72 <input class="js-returnSummaryPartialsInput" type="hidden" name="returnPartials" value="">
73 </div>
74 </div>
75 </div>
76 </div>
77 <div class="Grid-cell" style="display: none" id="retur-filter-content">
78 <div class="Grid Grid--withGutter" id="summaryHeaderDiv">
79 <div id="js-summaryContentRetur" class="Grid-cell u-sizeFull">
80 </div>
81 </div>
82 </div>
83
84 <div class="Grid-cell">
85 <div class="Grid Grid--withGutter">
86 <div class="Grid-cell">
87 <div class="Byline">
88 <div class="FormGroup">
89 <div class="FormGroup-section FormGroup-section--summary is-disabled" data-controller="form-summary" data-template="{{projectcode}} ({{projectname}}">
90 <fieldset>
91 <legend class="FormGroup-heading">Projekt</legend>
92 <button class="FormGroup-summaryBtn js-formSummaryBtn">@projectData.ProjectNo (@projectData.ProjectName)</button>
93 <div class="FormGroup-summaryInputs js-formSummaryInputs ">
94 <div class="Grid Grid--withGutter">
95 <div class="Grid-cell u-sizeFull">
96 <div class="Input Input--fill Input--hasValue">
97 <label for="projectname" class="Input-label">Projektnamn</label>
98 <input id="projectname" class="Input-field js-formInputField " name="projectname" type="text" data-controller="form-input" value="@projectData.ProjectName" disabled="disabled">
99 </div>
100 </div>
101 <div class="Grid-cell u-sizeFull">
102 <div class="Input Input--fill Input--hasValue">
103 <label for="projectcode" class="Input-label">Projektnummer</label>
104 <input id="projectcode" class="Input-field js-formInputField " name="projectcode" type="text" data-controller="form-input" value="@projectData.ProjectNo" disabled="disabled">
105 </div>
106 </div>
107 </div>
108 </div>
109 </fieldset>
110 </div>
111
112 <div class="FormGroup-section FormGroup-section--summary" data-controller="form-summary">
113 <fieldset>
114 <legend class="FormGroup-heading">Adress</legend>
115 <button class="FormGroup-summaryBtn js-formSummaryBtn ">@projectData.ProjectAddress, @projectData.ProjectZip, @projectData.ProjectCity</button>
116 <div class="FormGroup-summaryInputs js-formSummaryInputs ">
117 <div class="Grid Grid--withGutter">
118 <div class="Grid-cell u-sizeFull">
119 <div class="Input Input--fill Input--hasValue">
120 <label for="address" class="Input-label">Gatuadress</label>
121 <input id="address" class="Input-field js-formInputField " name="address" type="text" data-controller="form-input" value="@projectData.ProjectAddress" required="">
122 </div>
123 </div>
124 <div class="Grid-cell u-sizeFull">
125 <div class="Input Input--fill Input--hasValue">
126 <label for="zip" class="Input-label">Postnummer</label>
127 <input id="zip" class="Input-field js-formInputField " name="zip" type="text" data-controller="form-input" value="@projectData.ProjectZip" required="">
128 </div>
129 </div>
130 <div class="Grid-cell u-sizeFull">
131 <div class="Input Input--fill Input--hasValue">
132 <label for="city" class="Input-label">Postort</label>
133 <input id="city" class="Input-field js-formInputField " name="city" type="text" data-controller="form-input" value="@projectData.ProjectCity" required="">
134 </div>
135 </div>
136 </div>
137 </div>
138 </fieldset>
139 </div>
140
141 <div class="FormGroup-section FormGroup-section--summary" data-controller="form-summary">
142 <fieldset>
143 <legend class="FormGroup-heading">Företag</legend>
144 <button class="FormGroup-summaryBtn js-formSummaryBtn ">@projectData.ProjectName2</button>
145 <div class="FormGroup-summaryInputs js-formSummaryInputs ">
146 <div class="Grid Grid--withGutter">
147 <div class="Grid-cell u-sizeFull">
148 <div class="Input Input--fill Input--hasValue">
149 <label for="company" class="Input-label">Företagsnamn</label>
150 <input id="company" class="Input-field js-formInputField " name="company" type="text" data-controller="form-input" value="@projectData.ProjectName2" required="">
151 </div>
152 </div>
153 </div>
154 </div>
155 </fieldset>
156 </div>
157
158 <div class="FormGroup-section FormGroup-section--summary" data-controller="form-summary">
159 <fieldset>
160 <legend class="FormGroup-heading">Telefonnummer</legend>
161 <button class="FormGroup-summaryBtn js-formSummaryBtn ">@projectData.ProjectPhone </button>
162 <div class="FormGroup-summaryInputs js-formSummaryInputs ">
163 <div class="Grid Grid--withGutter">
164 <div class="Grid-cell u-sizeFull">
165 <div class="Input Input--fill Input--hasValue">
166 <label for="phonenumber" class="Input-label">Telefonnummmer</label>
167 <input id="phonenumber" class="Input-field js-formInputField " name="phonenumber" type="text" data-controller="form-input" value="@projectData.ProjectPhone" required="">
168 </div>
169 </div>
170 </div>
171 </div>
172 </fieldset>
173 </div>
174
175 <div class="FormGroup-section FormGroup-section--summary" data-controller="form-summary">
176 <fieldset>
177 <legend class="FormGroup-heading">E-post</legend>
178 <button class="FormGroup-summaryBtn js-formSummaryBtn is-hidden"> </button>
179 <div class="FormGroup-summaryInputs js-formSummaryInputs is-expanded">
180 <div class="Grid Grid--withGutter">
181 <div class="Grid-cell u-sizeFull">
182 <div class="Input Input--fill">
183 <input id="email" placeholder="E-post" class="Input-field js-formInputField " name="email" type="email" data-controller="form-input" required="">
184 </div>
185 </div>
186 </div>
187 </div>
188 </fieldset>
189 </div>
190
191 <div class="FormGroup-section FormGroup-section--summary" data-controller="form-summary">
192 <fieldset>
193 <legend class="FormGroup-heading">Kontaktperson</legend>
194 <button class="FormGroup-summaryBtn js-formSummaryBtn is-hidden"> </button>
195 <div class="FormGroup-summaryInputs js-formSummaryInputs is-expanded">
196 <div class="Grid Grid--withGutter">
197 <div class="Grid-cell u-sizeFull">
198 <div class="Input Input--fill">
199 <input id="contactperson" placeholder="Personens namn" class="Input-field js-formInputField " name="contactperson" type="text" data-controller="form-input" required="">
200 </div>
201 </div>
202 </div>
203 </div>
204 </fieldset>
205 </div>
206
207 <div class="FormGroup-section FormGroup-section--summary" data-controller="form-summary">
208 <fieldset>
209 <legend class="FormGroup-heading">Hämtningsplats</legend>
210 <button class="FormGroup-summaryBtn js-formSummaryBtn is-hidden"> </button>
211 <div class="FormGroup-summaryInputs js-formSummaryInputs is-expanded">
212 <div class="Grid Grid--withGutter">
213 <div class="Grid-cell u-sizeFull">
214 <div class="Input Input--fill">
215 <input id="pickup" placeholder="Hämtningsplats" class="Input-field js-formInputField" name="pickup" type="text" data-controller="form-input" required="">
216 </div>
217 </div>
218 </div>
219 </div>
220 </fieldset>
221 </div>
222
223 <div class="FormGroup-section FormGroup-section--summary" data-controller="form-summary">
224 <fieldset>
225 <legend class="FormGroup-heading">När skall det hämtas? Beställd retur före kl 12.00 hämtas i regel nästkommande vardag. Vid ev avvikelse kontaktar vi er. Observera att särskilda villkor gäller returbeställning av produkter som kräver demontage eller avetablering som ska göras enligt avtalad tid angiven i Offert eller Avtal. Det gäller till exempel bodar, kranar och hissar. Vid frågor kontaktas Skanska Rentals kundansvarig. </legend>
226 <button class="FormGroup-summaryBtn js-formSummaryBtn is-hidden"> </button>
227 <div class="FormGroup-summaryInputs js-formSummaryInputs is-expanded">
228 <div class="Grid Grid--withGutter">
229 <div class="Grid-cell u-sizeFull">
230 <div class="Input Input--fill">
231 <label for="date" class="Input-label"></label>
232 <input id="date" class="Input-field js-formInputField " name="date" type="date" data-controller="form-input" required="" min="@DateTime.Now.ToShortDateString()">
233 </div>
234 </div>
235 </div>
236 </div>
237 </fieldset>
238 </div>
239 </div>
240 </div>
241 </div>
242 </div>
243 </div>
244 <div class="Grid-cell">
245 <div class="Grid Grid--withGutter">
246 <div class="Grid-cell u-sizeFull">
247 <div class="Type">
248 <h3 class="Type-h3">Övrig information</h3>
249 </div>
250 </div>
251 <div class="Grid-cell u-sizeFull">
252 <div class="Input Input--fill">
253 <label for="return-message" class="Input-label">Meddelande</label>
254 <textarea id="return-message" class="Input-textarea js-formInputField" name="return-message" data-controller="form-input" rows="3" style="overflow: hidden; overflow-wrap: break-word; resize: horizontal; height: 97px;"> </textarea>
255 </div>
256 </div>
257 </div>
258 </div>
259 <input type="hidden" name="project" value="58460">
260 <div class="Grid-cell">
261 <div class="Grid Grid--withGutter">
262 <div class="Grid-cell u-size1of2 u-textLeft">
263 <button class="Button Button--tertiary js-overlayClose" type="submit">Avbryt</button>
264 </div>
265 <div class="Grid-cell u-size1of2 u-textRight">
266 <button id="js-submit-return-button" class="Button ButtonRental" type="submit">Beställ retur</button>
267 </div>
268 </div>
269 </div>
270 </div>
271 </form>