1: using System;
2: using System.ComponentModel.DataAnnotations;
3: using System.ComponentModel.DataAnnotations.Schema;
4: using System.Linq;
5: using System.Threading;
6: using System.Threading.Tasks;
7:
8: namespace Ia.Ngn.Cl.Model.Huawei
9: {
10: ////////////////////////////////////////////////////////////////////////////
11:
12: /// <summary publish="true">
13: /// Huawei's Owsbr Entity Framework class for Optical Fiber Network (OFN) entity model.
14: /// </summary>
15: ///
16: /// <remarks>
17: /// Copyright © 2014-2021 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
18: ///
19: /// 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
20: /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
21: ///
22: /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
23: /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
24: ///
25: /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
26: ///
27: /// Copyright notice: This notice may not be removed or altered from any source distribution.
28: /// </remarks>
29: public class Owsbr
30: {
31: /// <summary/>
32: public enum ServiceTypeList { IMPU = 1, US }
33:
34: /// <summary/>
35: public Owsbr() { }
36:
37: /// <summary/>
38: public long Id { get; set; }
39:
40: /// <summary>
41: /// It specifies the IMPU of a specific subscriber. It can be a TEL URI or a SIP URI. The rules for setting the parameter are as follows:
42: /// To configure an IMPU in SIP URI format, type a string such as sip:userinfo@huawei.com or userinfo@huawei.com.
43: /// To configure an IMPU in TEL URI format, type a string such as tel:+867557780000 or +867557780000.
44: ///. Value: a string of a maximum of 128 characters. Default value: none. This parameter is mandatory.
45: /// </summary>
46: [Key]
47: public string IMPU { get; set; }
48:
49: /// <summary>
50: /// Options:
51: /// 0: NORMAL (NORMAL): The subscriber can originate and answer calls normally.
52: /// 1: OUTOWN (OUTOWN): The subscriber can answer calls but is forbidden to originate any call except for owing override calls.
53: /// 2: INOWN (INOWN): The subscriber is forbidden to answer calls but can originate calls.
54: /// 3: BOTHOWN (BOTHOWN): The subscriber is forbidden to answer and originate any calls.
55: /// </summary>
56: public int US { get; set; }
57:
58: /// <summary/>
59: public DateTime Created { get; set; }
60:
61: /// <summary/>
62: public DateTime Updated { get; set; }
63:
64: ////////////////////////////////////////////////////////////////////////////
65:
66: /// <summary>
67: ///
68: /// </summary>
69: public bool Equal(Owsbr owsbr)
70: {
71: // below: this will not check the Id, Created, Updated, or Viewed fields
72: bool areEqual;
73:
74: if (this.IMPU != owsbr.IMPU) areEqual = false;
75: else if (this.US != owsbr.US) { areEqual = false; }
76: else areEqual = true;
77:
78: return areEqual;
79: }
80:
81: ////////////////////////////////////////////////////////////////////////////
82:
83: /// <summary>
84: ///
85: /// </summary>
86: public bool Update(Owsbr owsbr)
87: {
88: // below: this will not update Id, IMPU, Created
89: bool updated;
90:
91: updated = false;
92:
93: if (this.US != owsbr.US) { this.US = owsbr.US; updated = true; }
94:
95: if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
96:
97: return updated;
98: }
99:
100: ////////////////////////////////////////////////////////////////////////////
101: ////////////////////////////////////////////////////////////////////////////
102:
103: /// <summary>
104: ///
105: /// </summary>
106: public string ToSimpleTextString()
107: {
108: return Ia.Ngn.Cl.Model.Data.Huawei.Owsbr.ToSimpleTextString(this);
109: }
110:
111: ////////////////////////////////////////////////////////////////////////////
112: ////////////////////////////////////////////////////////////////////////////
113: }
114:
115: ////////////////////////////////////////////////////////////////////////////
116: ////////////////////////////////////////////////////////////////////////////
117: }