您目前尚未登陆,请选择【登陆】或【注册
首页->电子商务->MyShop网络商城源码(mvc开发)>>BLL/User.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:MyShop网络商城源码(mvc开发)


当前文件路径:MyShop/BLL/User.cs 文件类型
普通视图
		            
1using System; 2using System.Collections.Generic; 3using System.Text.RegularExpressions; 4using System.Data; 5 6 7using MyShop.DALFactory; 8using MyShop.IDAL; 9using MyShop.Model; 10 11namespace MyShop.BLL 12{ 13 public class User 14 { 15 public ConfigInfo configInfo = new ConfigInfo(); 16 private IUser dal = DataAccess.CreateUser(); 17 18 public User() 19 { 20 Config config = new Config(); 21 configInfo = config.GetModel(); 22 } 23 24 25 IUser member 93 94 common 254 255 public UserInfo GetModel(string username) 256 { 257 username = Utils.ReplaceBadChar(username); 258 if (string.IsNullOrEmpty(username)) 259 return null; 260 DataSet dataset = new DataSet(); 261 dataset = GetDataSet(" username='" + username + "'"); 262 if (dataset != null && dataset.Tables[0].Rows.Count > 0) 263 return GetModel(dataset.Tables[0].Rows[0]); 264 return null; 265 } 266 267 /// <summary> 268 /// 用户名是否已被注册 269 /// </summary> 270 /// <param name="userName"></param> 271 /// <returns></returns> 272 public bool ExistUserName(string userName) 273 { 274 if(string.IsNullOrEmpty(userName)) 275 return true; 276 return Exist(" username ='" + Utils.ReplaceBadSQL(userName.Trim()) + "'"); 277 } 278 279 /// <summary> 280 /// 用户是否存在 281 /// </summary> 282 /// <param name="userName"></param> 283 /// <param name="password">未加密的明码</param> 284 /// <returns></returns> 285 public bool Exist(string userName, string password) 286 { 287 if (Exist("username = '" + userName +