Exemple #1
0
    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
        AdminModelContainer model = new AdminModelContainer();

        AdminModel.Admin record = null;

        string encodePassword = EncodePassword(Login1.Password);

        try
        {
            record = (from x in model.AdminSet where x.Login == Login1.UserName && x.Password == encodePassword select x).First();
        }
        catch (Exception)
        { }
        if (record != null)
        {
            FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet);
        }
    }
 /// <summary>
 /// Deprecated Method for adding a new object to the AdminSet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAdminSet(Admin admin)
 {
     base.AddObject("AdminSet", admin);
 }
 /// <summary>
 /// Create a new Admin object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="login">Initial value of the Login property.</param>
 /// <param name="password">Initial value of the Password property.</param>
 public static Admin CreateAdmin(global::System.Int32 id, global::System.String login, global::System.String password)
 {
     Admin admin = new Admin();
     admin.Id = id;
     admin.Login = login;
     admin.Password = password;
     return admin;
 }