public UsersDto PostLoginUser(UsersDto userDto) { var cn = new SqlConnection(GetConnection()); var user = new UsersDto(); try { cn.Open(); string cmdText = "select um.UserId,um.UserName,um.MemberId,um.UserTypeId,mm.FirstName from Users um left join Members mm on mm.MemberId = um.MemberId left join Passwords pw on pw.UserId = um.UserId Where um.UserName = '******' and pw.Password = '******'"; var cmd = new SqlCommand(cmdText, cn); var dr = cmd.ExecuteReader(); while (dr.Read()) { user.UserName = Convert.ToString(dr["UserName"]); user.UserId = Convert.ToInt32(dr["UserId"]); user.UserTypeId = Convert.ToInt32(dr["UserTypeId"]); user.MemberId = dr.IsDBNull(2) ? 0 : Convert.ToInt32(dr["MemberId"]); user.MemberName = Convert.ToString(dr["FirstName"]); } cn.Close(); } catch (Exception) { cn.Close(); } return user; }
public UsersDto PostLoginUser(UsersDto userDto) { return _iUserHelper.PostLoginUser(userDto); }
public UsersDto PostLoginUser(UsersDto userDto) { return _iUserRepository.PostLoginUser(userDto); }