f95098d098c2b35fd1c9575d7aba6dc69190e263
[mono.git] / mcs / class / FirebirdSql.Data.Firebird / FirebirdSql.Data.Firebird / Services / FbUserData.cs
1 /*
2  *      Firebird ADO.NET Data provider for .NET and Mono 
3  * 
4  *         The contents of this file are subject to the Initial 
5  *         Developer's Public License Version 1.0 (the "License"); 
6  *         you may not use this file except in compliance with the 
7  *         License. You may obtain a copy of the License at 
8  *         http://www.firebirdsql.org/index.php?op=doc&id=idpl
9  *
10  *         Software distributed under the License is distributed on 
11  *         an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 
12  *         express or implied. See the License for the specific 
13  *         language governing rights and limitations under the License.
14  * 
15  *      Copyright (c) 2002, 2005 Carlos Guzman Alvarez
16  *      All Rights Reserved.
17  */
18
19 using System;
20
21 namespace FirebirdSql.Data.Firebird.Services
22 {
23         /// <include file='Doc/en_EN/FbService.xml'     path='doc/class[@name="FbUserData"]/overview/*'/>
24         public sealed class FbUserData
25         {
26                 #region Fields
27
28                 private string  userName;
29                 private string  firstName;
30                 private string  lastName;
31                 private string  middleName;
32                 private string  userPassword;
33                 private string  groupName;
34                 private string  roleName;
35                 private int             userID;
36                 private int             groupID;
37
38                 #endregion
39
40                 #region Properties
41
42                 /// <include file='Doc/en_EN/FbService.xml'     path='doc/struct[@name="FbUserData"]/property[@name="UserName"]/*'/>
43                 public string UserName
44                 {
45                         get { return this.userName; }
46                         set
47                         {
48                                 if (value == null)
49                                 {
50                                         throw new InvalidOperationException("The user name cannot be null.");
51                                 }
52                                 if (value.Length > 31)
53                                 {
54                                         throw new InvalidOperationException("The user name cannot have more than 31 characters.");
55                                 }
56
57                                 this.userName = value;
58                         }
59                 }
60
61                 /// <include file='Doc/en_EN/FbService.xml'     path='doc/struct[@name="FbUserData"]/property[@name="UserPassword"]/*'/>
62                 public string UserPassword
63                 {
64                         get { return this.userPassword; }
65                         set
66                         {
67                                 if (value == null)
68                                 {
69                                         throw new InvalidOperationException("The user password cannot be null.");
70                                 }
71                                 if (value.Length > 31)
72                                 {
73                                         throw new InvalidOperationException("The user password cannot have more than 31 characters.");
74                                 }
75
76                                 this.userPassword = value;
77                         }
78                 }
79
80                 /// <include file='Doc/en_EN/FbService.xml'     path='doc/struct[@name="FbUserData"]/property[@name="FirstName"]/*'/>           
81                 public string FirstName
82                 {
83                         get { return this.firstName; }
84                         set { this.firstName = value; }
85                 }
86
87                 /// <include file='Doc/en_EN/FbService.xml'     path='doc/struct[@name="FbUserData"]/property[@name="LastName"]/*'/>
88                 public string LastName
89                 {
90                         get { return this.lastName; }
91                         set { this.lastName = value; }
92                 }
93
94                 /// <include file='Doc/en_EN/FbService.xml'     path='doc/struct[@name="FbUserData"]/property[@name="MiddleName"]/*'/>
95                 public string MiddleName
96                 {
97                         get { return this.middleName; }
98                         set { this.middleName = value; }
99                 }
100
101                 /// <include file='Doc/en_EN/FbService.xml'     path='doc/struct[@name="FbUserData"]/property[@name="UserID"]/*'/>
102                 public int UserID
103                 {
104                         get { return this.userID; }
105                         set { this.userID = value; }
106                 }
107
108                 /// <include file='Doc/en_EN/FbService.xml'     path='doc/struct[@name="FbUserData"]/property[@name="GroupID"]/*'/>
109                 public int GroupID
110                 {
111                         get { return this.groupID; }
112                         set { this.groupID = value; }
113                 }
114
115                 /// <include file='Doc/en_EN/FbService.xml'     path='doc/struct[@name="FbUserData"]/property[@name="GroupName"]/*'/>
116                 public string GroupName
117                 {
118                         get { return this.groupName; }
119                         set { this.groupName = value; }
120                 }
121
122                 /// <include file='Doc/en_EN/FbService.xml'     path='doc/struct[@name="FbUserData"]/property[@name="RoleName"]/*'/>
123                 public string RoleName
124                 {
125                         get { return this.roleName; }
126                         set { this.roleName = value; }
127                 }
128
129                 #endregion
130
131                 #region Constructors
132
133                 /// <include file='Doc/en_EN/FbService.xml'     path='doc/class[@name="FbUserData"]/constructor[@name="FbUserData"]/*'/>
134                 public FbUserData()
135                 {
136                         this.userName           = String.Empty;
137                         this.firstName          = String.Empty;
138                         this.lastName           = String.Empty;
139                         this.middleName         = String.Empty;
140                         this.userPassword       = String.Empty;
141                         this.roleName           = String.Empty;
142                 }
143
144                 #endregion
145         }
146 }