-
Notifications
You must be signed in to change notification settings - Fork 0
/
suppliers.aspx
401 lines (348 loc) · 19.1 KB
/
suppliers.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
<%@ Page Language="VB" MasterPageFile="~/common/Manager.master" AutoEventWireup="false" CodeFile="suppliers.aspx.vb" Inherits="manager_Default" title="Suppliers - Buildmate" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="head" ContentPlaceHolderID="head" Runat="Server">
<asp:Panel ID="addSupplierScript" runat="server" Visible="false">
<script>
$(document).ready(function () {
$('.js-open-modal').click();
});
</script>
</asp:Panel>
<telerik:RadScriptBlock ID="rsbPhase0" runat="server" Visible="false">
<script type="text/javascript">
var data = {
target: "#ctl00_hlCustomers",
progress: 0,
tooltip: {
title: "Welcome to Buildmate",
content: "Add your first Customer. Click the Customers link above to begin.",
videoId: "QxhB-S1UoG4"
}
};
bm.tour(data);
</script>
</telerik:RadScriptBlock>
<telerik:RadScriptBlock ID="rsbPhase1" runat="server" Visible="false">
<script type="text/javascript">
var data = {
target: "#ctl00_hlProjects",
progress: 1,
tooltip: {
title: "Managing Projects",
content: "Now you've created your first Customer, the next step is to create a Project for them.<br /><br />Click Projects in the top menu to get started."
}
};
$(document).ready(function () {
bm.tour(data);
});
</script>
</telerik:RadScriptBlock>
<telerik:RadScriptBlock ID="rsbPhase6" runat="server" Visible="false">
<script type="text/javascript">
var data = {
target: "#ctl00_MainContent_rgSuppliers_ctl00 td:first-child a",
progress: 2,
tooltip: {
title: "Suppliers Manager",
content: "<strong>This is where you will find a list of all your suppliers.</strong><br><br>To Add 'Your Company Name' click the default Supplier Name blue text 'Your Company' located above. <em>Help: Suppliers provide all your resources and up to date prices. Buildmate has already set up your company as a default supplier called 'Your Company' but you will need to change this to your company name. Your Company will provide the labour and one or more Builders Merchants and Plant hire companies will provide you with the materials and plant for each project.</em>"
}
};
$(document).ready(function () {
bm.tour(data);
});
</script>
</telerik:RadScriptBlock>
<telerik:RadScriptBlock ID="rsbPhase7" runat="server" Visible="false">
<script type="text/javascript">
var data = {
target: ".breadcrumb .button-create",
progress: 2,
tooltip: {
title: "Suppliers",
content: "Click on the green button 'New Supplier' located on the right.<br><br><em>Help: You can add unlimited suppliers and prioritise their use within each estimate.</em>"
}
};
$(document).ready(function () {
bm.tour(data);
$('.breadcrumb .button-create').on('click', function () {
var data = {
target: "#ctl00_MainContent_fvSupplierInsert_btnInsert",
progress: 2,
tooltip: {
title: "Adding a Supplier",
content: "Enter the supplier's details and click the green button 'Add Supplier' located at the bottom of the form to update the changes.<br><br><em>Help: You will need to add an 'ADDRESS' and a 'POSTCODE'. All other details are optional. On completion of the tutorial you can add unlimited suppliers and prioritise their use.</em>"
}
};
bm.tour(data);
});
});
</script>
</telerik:RadScriptBlock>
<telerik:RadScriptBlock ID="rsbPhase8" runat="server" Visible="false">
<script type="text/javascript">
var data = {
target: "#ctl00_hlResources",
progress: 2,
tooltip: {
title: "Now that you have a supplier you will need to link the resource you added to your job task to your supplier",
content: "<strong>Resources</strong><br>To Add a 'Resource to a Supplier' click 'Resources' on the tool bar above.<br><br><em>Help: Price maintenance - due to the variance in resource prices from region to region and the amount of trade discount your company receives. Buildmate is unable to provide you with accurate up to date prices for resources that are used within your estimates. To ensure you are using up to date prices you will need to link all the resources and their up to date prices you have used in your estimates to your suppliers.</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="rgSuppliers">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="rgSuppliers" />
<telerik:AjaxUpdatedControl ControlID="pNewSuppliers" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlId="pNewSuppliers">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="rgSuppliers" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlId="btnAddSupplier">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="rgSuppliers" />
<telerik:AjaxUpdatedControl ControlID="rcbSuppliers" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlId="fvSupplierInsert">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="fvSupplierInsert" />
<telerik:AjaxUpdatedControl ControlID="rgSuppliers" />
<telerik:AjaxUpdatedControl ControlID="notification" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<!-- begin add resource -->
<div id="addSupplier" class="md-window" data-modal="addSupplier">
<div class="md-content">
<h3>Adding a Supplier..</h3>
<asp:FormView ID="fvSupplierInsert" runat="server"
DataSourceId="insertSupplierDataSource"
Width="100%"
DataKeyNames="id"
DefaultMode="Insert">
<InsertItemTemplate>
<asp:Panel ID="Panel1" runat="server" DefaultButton="btnInsert">
<div class="md-details">
<div class="row">
<label for="rtbSupplierName" title="Supplier Name" class="label">Supplier Name*</label>
<telerik:RadTextBox ID="rtbSupplierName" runat="server"
Text='<%#Bind("supplierName") %>'
MaxLength="50"
Width="300px"
Columns="35"
EmptyMessage="Supplier Name" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="rtbSupplierName" ValidationGroup="insertGroup"
Display="Dynamic" ErrorMessage="Supplier Name">
<span class="req"></span>
</asp:RequiredFieldValidator>
</div>
<div class="row">
<label for="rtbAddress" title="Address" class="label">Address*</label>
<telerik:RadTextBox ID="rtbAddress" runat="server"
Width="300px" Rows="4" Columns="80"
Text='<%#Bind("address")%>' TextMode="MultiLine" EmptyMessage="Address" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="rtbAddress" ValidationGroup="insertGroup"
Display="Dynamic" ErrorMessage="Address">
<span class="req"></span>
</asp:RequiredFieldValidator>
</div>
<div class="row">
<label for="rtbPostcode" title="Postcode" class="label">Postcode*</label>
<telerik:RadTextBox ID="rtbPostcode" runat="server" Text='<%#Bind("postcode")%>' Columns="35" EmptyMessage="Postcode" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="rtbPostcode" ValidationGroup="insertGroup"
Display="Dynamic" ErrorMessage="Postcode">
<span class="req"></span>
</asp:RequiredFieldValidator>
</div>
<div class="row">
<label for="rtbEmail" title="Email" class="label">Email</label>
<telerik:RadTextBox ID="rtbEmail" runat="server" Text='<%#Bind("email") %>' Columns="35" EmptyMessage="Email" />
</div>
<div class="row">
<label for="rtbTel" title="Telephone" class="label">Telephone</label>
<telerik:RadTextBox ID="rtbTel" runat="server" Text='<%#Bind("tel") %>' Columns="35" EmptyMessage="Telephone" />
</div>
<div class="row">
<label for="rtbFax" title="Fax" class="label">Fax</label>
<telerik:RadTextBox ID="rtbFax" runat="server" Text='<%#Bind("fax") %>' Columns="35" EmptyMessage="Fax" />
</div>
<div class="row">
<label for="rtbURL" title="Website" class="label">Website</label>
<telerik:RadTextBox ID="rtbURL" runat="server" Text='<%#Bind("URL") %>' Columns="35" EmptyMessage="Website" />
</div>
</div>
<div class="md-footer">
<asp:Button ID="btnInsert" runat="server" CommandName="Insert"
OnClientClick="validateModal()"
ValidationGroup="insertGroup" Text="Add Supplier" CssClass="button button-create" />
<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="addSupplier" class="js-open-modal button button-create">New Supplier</a></li>
</ul>
<ul class="breadcrumb-list">
<li class="active">Suppliers</li>
</ul>
</div>
</div>
<div class="main-container">
<asp:Panel ID="pMainPanel" runat="server">
<div class="div75">
<telerik:RadGrid ID="rgSuppliers" runat="server"
DataSourceID="suppliersDataSource"
AllowAutomaticUpdates="true"
AllowAutomaticDeletes="true"
AutoGenerateColumns="false"
GridLines="None"
AllowSorting="true"
ShowStatusBar="true">
<MasterTableView
DataSourceID="suppliersDataSource"
AutoGenerateColumns="False"
GridLines="None"
NoMasterRecordsText=" No Suppliers were found."
DataKeyNames="id">
<Columns>
<telerik:GridTemplateColumn
UniqueName="supplier"
HeaderText="Supplier Name">
<ItemTemplate>
<asp:HyperLink ID="hlSupplier" runat="server" />
<asp:Label ID="lblSupplier" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn
UniqueName="position"
HeaderText="Change Priority"
HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HiddenField ID="hiddenId" runat="server" Value='<%# Bind("id") %>' />
<asp:LinkButton ID="lbUp" runat="server"
CommandArgument='<%# eval("position") %>'
CssClass="pinArrow"
ToolTip="Move Up"
CommandName="MoveUp">⇑</asp:LinkButton>
<asp:LinkButton ID="lbDown" runat="server"
CommandArgument='<%# eval("position") %>'
ToolTip="Move Down"
CssClass="pinArrow"
CommandName="MoveDown">⇓</asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn
UniqueName="isLocked"
HeaderText="isLocked"
Visible="false"
DataField="isLocked" />
<telerik:GridBoundColumn
UniqueName="supplierId"
HeaderText="supplierId"
Visible="false"
DataField="supplierId" />
<telerik:GridBoundColumn
UniqueName="supplierName"
HeaderText="supplierName"
Visible="false"
DataField="supplierName" />
<telerik:GridButtonColumn
ConfirmText="Remove this Supplier?"
ConfirmTitle="Delete"
ButtonType="ImageButton"
CommandName="Delete"
HeaderStyle-Width="5%"
Text="Delete"
UniqueName="DeleteColumn" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
</div>
<div class="div25 div-last">
<asp:Panel ID="pNewSuppliers" runat="server">
<div class="box">
<h3>Unused Suppliers</h3>
<div class="boxcontent">
<p>
Select a Supplier to use in your Projects.
</p>
<p>
<telerik:RadComboBox
ID="rcbSuppliers"
runat="server"
DataSourceID="newSupplierDataSource"
DataTextField="supplierName"
DataValueField="id" />
</p>
<div class="form-actions">
<asp:Button ID="btnAddSupplier" runat="server" Text="Add this Supplier" CssClass="button button-create" />
</div>
</div>
</div>
</asp:Panel>
</div>
</asp:Panel>
</div>
<asp:SqlDataSource
ID="suppliersDataSource"
runat="server"
ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
Deletecommand="deleteSupplierPriority"
DeleteCommandType="StoredProcedure"
SelectCommand="getSupplierPriorityListByUserId"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter Name="UserId" SessionField="UserId" />
</SelectParameters>
<DeleteParameters>
<asp:SessionParameter Name="UserId" SessionField="UserId" />
</DeleteParameters>
</asp:SqlDataSource>
<asp:SqlDataSource
ID="newSupplierDataSource"
runat="server"
ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
SelectCommand="getSuppliersNotAssignedToUser"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter Name="UserId" SessionField="UserId" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource
ID="insertSupplierDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
InsertCommand="insertSupplier"
InsertCommandType="StoredProcedure">
<InsertParameters>
<asp:SessionParameter name="UserId" SessionField="UserId" />
<asp:Parameter Name="NewId" Type="Int64" Direction="Output" />
</InsertParameters>
</asp:SqlDataSource>
<asp:SqlDataSource
ID="countryDataSource"
runat="server"
ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
SelectCommand="getCountries"
SelectCommandType="StoredProcedure" />
</asp:Content>