温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:三层班级留言本源码
当前文件路径:ClassSay/UserInfoLib/UserInfo.cs

1using System; 2
using System.Collections.Generic; 3
using System.Text; 4
using System.Data; 5
using System.Data.SqlClient; 6
using DataAccessLib; 7
//51_a_s_p_x.c_o_m 8
9
namespace UserInfoLib 10
{ 11
public class ConfigFile 12
{ 13
public static readonly string stringConnection = System.Configuration.ConfigurationSettings.AppSettings["SrtConnection"]; 14
} 15
16
public class UserInfo 17
{ 18
//注册信息 19
public void User() 20
{ 21
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 22
SqlParameter[] parms = new SqlParameter[11]; 23
parms[0] = new SqlParameter("@UserName",this.username); 24
parms[1] = new SqlParameter("@UserPassword", this.userpassword); 25
parms[2] = new SqlParameter("@UserQQ", this.userqq); 26
parms[3] = new SqlParameter("@UserMsn", this.usermsn); 27
parms[4] = new SqlParameter("@UserAddress", this.useraddress); 28
parms[5] = new SqlParameter("@UserEmail", this.useremail); 29
parms[6] = new SqlParameter("@UserTel", this.usertel); 30
parms[7] = new SqlParameter("@UserYeah", this.useryeah); 31
parms[8] = new SqlParameter("@UserAge", this.userage); 32
parms[9] = new SqlParameter("@UserLable", this.userlable); 33
parms[10] = new SqlParameter("@UserImage", this.userimage); 34
35
db.ExcuteProc("CreateUser", parms); 36
37
} 38
public string SeleUserName() 39
{ 40
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 41
SqlParameter[] parms = new SqlParameter[1]; 42
parms[0] = new SqlParameter("@UserName", this.username); 43
44
return (string)db.ExecuteProcScalar("SeleNameUser", parms); 45
} 46
private int userqq; 47
public int UserQQ 48
{ 49
get 50
{ 51
return userqq; 52
} 53
set 54
{ 55
userqq = value; 56
} 57
} 58
private string usermsn; 59
public string UserMsn 60
{ 61
get 62
{ 63
return usermsn; 64
} 65
set 66
{ 67
usermsn = value; 68
} 69
} 70
private string useraddress; 71
public string UserAddress 72
{ 73
get 74
{ 75
return useraddress; 76
} 77
set 78
{ 79
useraddress = value; 80
} 81
} 82
private string useremail; 83
public string UserEmail 84
{ 85
get 86
{ 87
return useremail; 88
} 89
set 90
{ 91
useremail = value; 92
} 93
} 94
private string usertel; 95
public string YserTel 96
{ 97
get 98
{ 99
return usertel; 100
} 101
set 102
{ 103
usertel = value; 104
} 105
} 106
private string useryeah; 107
public string UserYeah 108
{ 109
get 110
{ 111
return useryeah; 112
} 113
set 114
{ 115
useryeah = value; 116
} 117
} 118
private int userage; 119
public int UserAge 120
{ 121
get 122
{ 123
return userage; 124
} 125
set 126
{ 127
userage = value; 128
} 129
} 130
private string userlable; 131
public string UserLable 132
{ 133
get 134
{ 135
return userlable; 136
} 137
set 138
{ 139
userlable = value; 140
} 141
} 142
private string userimage; 143
public string UserImage 144
{ 145
get 146
{ 147
return userimage; 148
} 149
set 150
{ 151
userimage = value; 152
} 153
} 154
155
// 156
public static DataSet Sele() 157
{ 158
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 159
return db.GetDataSetFromExcuteProc("TextSelect", "ClassText", null); 160
} 161
162
public string UserRoot() 163
{ 164
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 165
166
SqlParameter[] paras = new SqlParameter[3]; 167
paras[0] = new SqlParameter("@UserName", this.username); 168
paras[1] = new SqlParameter("@UserPassword", this.userpassword); 169
paras[2] = new SqlParameter("@UserRoot", SqlDbType.Char,1); 170
paras[2].Direction = ParameterDirection.Output; 171
172
return db.UserRoot("UserProc", paras); 173
} 174
175
public void Update() 176
{ 177
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 178
179
SqlParameter[] paras = new SqlParameter[4]; 180
paras[0] = new SqlParameter("@UserName", this.username); 181
paras[1] = new SqlParameter("@UserPassword", this.userpassword); 182
paras[2] = new SqlParameter("@UserLable", this.userlable); 183
paras[3] = new SqlParameter("@UserImage", this.userimage); 184
185
db.ExcuteProc("UpdateUser", paras); 186
} 187
public DataSet SeleUpdate() 188
{ 189
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 190
191
SqlParameter[] paras = new SqlParameter[1]; 192
paras[0] = new SqlParameter("@UserName", this.username); 193
194
return db.GetDataSetFromExcuteProc("seleUpdateUser","table",paras); 195
} 196
public int InsertText() 197
{ 198
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 199
200
SqlParameter[] paras = new SqlParameter[4]; 201
paras[0] = new SqlParameter( "@UserName", this.username ); 202
paras[1] = new SqlParameter("@UserTtitle", this.usertitle); 203
paras[2] = new SqlParameter("@UserText", this.usertext); 204
paras[3] = new SqlParameter("@UserData", this.time); 205
206
return db.ExcuteProc( "InsertText", paras ); 207
} 208
public DataSet SeleBack() 209
{ 210
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 211
212
SqlParameter[] paras = new SqlParameter[1]; 213
paras[0] = new SqlParameter("@TextID", this.textID); 214
215
return db.GetDataSetFromExcuteProc("SeleBack", "back", paras); 216
} 217
//插入回复 218
public int InsertBack() 219
{ 220
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 221
222
SqlParameter[] paras = new SqlParameter[3]; 223
paras[0] = new SqlParameter("@TextID", this.textID); 224
paras[1] = new SqlParameter("@UserName", this.username); 225
paras[2] = new SqlParameter("@BackBody", this.backbody); 226
227
return db.ExcuteProc("BackTable", paras); 228
} 229
230
public void UpdateText() 231
{ 232
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 233
234
SqlParameter[] paras = new SqlParameter[3]; 235
paras[0] = new SqlParameter("@TextID", this.textID); 236
paras[1] = new SqlParameter("@UserText", this.usertext); 237
paras[2] = new SqlParameter("@UserData", this.time); 238
239
db.ExcuteProc("UpdateClassText", paras); 240
} 241
public static int CountText() 242
{ 243
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 244
return ((int)db.ExecuteProcScalar("SeleUserSum", null)); 245
246
} 247
public static int CountTextSum() 248
{ 249
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 250
return ((int)db.ExecuteProcScalar("CountText", null)); 251
} 252
public static string SeleGG() 253
{ 254
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 255
256
return (string)db.ExecuteProcScalar("seleGG", null); 257
} 258
public static DataSet SeleUser() 259
{ 260
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 261
262
return db.GetDataSetFromExcuteProc("NameUser","User",null); 263
} 264
public void UpdateSum() 265
{ 266
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 267
268
SqlParameter[] parms = new SqlParameter[1]; 269
parms[0] = new SqlParameter("@CountUser", this.textID); 270
271
db.ExcuteProc("UpdateSumUser", parms); 272
} 273
public void UpdateGG() 274
{ 275
IDataAccess db = Factory.GetDBAccess(AccessDBType.SQL, ConfigFile.stringConnection); 276
277
SqlParameter[] parms =





}