您的位置:首页 > 其它

list<Model>判断用户是否存在,取出model只修改指定值

2014-05-04 20:20 281 查看
Dqt.Reporter.BLL.user UserBLL = new Dqt.Reporter.BLL.user();
Dqt.Reporter.Model.user UserModel = new Dqt.Reporter.Model.user();
List<Dqt.Reporter.Model.user> userlist = UserBLL.GetModelList("(UserName='" + txt_user_name.Text.Trim() + "' or Email='" + txt_user_name.Text.Trim() + "')" + " and UserPassword='" + MFunction.Md5HashString(txt_user_pwd.Text.Trim().ToString()) + "'");
if (userlist.Count > 0)
{
UserModel = userlist[0];
UserModel.LastLoginIp = Request.UserHostAddress;
UserModel.LastLoginTime = Util.TimeToUnixTimes(DateTime.Now.ToString());
UserBLL.Update(UserModel);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐