1: using System.Linq;
2:
3: namespace Ia.Ngn.Cl.Model.Business
4: {
5: ////////////////////////////////////////////////////////////////////////////
6:
7: /// <summary publish="true">
8: /// Address Framework class for Optical Fiber Network (OFN) business model.
9: /// </summary>
10: ///
11: /// <remarks>
12: /// Copyright © 2018-2019 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
13: ///
14: /// This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
15: /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
16: ///
17: /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
18: /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
19: ///
20: /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
21: ///
22: /// Copyright notice: This notice may not be removed or altered from any source distribution.
23: /// </remarks>
24: public class Address
25: {
26: /// <summary/>
27: public Address() { }
28:
29: /// <summary/>
30: public int AreaId { get; set; }
31:
32: /// <summary/>
33: public string Block { get; set; }
34:
35: /// <summary/>
36: public string Street { get; set; }
37:
38: /// <summary/>
39: public string Boulevard { get; set; }
40:
41: /// <summary/>
42: public string PremisesOld { get; set; }
43:
44: /// <summary/>
45: public string PremisesNew { get; set; }
46:
47: /// <summary/>
48: public string Paci { get; set; }
49:
50: /// <summary/>
51: public string Text
52: {
53: get
54: {
55: string address;
56:
57: if (this.AreaId != 0)
58: {
59: var kuwaitOfnArea = Ia.Ngn.Cl.Model.Data.Service.KuwaitOfnAreaById(this.AreaId);
60:
61: address = kuwaitOfnArea != null ? kuwaitOfnArea.Name : string.Empty;
62:
63: if (!string.IsNullOrEmpty(this.Block) && this.Block != "0") address += ", block " + this.Block;
64: if (!string.IsNullOrEmpty(this.Street) && this.Street != "0") address += ", street " + this.Street;
65: if (!string.IsNullOrEmpty(this.Boulevard) && this.Boulevard != "0") address += ", boulevard " + this.Boulevard;
66: if (!string.IsNullOrEmpty(this.PremisesOld) && this.PremisesOld != "0") address += ", old premises " + this.PremisesOld;
67: if (!string.IsNullOrEmpty(this.PremisesNew) && this.PremisesNew != "0") address += ", new premises " + this.PremisesNew;
68: }
69: else address = string.Empty;
70:
71: return address;
72: }
73: }
74:
75: ////////////////////////////////////////////////////////////////////////////
76: }
77:
78: ////////////////////////////////////////////////////////////////////////////
79: ////////////////////////////////////////////////////////////////////////////
80: }