kamagra how much to take

AspnetUsersCommands Partial Class

This command factory creates static partial classes that generate parameterized database commands to the ASP.NET database, in this case the “Users” table. This partial class could be extended to include your own queries if you desired.

  1.   //*****************************************************************************
  2. // This file is part of the data access layer example to the ASP.NET 2.0 provider database
  3. // This file was written by Adam Buenz [WSS MVP] of ARB Security Solutions, LLC
  4. // http://www.sharepointsecurity.com
  5. //
  6. // This file and its parts is free for re-distribution, for use in both free
  7. // and commercial applications, however this header must remain intact for legal
  8. // use. The data access layer example is distributed in the hope that it will
  9. // be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. //*****************************************************************************
  12. using System;
  13. using System.Collections.Generic;
  14. using System.Text;
  15. using System.Data;
  16. using System.Data.SqlClient;
  17.  
  18. namespace Aspnet.Provider.Datalayer.Commands
  19. {
  20. ///
  21. /// A command factory class for AspnetUsers objects.
  22. ///
  23. internal static partial class AspnetUsersCommands
  24. {
  25. ///
  26. /// Finds all AspnetUsers objects with a certain Applicationid value.
  27. ///
  28. ///
  29. The Applicationid value. /// An IDbCommand that finds all AspnetUsers objects with a certain Applicationid value.
  30. public static IDbCommand FindByApplicationid(Guid applicationid)
  31. {
  32. SqlCommand cmd;
  33. cmd = new SqlCommand("select * from [dbo].[aspnet_Users] where [ApplicationId] = @applicationid");
  34. cmd.Parameters.AddWithValue("@applicationid", applicationid);
  35. return cmd;
  36. }
  37.  
  38. ///
  39. /// Finds all AspnetUsers objects with a certain Username value.
  40. ///
  41. ///
  42. The Username value ('*' can be used as a wildcard). /// An IDbCommand that finds all AspnetUsers objects with a certain Username value.
  43. public static IDbCommand FindByUsername(string username)
  44. {
  45. SqlCommand cmd;
  46. if (username == null)
  47. cmd = new SqlCommand("select * from [dbo].[aspnet_Users] where [UserName] is null");
  48. else
  49. {
  50. cmd = new SqlCommand("select * from [dbo].[aspnet_Users] where [UserName] like @username");
  51. cmd.Parameters.AddWithValue("@username", username.Replace("*", "%"));
  52. }
  53. return cmd;
  54. }
  55.  
  56. ///
  57. /// Finds all AspnetUsers objects with a certain Loweredusername value.
  58. ///
  59. ///
  60. The Loweredusername value ('*' can be used as a wildcard). /// An IDbCommand that finds all AspnetUsers objects with a certain Loweredusername value.
  61. public static IDbCommand FindByLoweredusername(string loweredusername)
  62. {
  63. SqlCommand cmd;
  64. if (loweredusername == null)
  65. cmd = new SqlCommand("select * from [dbo].[aspnet_Users] where [LoweredUserName] is null");
  66. else
  67. {
  68. cmd = new SqlCommand("select * from [dbo].[aspnet_Users] where [LoweredUserName] like @loweredusername");
  69. cmd.Parameters.AddWithValue("@loweredusername", loweredusername.Replace("*", "%"));
  70. }
  71. return cmd;
  72. }
  73.  
  74. ///
  75. /// Finds all AspnetUsers objects with a certain Mobilealias value.
  76. ///
  77. ///
  78. The Mobilealias value ('*' can be used as a wildcard). /// An IDbCommand that finds all AspnetUsers objects with a certain Mobilealias value.
  79. public static IDbCommand FindByMobilealias(string mobilealias)
  80. {
  81. SqlCommand cmd;
  82. if (mobilealias == null)
  83. cmd = new SqlCommand("select * from [dbo].[aspnet_Users] where [MobileAlias] is null");
  84. else
  85. {
  86. cmd = new SqlCommand("select * from [dbo].[aspnet_Users] where [MobileAlias] like @mobilealias");
  87. cmd.Parameters.AddWithValue("@mobilealias", mobilealias.Replace("*", "%"));
  88. }
  89. return cmd;
  90. }
  91.  
  92. ///
  93. /// Finds all AspnetUsers objects with a certain Isanonymous value.
  94. ///
  95. ///
  96. The Isanonymous value. /// An IDbCommand that finds all AspnetUsers objects with a certain Isanonymous value.
  97. public static IDbCommand FindByIsanonymous(bool isanonymous)
  98. {
  99. SqlCommand cmd;
  100. cmd = new SqlCommand("select * from [dbo].[aspnet_Users] where [IsAnonymous] = @isanonymous");
  101. cmd.Parameters.AddWithValue("@isanonymous", isanonymous);
  102. return cmd;
  103. }
  104.  
  105. ///
  106. /// Finds all AspnetUsers objects with a certain Lastactivitydate value.
  107. ///
  108. ///
  109. The Lastactivitydate value. /// An IDbCommand that finds all AspnetUsers objects with a certain Lastactivitydate value.
  110. public static IDbCommand FindByLastactivitydate(DateTime lastactivitydate)
  111. {
  112. SqlCommand cmd;
  113. cmd = new SqlCommand("select * from [dbo].[aspnet_Users] where [LastActivityDate] = @lastactivitydate");
  114. cmd.Parameters.AddWithValue("@lastactivitydate", lastactivitydate);
  115. return cmd;
  116. }
  117.  
  118. }
  119. }
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>