-
Notifications
You must be signed in to change notification settings - Fork 0
/
resource_details.aspx
439 lines (384 loc) · 20.8 KB
/
resource_details.aspx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
<%@ Page Language="VB" MasterPageFile="~/common/Manager.master" AutoEventWireup="false"
CodeFile="resource_details.aspx.vb" Inherits="resource_details" Title="Resource - Buildmate" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="head" ContentPlaceHolderID="head" Runat="Server">
<telerik:RadScriptBlock ID="rsbPhase8" runat="server" Visible="false">
<script type="text/javascript">
var data = {
target: ".breadcrumb .button-create",
progress: 3,
tooltip: {
title: "Resource Details",
content: "To Add a 'Resource to a Supplier' click the green button 'New Supplier' on the left.<br><br><em>Help: To save you time Buildmate has already set up some default data under 'Resource Details' on the left. Any suppliers that provide this resource are listed under 'Suppliers for this Resource'. There are currently no Suppliers providing this resource, each resource can have unlimited suppliers providing the resource and each resource can have more than one quantity. This is referred to as stacking i.e. nails can be listed under the same resource - in 0.5kg, 1kg, 5kg, 20kg and 25kg quantities. If you invest the time to add multiple pack sizes, Buildmate's Resource Manager will calculate which is the most cost effect quantity to use.</em>"
}
};
$(document).ready(function () {
bm.tour(data);
$('.breadcrumb .button-create').on('click', function () {
var data = {
target: "#ctl00_MainContent_fvResourceInsert_btnInsert",
progress: 3,
tooltip: {
title: "Add a Supplier to this Resource",
content: "Enter your 'Suppliers Resource Purchase Details ' and then click the green button 'Add Resource' located at the bottom of the form.<br><br><em>Help: 'SUPPLIER' will open a drop down menu with a list of all your suppliers. If the resource is Labour select your company otherwise select the other supplier you added under suppliers.<br><br>'PRODUCT CODE' is the supplier's reference product code, not the manufacturer's product reference code. Having the Supplier's Product Code will prevent any ambiguity when ordering the product from the Suppler.<br><br>'SUFFIX' is the unit size of the resource: how you would order the resource/product from your supplier. I.e. Labour is purchased by the hour so the Suffix is hour, Nails are ordered by weight 0.5kg, 1kg, 2.5kg pack or 20kg or 25kg box so the suffix is 0.5kg/pack and 20kg/box. A pack of ten bolts would be 10/nr or 10/pack.<br><br>'PRICE' is the purchase cost of the resource, net of Vat. Buildmate will calculate Vat for you. <br><br>'LEAD TIME' is the number of days it will take from order to delivery, usually set at 1. Specialist materials can take 30 days plus from order to delivery. <br><br>'USAGE' is the number of times a resource can be used; Labour is purchased by the hour so there are 60 minutes of use per hour. A box of 200 screws has a usage of 200 per box and a bag of ten bolts has 10 uses per pack before another hour’s labour, box of 200 screws or bag of 10 bolts needs to be repurchased.</em>"
}
};
bm.tour(data);
});
});
</script>
</telerik:RadScriptBlock>
<telerik:RadScriptBlock ID="rsbPhase9" runat="server" Visible="false">
<script type="text/javascript">
var data = {
target: "#ctl00_hlHome",
progress: 4,
tooltip: {
title: "You have successfully linked a Resource to a Supplier",
content: "Click 'Dashboard' on the main tool bar.<br><br><em>Help: Selecting ‘Dashboard’ will return you to your Dashboard.</em>"
}
};
$(document).ready(function () {
bm.tour(data);
});
</script>
</telerik:RadScriptBlock>
</asp:Content>
<asp:Content ID="Content" ContentPlaceHolderID="MainContent" Runat="Server">
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlId="fvResource">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="fvResource" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlId="fvResourceInsert">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="rgCatalogue" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<script type="text/javascript">
function validateModal() {
if (typeof (Page_ClientValidate) == 'function') {
Page_ClientValidate();
}
if (Page_IsValid) {
hideModal();
return true;
}
return false;
}
</script>
<!-- begin add resource -->
<div id="addResource" class="md-window" data-modal="addResource">
<div class="md-content">
<h3>Adding a Resource Supplier..</h3>
<asp:FormView
ID="fvResourceInsert"
runat="server"
EnableViewState="false"
DefaultMode="Insert"
Width="100%"
DataSourceID="catalogueDataSource"
DataKeyNames="id">
<InsertItemTemplate>
<asp:Panel ID="Panel4" runat="server" DefaultButton="btnInsert">
<div class="md-details">
<div class="row">
<asp:Label ID="Label1" runat="server"
CssClass="label"
AssociatedControlID="rcbSupplier"
Text="Supplier*" />
<telerik:RadComboBox
ID="rcbSupplier"
runat="server"
SelectedValue='<%# Bind("supplierId") %>'
DataSourceID="supplierDataSource"
DataTextField="supplierName"
DataValueField="id" />
</div>
<div class="row">
<asp:Label ID="Label8" runat="server"
CssClass="label"
AssociatedControlID="rtbProductCode"
Text="Product Code" />
<telerik:RadTextBox ID="rtbProductCode" runat="server"
MaxLength="30"
Text='<%# Bind("productCode") %>'/>
</div>
<div class="row">
<asp:Label
ID="Label10"
runat="server"
CssClass="label"
AssociatedControlID="rtbSuffix"
Text="Suffix" />
<telerik:RadTextBox ID="rtbSuffix" runat="server"
MaxLength="50"
Text='<%# Bind("suffix") %>'/><br />
<label class="label"> </label>
<small>This is the unit size you purchase this Resource in.</small>
</div>
<div class="row">
<asp:Label ID="Label5" runat="server"
CssClass="label"
AssociatedControlID="rtbPrice"
Text="Price*" />
<telerik:RadNumericTextBox ID="rtbPrice" runat="server"
dbValue='<%# Bind("price") %>'
Width="90px"
NumberFormat-DecimalDigits="2"
Type="Currency" />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1"
runat="server"
ControlToValidate="rtbPrice"
ValidationGroup="insertValidation"
Display="Dynamic"
ErrorMessage="Price">
<span class="req"></span>
</asp:RequiredFieldValidator>
</div>
<div class="row">
<asp:Label ID="Label6" runat="server"
CssClass="label"
AssociatedControlID="rntbLeadTime"
Text="Lead Time" />
<telerik:RadNumericTextBox ID="rntbLeadTime" runat="server"
dbValue='<%# Bind("leadTime") %>'
Width="30px"
NumberFormat-DecimalDigits="0"
Value="0"
MinValue="0"
Type="Number" /> (days)
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3"
runat="server"
ControlToValidate="rntbLeadTime"
ValidationGroup="insertValidation"
Display="Dynamic"
ErrorMessage="Lead Time">
<span class="req"></span>
</asp:RequiredFieldValidator>
</div>
<div class="row">
<asp:Label ID="Label9" runat="server"
CssClass="label"
AssociatedControlID="rntbUseage"
Text="Useage*" />
<telerik:RadNumericTextBox ID="rntbUseage" runat="server"
Type="Number"
Width="60px"
NumberFormat-DecimalDigits="2"
dbValue='<%# Bind("useage") %>'/><br />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator4"
runat="server"
ControlToValidate="rntbUseage"
ValidationGroup="insertValidation"
Display="Dynamic"
ErrorMessage="Useage">
<span class="req"></span>
</asp:RequiredFieldValidator>
<label class="label"> </label>
<small>Add the number of times this Resource can be used.</small>
</div>
</div>
<div class="md-footer">
<asp:Button
ID="btnInsert"
runat="server"
CommandName="Insert"
Text="Add Resource"
CssClass="button button-create"
OnClientClick="validateModal()"
ValidationGroup="insertValidation" />
<a href="#" class="button md-close">Close</a>
</div>
</asp:Panel>
</InsertItemTemplate>
</asp:FormView>
</div>
</div>
<div class="breadcrumb">
<div class="breadcrumb-container">
<ul class="breadcrumb-options">
<li><a href="#" data-target="addResource" class="js-open-modal button button-create">New Supplier</a></li>
</ul>
<ul class="breadcrumb-list">
<li>
<a href="resources.aspx" title="Resources">Resources</a>
<span class="divider">/</span>
</li>
<li class="active">
Resource Details
</li>
</ul>
</div>
</div>
<div class="main-container">
<div class="div25">
<div class="box">
<h3>Resource Details</h3>
<div class="boxcontent">
<asp:FormView
ID="fvResource"
runat="server"
DataKeyNames="id"
Width="100%"
DataSourceID="resourceDataSource">
<ItemTemplate>
<div class="row">
<label class="label">Resource Name</label>
<asp:Label ID="resourceNameLabel" runat="server"
Text='<%# Bind("resourceName") %>' />
</div>
<div class="row">
<label class="label">Category</label>
<asp:Label ID="categoryIdLabel" runat="server"
Text='<%# Bind("categoryName") %>' />
</div>
<div class="row">
<label class="label">Unit of Usage</label>
<asp:Label ID="unitIdLabel" runat="server" Text='<%# Bind("unit") %>' />
</div>
<div class="row">
<label class="label">Waste</label>
<asp:Label ID="wasteLabel" runat="server" Text='<%# Bind("waste") %>' />%
</div>
<div class="row">
<label class="label">Manufacturer</label>
<asp:Label ID="manufacturerLabel" runat="server"
Text='<%# Bind("manufacturer") %>' />
</div>
<div class="row">
<label class="label">Part ID</label>
<asp:Label ID="partIdLabel" runat="server" Text='<%# Bind("partId") %>' />
</div>
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="resourceDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
SelectCommand="getResourceDetailsById" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:QueryStringParameter QueryStringField="rid" Name="resourceId" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</div>
</div>
<div class="div75 div-last">
<div class="box">
<h3>Suppliers for this Resource</h3>
<div class="boxcontent">
<telerik:RadGrid
ID="rgCatalogue"
runat="server"
DataSourceID="catalogueDataSource"
GridLines="None">
<MasterTableView
AutoGenerateColumns="False"
DataSourceID="catalogueDataSource">
<Columns>
<telerik:GridTemplateColumn
HeaderStyle-Width="16px">
<ItemTemplate>
<span
id="spandisc"
runat="server"
title="Discontinued"
visible='<%#(IIF(Eval("discontinued"),"true", "false"))%>'
style="display: block; width: 16px; height: 16px; background: url(http://www.buildmateapp.com/icons/error.png)"></span>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridHyperLinkColumn
HeaderStyle-Width="40%"
DataTextField="supplierName"
HeaderText="Supplier Name"
SortExpression="supplierName"
UniqueName="supplierName"
DataNavigateUrlFields="resourceId, id"
DataNavigateUrlFormatString="edit_catalogue.aspx?rid={0}&id={1}" />
<telerik:GridBoundColumn
HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Center"
DataField="suffix"
HeaderText="Suffix"
SortExpression="suffix"
UniqueName="suffix"/>
<telerik:GridBoundColumn
HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Center"
DataField="productCode"
HeaderText="Product Code"
SortExpression="productCode"
UniqueName="productCode"/>
<telerik:GridBoundColumn
HeaderStyle-HorizontalAlign="Right"
ItemStyle-HorizontalAlign="Right"
DataField="price"
DataType="System.Decimal"
DataFormatString="{0:c2}"
HeaderText="Price"
SortExpression="price"
UniqueName="price" />
<telerik:GridBoundColumn
HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Center"
DataField="leadTime"
DataType="System.Int32"
HeaderText="Lead Time"
SortExpression="leadTime"
UniqueName="leadTime" />
<telerik:GridBoundColumn
HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Center"
DataField="useage"
DataType="System.Double"
HeaderText="Useage"
SortExpression="useage"
UniqueName="useage" />
<telerik:GridBoundColumn
HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Center"
DataField="lastUpdated"
DataType="System.DateTime"
HeaderText="Last Updated"
SortExpression="lastUpdated"
UniqueName="lastUpdated" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
</div>
</div>
</div>
</div>
<asp:SqlDataSource ID="catalogueDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
InsertCommand="insertCatalogueUseageByUser"
InsertCommandType="StoredProcedure"
SelectCommand="getCatalogueUseageByResourceAndUser"
SelectCommandType="StoredProcedure">
<InsertParameters>
<asp:SessionParameter Name="UserId" SessionField="UserId" />
<asp:QueryStringParameter Name="resourceId" QueryStringField="rid" />
<asp:Parameter Name="discontinued" DefaultValue="0" />
</InsertParameters>
<SelectParameters>
<asp:QueryStringParameter Name="resourceId" QueryStringField="rid" />
<asp:SessionParameter Name="userId" SessionField="userId" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource
ID="supplierDataSource"
runat="server"
ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
SelectCommand="getSupplierByUser"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter Name="userId" SessionField="userId" />
</SelectParameters>
</asp:SqlDataSource>
</asp:Content>