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