kamagra how much to take

AspnetMembershipCommands Partial Class

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

  1.  
  2. //*****************************************************************************
  3. // This file is part of the data access layer example to the ASP.NET 2.0 provider database
  4. // This file was written by Adam Buenz [WSS MVP] of ARB Security Solutions, LLC
  5. //                  http://www.sharepointsecurity.com
  6. //
  7. // This file and its parts is free for re-distribution, for use in both free
  8. // and commercial applications, however this header must remain intact for legal
  9. // use. The data access layer example is distributed in the hope that it will
  10. // be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. //*****************************************************************************
  13. using System;
  14. using System.Collections.Generic;
  15. using System.Text;
  16. using System.Data;
  17. using System.Data.SqlClient;
  18.  
  19. namespace Aspnet.Provider.Datalayer.Commands
  20. {
  21.         /// <summary>
  22.         /// A command factory class for AspnetMembership objects.
  23.         /// </summary>
  24.         internal static partial class AspnetMembershipCommands
  25.         {
  26.                 /// <summary>
  27.                 /// Finds all AspnetMembership objects with a certain Applicationid value.
  28.                 /// </summary>
  29.                 /// <param name="applicationid">The Applicationid value.</param>
  30.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Applicationid value.</returns>
  31.                 public static IDbCommand FindByApplicationid(Guid applicationid)
  32.                 {
  33.                         SqlCommand cmd;
  34.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [ApplicationId] = @applicationid");
  35.                         cmd.Parameters.AddWithValue("@applicationid", applicationid);
  36.                         return cmd;
  37.                 }
  38.  
  39.                 /// <summary>
  40.                 /// Finds all AspnetMembership objects with a certain Password value.
  41.                 /// </summary>
  42.                 /// <param name="password">The Password value ('*' can be used as a wildcard).</param>
  43.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Password value.</returns>
  44.                 public static IDbCommand FindByPassword(string password)
  45.                 {
  46.                         SqlCommand cmd;
  47.                         if (password == null)
  48.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [Password] is null");
  49.                         else
  50.                         {
  51.                                 cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [Password] like @password");
  52.                                 cmd.Parameters.AddWithValue("@password", password.Replace("*", "%"));
  53.                         }
  54.                         return cmd;
  55.                 }
  56.  
  57.                 /// <summary>
  58.                 /// Finds all AspnetMembership objects with a certain Passwordformat value.
  59.                 /// </summary>
  60.                 /// <param name="passwordformat">The Passwordformat value.</param>
  61.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Passwordformat value.</returns>
  62.                 public static IDbCommand FindByPasswordformat(int passwordformat)
  63.                 {
  64.                         SqlCommand cmd;
  65.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [PasswordFormat] = @passwordformat");
  66.                         cmd.Parameters.AddWithValue("@passwordformat", passwordformat);
  67.                         return cmd;
  68.                 }
  69.  
  70.                 /// <summary>
  71.                 /// Finds all AspnetMembership objects with a certain Passwordsalt value.
  72.                 /// </summary>
  73.                 /// <param name="passwordsalt">The Passwordsalt value ('*' can be used as a wildcard).</param>
  74.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Passwordsalt value.</returns>
  75.                 public static IDbCommand FindByPasswordsalt(string passwordsalt)
  76.                 {
  77.                         SqlCommand cmd;
  78.                         if (passwordsalt == null)
  79.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [PasswordSalt] is null");
  80.                         else
  81.                         {
  82.                                 cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [PasswordSalt] like @passwordsalt");
  83.                                 cmd.Parameters.AddWithValue("@passwordsalt", passwordsalt.Replace("*", "%"));
  84.                         }
  85.                         return cmd;
  86.                 }
  87.  
  88.                 /// <summary>
  89.                 /// Finds all AspnetMembership objects with a certain Mobilepin value.
  90.                 /// </summary>
  91.                 /// <param name="mobilepin">The Mobilepin value ('*' can be used as a wildcard).</param>
  92.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Mobilepin value.</returns>
  93.                 public static IDbCommand FindByMobilepin(string mobilepin)
  94.                 {
  95.                         SqlCommand cmd;
  96.                         if (mobilepin == null)
  97.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [MobilePIN] is null");
  98.                         else
  99.                         {
  100.                                 cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [MobilePIN] like @mobilepin");
  101.                                 cmd.Parameters.AddWithValue("@mobilepin", mobilepin.Replace("*", "%"));
  102.                         }
  103.                         return cmd;
  104.                 }
  105.  
  106.                 /// <summary>
  107.                 /// Finds all AspnetMembership objects with a certain Email value.
  108.                 /// </summary>
  109.                 /// <param name="email">The Email value ('*' can be used as a wildcard).</param>
  110.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Email value.</returns>
  111.                 public static IDbCommand FindByEmail(string email)
  112.                 {
  113.                         SqlCommand cmd;
  114.                         if (email == null)
  115.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [Email] is null");
  116.                         else
  117.                         {
  118.                                 cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [Email] like @email");
  119.                                 cmd.Parameters.AddWithValue("@email", email.Replace("*", "%"));
  120.                         }
  121.                         return cmd;
  122.                 }
  123.  
  124.                 /// <summary>
  125.                 /// Finds all AspnetMembership objects with a certain Loweredemail value.
  126.                 /// </summary>
  127.                 /// <param name="loweredemail">The Loweredemail value ('*' can be used as a wildcard).</param>
  128.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Loweredemail value.</returns>
  129.                 public static IDbCommand FindByLoweredemail(string loweredemail)
  130.                 {
  131.                         SqlCommand cmd;
  132.                         if (loweredemail == null)
  133.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [LoweredEmail] is null");
  134.                         else
  135.                         {
  136.                                 cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [LoweredEmail] like @loweredemail");
  137.                                 cmd.Parameters.AddWithValue("@loweredemail", loweredemail.Replace("*", "%"));
  138.                         }
  139.                         return cmd;
  140.                 }
  141.  
  142.                 /// <summary>
  143.                 /// Finds all AspnetMembership objects with a certain Passwordquestion value.
  144.                 /// </summary>
  145.                 /// <param name="passwordquestion">The Passwordquestion value ('*' can be used as a wildcard).</param>
  146.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Passwordquestion value.</returns>
  147.                 public static IDbCommand FindByPasswordquestion(string passwordquestion)
  148.                 {
  149.                         SqlCommand cmd;
  150.                         if (passwordquestion == null)
  151.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [PasswordQuestion] is null");
  152.                         else
  153.                         {
  154.                                 cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [PasswordQuestion] like @passwordquestion");
  155.                                 cmd.Parameters.AddWithValue("@passwordquestion", passwordquestion.Replace("*", "%"));
  156.                         }
  157.                         return cmd;
  158.                 }
  159.  
  160.                 /// <summary>
  161.                 /// Finds all AspnetMembership objects with a certain Passwordanswer value.
  162.                 /// </summary>
  163.                 /// <param name="passwordanswer">The Passwordanswer value ('*' can be used as a wildcard).</param>
  164.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Passwordanswer value.</returns>
  165.                 public static IDbCommand FindByPasswordanswer(string passwordanswer)
  166.                 {
  167.                         SqlCommand cmd;
  168.                         if (passwordanswer == null)
  169.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [PasswordAnswer] is null");
  170.                         else
  171.                         {
  172.                                 cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [PasswordAnswer] like @passwordanswer");
  173.                                 cmd.Parameters.AddWithValue("@passwordanswer", passwordanswer.Replace("*", "%"));
  174.                         }
  175.                         return cmd;
  176.                 }
  177.  
  178.                 /// <summary>
  179.                 /// Finds all AspnetMembership objects with a certain Isapproved value.
  180.                 /// </summary>
  181.                 /// <param name="isapproved">The Isapproved value.</param>
  182.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Isapproved value.</returns>
  183.                 public static IDbCommand FindByIsapproved(bool isapproved)
  184.                 {
  185.                         SqlCommand cmd;
  186.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [IsApproved] = @isapproved");
  187.                         cmd.Parameters.AddWithValue("@isapproved", isapproved);
  188.                         return cmd;
  189.                 }
  190.  
  191.                 /// <summary>
  192.                 /// Finds all AspnetMembership objects with a certain Islockedout value.
  193.                 /// </summary>
  194.                 /// <param name="islockedout">The Islockedout value.</param>
  195.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Islockedout value.</returns>
  196.                 public static IDbCommand FindByIslockedout(bool islockedout)
  197.                 {
  198.                         SqlCommand cmd;
  199.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [IsLockedOut] = @islockedout");
  200.                         cmd.Parameters.AddWithValue("@islockedout", islockedout);
  201.                         return cmd;
  202.                 }
  203.  
  204.                 /// <summary>
  205.                 /// Finds all AspnetMembership objects with a certain Createdate value.
  206.                 /// </summary>
  207.                 /// <param name="createdate">The Createdate value.</param>
  208.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Createdate value.</returns>
  209.                 public static IDbCommand FindByCreatedate(DateTime createdate)
  210.                 {
  211.                         SqlCommand cmd;
  212.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [CreateDate] = @createdate");
  213.                         cmd.Parameters.AddWithValue("@createdate", createdate);
  214.                         return cmd;
  215.                 }
  216.  
  217.                 /// <summary>
  218.                 /// Finds all AspnetMembership objects with a certain Lastlogindate value.
  219.                 /// </summary>
  220.                 /// <param name="lastlogindate">The Lastlogindate value.</param>
  221.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Lastlogindate value.</returns>
  222.                 public static IDbCommand FindByLastlogindate(DateTime lastlogindate)
  223.                 {
  224.                         SqlCommand cmd;
  225.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [LastLoginDate] = @lastlogindate");
  226.                         cmd.Parameters.AddWithValue("@lastlogindate", lastlogindate);
  227.                         return cmd;
  228.                 }
  229.  
  230.                 /// <summary>
  231.                 /// Finds all AspnetMembership objects with a certain Lastpasswordchangeddate value.
  232.                 /// </summary>
  233.                 /// <param name="lastpasswordchangeddate">The Lastpasswordchangeddate value.</param>
  234.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Lastpasswordchangeddate value.</returns>
  235.                 public static IDbCommand FindByLastpasswordchangeddate(DateTime lastpasswordchangeddate)
  236.                 {
  237.                         SqlCommand cmd;
  238.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [LastPasswordChangedDate] = @lastpasswordchangeddate");
  239.                         cmd.Parameters.AddWithValue("@lastpasswordchangeddate", lastpasswordchangeddate);
  240.                         return cmd;
  241.                 }
  242.  
  243.                 /// <summary>
  244.                 /// Finds all AspnetMembership objects with a certain Lastlockoutdate value.
  245.                 /// </summary>
  246.                 /// <param name="lastlockoutdate">The Lastlockoutdate value.</param>
  247.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Lastlockoutdate value.</returns>
  248.                 public static IDbCommand FindByLastlockoutdate(DateTime lastlockoutdate)
  249.                 {
  250.                         SqlCommand cmd;
  251.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [LastLockoutDate] = @lastlockoutdate");
  252.                         cmd.Parameters.AddWithValue("@lastlockoutdate", lastlockoutdate);
  253.                         return cmd;
  254.                 }
  255.  
  256.                 /// <summary>
  257.                 /// Finds all AspnetMembership objects with a certain Failedpasswordattemptcount value.
  258.                 /// </summary>
  259.                 /// <param name="failedpasswordattemptcount">The Failedpasswordattemptcount value.</param>
  260.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Failedpasswordattemptcount value.</returns>
  261.                 public static IDbCommand FindByFailedpasswordattemptcount(int failedpasswordattemptcount)
  262.                 {
  263.                         SqlCommand cmd;
  264.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [FailedPasswordAttemptCount] = @failedpasswordattemptcount");
  265.                         cmd.Parameters.AddWithValue("@failedpasswordattemptcount", failedpasswordattemptcount);
  266.                         return cmd;
  267.                 }
  268.  
  269.                 /// <summary>
  270.                 /// Finds all AspnetMembership objects with a certain Failedpasswordattemptwindowstart value.
  271.                 /// </summary>
  272.                 /// <param name="failedpasswordattemptwindowstart">The Failedpasswordattemptwindowstart value.</param>
  273.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Failedpasswordattemptwindowstart value.</returns>
  274.                 public static IDbCommand FindByFailedpasswordattemptwindowstart(DateTime failedpasswordattemptwindowstart)
  275.                 {
  276.                         SqlCommand cmd;
  277.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [FailedPasswordAttemptWindowStart] = @failedpasswordattemptwindowstart");
  278.                         cmd.Parameters.AddWithValue("@failedpasswordattemptwindowstart", failedpasswordattemptwindowstart);
  279.                         return cmd;
  280.                 }
  281.  
  282.                 /// <summary>
  283.                 /// Finds all AspnetMembership objects with a certain Failedpasswordanswerattemptcount value.
  284.                 /// </summary>
  285.                 /// <param name="failedpasswordanswerattemptcount">The Failedpasswordanswerattemptcount value.</param>
  286.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Failedpasswordanswerattemptcount value.</returns>
  287.                 public static IDbCommand FindByFailedpasswordanswerattemptcount(int failedpasswordanswerattemptcount)
  288.                 {
  289.                         SqlCommand cmd;
  290.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [FailedPasswordAnswerAttemptCount] = @failedpasswordanswerattemptcount");
  291.                         cmd.Parameters.AddWithValue("@failedpasswordanswerattemptcount", failedpasswordanswerattemptcount);
  292.                         return cmd;
  293.                 }
  294.  
  295.                 /// <summary>
  296.                 /// Finds all AspnetMembership objects with a certain Failedpasswordanswerattemptwindowstart value.
  297.                 /// </summary>
  298.                 /// <param name="failedpasswordanswerattemptwindowstart">The Failedpasswordanswerattemptwindowstart value.</param>
  299.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Failedpasswordanswerattemptwindowstart value.</returns>
  300.                 public static IDbCommand FindByFailedpasswordanswerattemptwindowstart(DateTime failedpasswordanswerattemptwindowstart)
  301.                 {
  302.                         SqlCommand cmd;
  303.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [FailedPasswordAnswerAttemptWindowStart] = @failedpasswordanswerattemptwindowstart");
  304.                         cmd.Parameters.AddWithValue("@failedpasswordanswerattemptwindowstart", failedpasswordanswerattemptwindowstart);
  305.                         return cmd;
  306.                 }
  307.  
  308.                 /// <summary>
  309.                 /// Finds all AspnetMembership objects with a certain Comment value.
  310.                 /// </summary>
  311.                 /// <param name="comment">The Comment value ('*' can be used as a wildcard).</param>
  312.                 /// <returns>An IDbCommand that finds all AspnetMembership objects with a certain Comment value.</returns>
  313.                 public static IDbCommand FindByComment(string comment)
  314.                 {
  315.                         SqlCommand cmd;
  316.                         if (comment == null)
  317.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [Comment] is null");
  318.                         else
  319.                         {
  320.                                 cmd = new SqlCommand("select * from [dbo].[aspnet_Membership] where [Comment] like @comment");
  321.                                 cmd.Parameters.AddWithValue("@comment", comment.Replace("*", "%"));
  322.                         }
  323.                         return cmd;
  324.                 }
  325.  
  326.         }
  327. }
  328.  
  329.  
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>