-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScopeViewer.xaml.cs
636 lines (464 loc) · 20.9 KB
/
ScopeViewer.xaml.cs
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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using MRNNexus_Model;
namespace MRNUIElements
{
/// <summary>
/// Interaction logic for ScopeViewer.xaml
/// </summary>
public partial class ScopeViewer : Page
{
public ServiceLayer s1 = ServiceLayer.getInstance();
public List<DTO_Scope> claimscopelist = new List<DTO_Scope>();
public int scopetype;
public DTO_Scope scope = new DTO_Scope();
public double acv;
public double depreciation;
public double roof;
public int ScopeID;
public bool bab=true;
private double temp = 0;
DTO_Claim claim = new DTO_Claim();
public ScopeViewer()
{
InitializeComponent();
ClearData();
SubmitScopeEntry.IsEnabled = false;
this.claimIDComboBox.DataContext = s1.ClaimsList;
}
private void radioButton_Checked(object sender, RoutedEventArgs e)
{
claim = (DTO_Claim)claimIDComboBox.SelectedValue;
ClaimScopeListProcessingForDisplay(GetScopes(claim), 1);
totalTextBox.IsEnabled = true;
DisplayScopeInfo(GetScopes(claim),1, claim);
}
private void radioButton_Copy_Checked(object sender, RoutedEventArgs e)
{
// DTO_Claim claim = new DTO_Claim();
claim = (DTO_Claim)claimIDComboBox.SelectedValue;
ClaimScopeListProcessingForDisplay(GetScopes(claim), 2);
totalTextBox.IsEnabled = true;
DisplayScopeInfo(GetScopes(claim), 2, claim);
}
private void radioButton_Copy1_Checked(object sender, RoutedEventArgs e)
{
// DTO_Claim claim = new DTO_Claim();
claim = (DTO_Claim)claimIDComboBox.SelectedValue;
ClaimScopeListProcessingForDisplay(GetScopes(claim), 3);
totalTextBox.IsEnabled = true;
DisplayScopeInfo(GetScopes(claim), 3, claim);
}
private int SetScopeByScopeID(DTO_Scope scope)
{
int i = scope.ScopeTypeID;
switch (i)
{
case 1:
{
ImageBrush ib = new ImageBrush();
ib.ImageSource = new BitmapImage(new Uri(@"../../ResourceFiles/CheckMark.png", UriKind.Relative));
MRNEstimateStatusImage.Background = ib;
radioButton.IsChecked = true;
claimscopelist.Add(scope);
return i;
}
case 2:
{
ImageBrush ib = new ImageBrush();
ib.ImageSource = new BitmapImage(new Uri(@"../../ResourceFiles/CheckMark.png", UriKind.Relative));
OldScopeStatusImage.Background = ib;
radioButton_Copy.IsChecked = true;
claimscopelist.Add(scope);
return i;
}
case 3:
{
ImageBrush ib = new ImageBrush();
ib.ImageSource = new BitmapImage(new Uri(@"../../ResourceFiles/CheckMark.png", UriKind.Relative));
NewScopeStatusImage.Background = ib;
radioButton_Copy1.IsChecked = true;
return i;
}
default:
{
if (i < 1)
{
if (MessageBoxResult.Yes == MessageBox.Show("No Scopes were available for this Claim. Would you like to enter our estimate details?", "No previous data found", MessageBoxButton.YesNo, MessageBoxImage.Question))
{
radioButton.IsChecked = true;
claimscopelist.Add(scope);
i = 1;
}
}
else if (i > 3)
{
if (MessageBoxResult.Yes == MessageBox.Show("A Scope with an out of range value has been found for this claim it may be a final scope. Would you like to enter the view it's details?", "Scope Out of Range", MessageBoxButton.YesNo, MessageBoxImage.Warning))
{
radioButton_Copy1.IsChecked = true;
i = 3;
}
}
}
return i;
}
}
public List<DTO_Scope> GetScopes(DTO_Claim claim)
{
// if (s1.ScopesList.Count == 1)
//{
// if (s1.ScopesList[0].Message != string.Empty)
// claimscopelist.Clear();
// DTO_Scope scope = new DTO_Scope();
//// scope.ScopeTypeID = 1;
// claimscopelist.Add(scope);
// }
ImageBrush ib = new ImageBrush();
ib.ImageSource = new BitmapImage(new Uri(@"../../ResourceFiles/XMark.png", UriKind.Relative));
MRNEstimateStatusImage.Background = ib;
OldScopeStatusImage.Background = ib;
NewScopeStatusImage.Background = ib;
claimscopelist.Clear();
foreach (DTO_Scope c in s1.ScopesList)
{
if (c.ClaimID == claim.ClaimID)
{
claimscopelist.Add(c);
SetScopeByScopeID(c);
}
}
return claimscopelist;
}
private DTO_Scope ClaimScopeListProcessingForDisplay(List<DTO_Scope> cl, int ScopeTypeRequested)
{
if (cl.Count == 0)
{
if (MessageBoxResult.Yes == MessageBox.Show("The scope type you requested has not been saved for this claim, in fact no scopes are recorded for this claim. Would you like to enter the estimate details now?", "No previous data found", MessageBoxButton.YesNo, MessageBoxImage.Question))
return new DTO_Scope();
}
foreach (DTO_Scope c in cl)
{
if (c.ScopeTypeID == ScopeTypeRequested) return c; ; //found it send it back
}
return null;
}
async private void SubmitScopeEntry_Click(object sender, RoutedEventArgs e)
{
if (MessageBoxResult.Yes == MessageBox.Show("Are the figures correct?", "Confirm addition of information to claim", MessageBoxButton.YesNo, MessageBoxImage.Question))
{
await AddScope((DTO_Claim)claimIDComboBox.SelectedValue, GetScopeTypeByButtonSelected());
//NexusHome Page = new NexusHome();
//this.NavigationService.Navigate(Page);
}
}
private void CancelScopeEntry_Click(object sender, RoutedEventArgs e)
{
NexusHome Page = new NexusHome();
this.NavigationService.Navigate(Page);
}
private void claimIDComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (bab == false)
{
// DTO_Claim claim = new DTO_Claim();
claim = (DTO_Claim)claimIDComboBox.SelectedValue;
ClaimScopeListProcessingForDisplay(GetScopes(claim),GetScopeTypeByButtonSelected());
totalTextBox.IsEnabled = true;
DisplayScopeInfo(GetScopes(claim),GetScopeTypeByButtonSelected(),claim);
}
bab = false;
}
private void totalTextBox_GotFocus(object sender, RoutedEventArgs e)
{
if (totalTextBox.Text == string.Empty) totalTextBox.Text = "0";
totalTextBox.SelectAll();
}
private void totalTextBox_LostFocus(object sender, RoutedEventArgs e)
{
if (totalTextBox.Text == string.Empty) totalTextBox.Text = "0";
exteriorTextBox.IsEnabled = true;
exteriorTextBox.SelectAll();
ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void totalTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
if (totalTextBox.Text == string.Empty) totalTextBox.Text = "0"; ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void exteriorTextBox_LostFocus(object sender, RoutedEventArgs e)
{
if (exteriorTextBox.Text == string.Empty) exteriorTextBox.Text = "0";
gutterTextBox.IsEnabled = true;
gutterTextBox.SelectAll(); ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void exteriorTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
if (exteriorTextBox.Text == string.Empty) exteriorTextBox.Text = "0";
ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void gutterTextBox_LostFocus(object sender, RoutedEventArgs e)
{ if (gutterTextBox.Text == string.Empty) gutterTextBox.Text = "0";
interiorTextBox.IsEnabled = true;
interiorTextBox.SelectAll(); ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void gutterTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
{
if (gutterTextBox.Text == string.Empty) gutterTextBox.Text = "0";
temp = double.Parse(gutterTextBox.Text); ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
}
private void interiorTextBox_LostFocus(object sender, RoutedEventArgs e)
{
if (interiorTextBox.Text == string.Empty) interiorTextBox.Text = "0";
oandPTextBox.IsEnabled = true;
oandPTextBox.SelectAll(); ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void interiorTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
if (interiorTextBox.Text == string.Empty) interiorTextBox.Text = "0";
ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void oandPTextBox_LostFocus(object sender, RoutedEventArgs e)
{
if (oandPTextBox.Text == string.Empty) oandPTextBox.Text = "0";
taxTextBox.IsEnabled = true;
taxTextBox.SelectAll(); ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void oandPTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
if (oandPTextBox.Text == string.Empty) oandPTextBox.Text = "0";
ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void taxTextBox_LostFocus(object sender, RoutedEventArgs e)
{
if (taxTextBox.Text == string.Empty) taxTextBox.Text = "0";
deductibleTextBox.IsEnabled = true;
deductibleTextBox.SelectAll(); ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void taxTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
if (taxTextBox.Text == string.Empty) taxTextBox.Text = "0";
ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void deductibleTextBox_LostFocus(object sender, RoutedEventArgs e)
{ if (deductibleTextBox.Text == string.Empty) deductibleTextBox.Text = "0";
SubmitScopeEntry.IsEnabled = true;
ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void deductibleTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
if (deductibleTextBox.Text == string.Empty) deductibleTextBox.Text = "0";
ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void Roof_TextChanged(object sender, TextChangedEventArgs e)
{
if (Roof.Text == string.Empty) Roof.Text = "0";
ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private void Roof_LostFocus(object sender, RoutedEventArgs e)
{
ACV.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text,deductibleTextBox.Text, taxTextBox.Text, true);
Depreciation.Text = Calculate(interiorTextBox.Text, exteriorTextBox.Text, gutterTextBox.Text, Roof.Text, totalTextBox.Text, oandPTextBox.Text, deductibleTextBox.Text, taxTextBox.Text, false);
}
private int SetDisplayToScopeTypeIDByScope(DTO_Scope s)
{
int scopeType = s.ScopeTypeID;
if (scopeType == 1) { radioButton.IsChecked = true; }
if (scopeType == 2) { radioButton_Copy.IsChecked = true; }
if (scopeType == 3) { radioButton_Copy1.IsChecked = true; }
return scopeType;
}
private int GetScopeTypeByButtonSelected()
{
int i = 0;
if (radioButton.IsChecked == true) return 1;
else if (radioButton_Copy.IsChecked == true) return 2;
else if (radioButton_Copy1.IsChecked == true) return 3;
else if (i < 1) return 1;
else if (i > 3) return 3;
else return i;
}
virtual public double Calculate(DTO_Scope scope, bool acv=true)
{
if (acv)
return scope.Total - scope.Interior - scope.Exterior - scope.Gutter - scope.RoofAmount - scope.Deductible - scope.OandP - scope.Tax;
else
return scope.Total - scope.Interior - scope.Exterior - scope.Gutter - scope.RoofAmount - scope.Tax;
}
virtual public double Calculate(double interior, double exterior, double gutters, double roof, double total, double oandp,double deductible, double tax,bool acv=true)
{
if (acv)
return total - interior - exterior - gutters - roof - deductible- oandp;
else return total - interior - exterior - gutters - roof - tax;
}
virtual public string Calculate(string interior="0", string exterior="0", string gutters = "0", string roof = "0", string total = "0", string oandp = "0", string tax = "0", string deductible="0", bool acv= true)
{
string w;
double a, b, c, d, e, f, g,h;
if (interior == "") interior = "0";
a = double.Parse(interior);
if (exterior == "") exterior = "0";
b = double.Parse(exterior);
if (gutters == "") gutters = "0";
c = double.Parse(gutters);
if (roof == "") roof = "0";
d = double.Parse(roof);
if (total == "") total = "0";
e = double.Parse(total);
if (oandp == "") oandp = "0";
f = double.Parse(oandp);
if (tax == "") tax = "0";
g = double.Parse(tax);
if (deductible == "") deductible = "0";
h = double.Parse(deductible);
if (acv)
return (e - a - b - c - d - f - g-h).ToString();
return (e - a - b - c - d - g).ToString();
}
private DTO_Scope DisplayScopeInfo(List<DTO_Scope> scopelist, int typescope, DTO_Claim c)
{
DTO_Scope t = new DTO_Scope();
if (scope != null && c != null && typescope > 0 && typescope < 4)
{
foreach (DTO_Scope s in scopelist)
{
if (s.ScopeTypeID == typescope)
{
bool b = s.ScopeID.Equals(t.ScopeID);
if (!b)
{
SetDisplayToScopeTypeIDByScope(s);
deductibleTextBox.Text = s.Deductible.ToString();
oandPTextBox.Text = s.OandP.ToString();
interiorTextBox.Text = s.Interior.ToString();
gutterTextBox.Text = s.Gutter.ToString();
totalTextBox.Text = s.Total.ToString();
exteriorTextBox.Text = s.Exterior.ToString();
taxTextBox.Text = s.Tax.ToString();
Roof.Text = s.RoofAmount.ToString();
return scope;
}
else return t;
}
}
} return t;
}
private void ClearData()
{
deductibleTextBox.Text = "0";
oandPTextBox.Text = "0";
interiorTextBox.Text = "0";
gutterTextBox.Text = "0";
totalTextBox.Text = "0";
exteriorTextBox.Text = "0";
taxTextBox.Text = "0";
ACV.Text = "0";
Roof.Text = "0";
Depreciation.Text = "0";
SubmitScopeEntry.IsEnabled = false;
}
private async Task<bool> AddScope(DTO_Claim claim, int typescope)
{
int claimstatustypeid = 0;
switch (typescope)
{
case 1:
{
claimstatustypeid = 4; //estimate 4
break;
}
case 2:
{
claimstatustypeid = 6; //originalscope 6
break;
}
case 3:
{
claimstatustypeid = 10; //newscope(aka) supplementsettled 10
break;
}
}
await s1.AddScope(new DTO_Scope
{
ClaimID = claim.ClaimID,
Deductible = double.Parse(deductibleTextBox.Text),
Exterior = double.Parse(exteriorTextBox.Text),
Interior = double.Parse(interiorTextBox.Text),
Gutter = double.Parse(gutterTextBox.Text),
ScopeTypeID = typescope,
Tax = double.Parse(taxTextBox.Text),
OandP = double.Parse(oandPTextBox.Text),
Total = double.Parse(totalTextBox.Text),
RoofAmount = double.Parse(Roof.Text)
});
if (s1.Scope.Message == null)
{
await s1.AddClaimStatus(new DTO_ClaimStatus
{
ClaimID = claim.ClaimID,
ClaimStatusTypeID = claimstatustypeid,
ClaimStatusDate = DateTime.Today
});
if (s1.ClaimStatus.Message == null)
{
MessageBox.Show(s1.ClaimStatus.ClaimStatusID.ToString());
}
else
{
MessageBox.Show(s1.ClaimStatus.Message);
}
MessageBox.Show(s1.Scope.ScopeID.ToString());
}
else
{
MessageBox.Show(s1.Scope.Message);
}
return true;
}
private void ShapePickerBtn_Click(object sender, RoutedEventArgs e)
{
RoofInspectionWizard Page = new RoofInspectionWizard();
NavigationService.Navigate(Page);
}
}
}
//namespace MRNUIElements
//{
// /// <summary>
// /// Interaction logic for ScopeViewer.xaml
// /// </summary>
// public partial class ScopeViewer : Page
// {
// public ScopeViewer()
// {
// InitializeComponent();
// }
// }
//}