日期:2014-05-17 浏览次数:20468 次
public bool Login(UserModel um) { bool flag = false; string sql = "select * from User where UserName=@username"; SqlParameter[] paras = new SqlParameter[]{ new SqlParameter("username",um.UserName), new SqlParameter("userpwd",um.UserPwd), new SqlParameter("departmentname",um.DepartMentName) }; int res = sqlhelper.CheckLogin(sql,paras,CommandType.Text); if (res > 0) { flag = true; } return flag; }
public bool Login(UserModel um) { bool flag = false; string sql = "select * from User where UserName=@username And userpwd=@userpwd And departmentname=@departmentname"; SqlParameter[] paras = new SqlParameter[]{ new SqlParameter("@username",um.UserName), new SqlParameter("@userpwd",um.UserPwd), new SqlParameter("@departmentname",um.DepartMentName) }; int res = sqlhelper.CheckLogin(sql,paras,CommandType.Text); if (res > 0) { flag = true; } return flag; }