1: using System;
2:
3: namespace Ia.Ngn.Cl.Model
4: {
5: ////////////////////////////////////////////////////////////////////////////
6:
7: /// <summary publish="true">
8: /// Miscellaneous Entity Framework class for Next Generation Network (NGN) entity model.
9: /// </summary>
10: ///
11: /// <remarks>
12: /// Copyright © 2006-2017 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 partial class Miscellaneous
25: {
26: /// <summary/>
27: public Miscellaneous() { }
28:
29: /// <summary/>
30: public long Id { get; set; }
31: /// <summary/>
32: public int TypeId { get; set; }
33: /// <summary/>
34: public string Name { get; set; }
35: /// <summary/>
36: public bool Flag { get; set; }
37: /// <summary/>
38: public string Value { get; set; }
39: /// <summary/>
40: public DateTime Created { get; set; }
41: /// <summary/>
42: public DateTime Updated { get; set; }
43: /// <summary/>
44: public System.Guid UserId { get; set; }
45:
46: ////////////////////////////////////////////////////////////////////////////
47:
48: /// <summary>
49: ///
50: /// </summary>
51: public bool Equal(Miscellaneous item)
52: {
53: // below: this will not check the Id, Created, Updated fields
54: bool areEqual;
55:
56: if (this.TypeId != item.TypeId) areEqual = false;
57: else if (this.Name != item.Name) areEqual = false;
58: else if (this.Value != item.Value) areEqual = false;
59: else areEqual = true;
60:
61: return areEqual;
62: }
63:
64: ////////////////////////////////////////////////////////////////////////////
65:
66: /// <summary>
67: ///
68: /// </summary>
69: public bool Update(Miscellaneous item)
70: {
71: // below: this will not update Id, Created
72: bool updated;
73:
74: updated = false;
75:
76: if (this.Flag != item.Flag) { this.Flag = item.Flag; updated = true; }
77: if (this.TypeId != item.TypeId) { this.TypeId = item.TypeId; updated = true; }
78: if (this.Name != item.Name) { this.Name = item.Name; updated = true; }
79: if (this.Value != item.Value) { this.Value = item.Value; updated = true; }
80: if (this.UserId != item.UserId) { this.UserId = item.UserId; updated = true; }
81:
82: if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
83:
84: return updated;
85: }
86:
87: ////////////////////////////////////////////////////////////////////////////
88: ////////////////////////////////////////////////////////////////////////////
89: }
90:
91: ////////////////////////////////////////////////////////////////////////////
92: ////////////////////////////////////////////////////////////////////////////
93: }