分类
外匯交易的優點與特點

如何在Binarium注册并存钱

如何在Binarium注册并存钱

WEB页面代码裡

myus为null

public Users adminLogin(Users users)

using (DataClassesDataContext dataCC = 如何在Binarium注册并存钱 如何在Binarium注册并存钱 new DataClassesDataContext())

Users myus = new Users(); //myus.LoginId和myus.LoginPwd这边应该是空字符串
var result = from u in dataCC.Users where myus.LoginId == users.LoginId && myus.LoginPwd == users.LoginPwd select u;
Users returnUser = null;
foreach (Users item in result)

myus.UserRoles = new UserRoles();
myus.UserRoles.Id = Convert.ToInt32(item.UserRoleId);
returnUser = myus;
break;
> 如何在Binarium注册并存钱
return returnUser;
>
>

  • 답변으로 제안됨 Jackie-Sun Moderator 2011년 9월 1일 목요일 오전 6:41
  • 답변으로 표시됨 冯瑞涛 Moderator 2011년 9월 24일 토요일 오전 1:48

모든 응답

授权是你的业务逻辑,怎么放在DAL了? The following is signature, not part of post
Please mark the post answered your question as the answer, and 如何在Binarium注册并存钱 mark other helpful posts as helpful, 如何在Binarium注册并存钱 so they will appear differently 如何在Binarium注册并存钱 to other users who are visiting your thread for the same problem.
Visual C++ MVP

授权是你的业务逻辑,怎么放在DAL了? The following is signature, not part of post
Please mark the post answered your question as the answer, and mark 如何在Binarium注册并存钱 other helpful posts as helpful, 如何在Binarium注册并存钱 so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP


有可能我描述不太正确,下面是DAL层中UserService.cs 的一个ADO.NET登录方法,我的意思是,怎么用LINQ写这样的一个方法

public User adminLogin(User user)
string sql = "select UserRoleId from dbo.Users where [email protected] and [email protected]";
using (SqlConnection conn = new SqlConnection(MyBook))
SqlCommand com = new SqlCommand(sql, conn);
com.Parameters.Add("@LoginId", SqlDbType.NVarChar).Value = user.LoginId;
com.Parameters.Add("@LoginPwd", SqlDbType.NVarChar).Value = user.LoginPwd;
conn.Open();
using (SqlDataReader dr = com.ExecuteReader())
if (dr.Read())
User u = new User();
u.userRole = new UserRole();
u.userRole.Id = Convert.ToInt32(dr["UserRoleId"]);
return u;
>
else
return null;
>
>

如何在Binarium注册并存钱

WEB页面代码裡

myus为null

public Users adminLogin(Users users)

using (DataClassesDataContext dataCC = new DataClassesDataContext())

Users myus = new Users(); //myus.LoginId和myus.LoginPwd这边应该是空字符串
如何在Binarium注册并存钱 var result = from u in dataCC.Users where myus.LoginId == users.LoginId && myus.LoginPwd == users.LoginPwd select u;
Users returnUser = null;
foreach (Users item in result)

myus.UserRoles = new UserRoles();
myus.UserRoles.Id = Convert.ToInt32(item.UserRoleId);
returnUser = myus;
break;
>
return returnUser;
>
>

  • 답변으로 제안됨 Jackie-Sun Moderator 2011년 9월 1일 목요일 오전 6:41
  • 답변으로 표시됨 冯瑞涛 Moderator 2011년 9월 24일 토요일 오전 1:48

모든 응답

授权是你的业务逻辑,怎么放在DAL了? The following 如何在Binarium注册并存钱 is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to 如何在Binarium注册并存钱 other users who are visiting your 如何在Binarium注册并存钱 如何在Binarium注册并存钱 thread for the same problem.
Visual C++ MVP

授权是你的业务逻辑,怎么放在DAL了? The following is signature, not part of post
Please mark the post answered your question as the answer, and mark 如何在Binarium注册并存钱 other helpful posts as helpful, so they will appear differently to other users who are visiting your 如何在Binarium注册并存钱 thread for the same problem.
Visual C++ MVP


有可能我描述不太正确,下面是DAL层中UserService.cs 的一个ADO.NET登录方法,我的意思是,怎么用LINQ写这样的一个方法

public User adminLogin(User user)
string sql = "select UserRoleId from dbo.Users where [email protected] and [email protected]";
using (SqlConnection conn = new 如何在Binarium注册并存钱 SqlConnection(MyBook))
SqlCommand com = new SqlCommand(sql, conn);
com.Parameters.Add("@LoginId", SqlDbType.NVarChar).Value 如何在Binarium注册并存钱 = user.LoginId;
com.Parameters.Add("@LoginPwd", SqlDbType.NVarChar).Value = user.LoginPwd;
conn.Open();
using (SqlDataReader dr = com.ExecuteReader())
if (dr.Read())
User u = new User();
u.userRole = new UserRole();
u.userRole.Id = Convert.ToInt32(dr["UserRoleId"]);
return u;
>
else
return null;
>
>