protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { using (usersTableAdapter anAdapter = new usersTableAdapter()) { usersDataTable aTable; aTable = anAdapter.GetDataByCredentials(Login1.UserName, Login1.Password); if (aTable.Rows.Count == 1) { usersRow aRow = aTable.Rows[0] as usersRow; int userPK = aRow.userID; string userName = aRow.name; Hashtable aHash = new Hashtable() { { "userID", userPK }, { "userName", userName } }; Session.Add("UserInfo", aHash); Session.Add("userID", userPK); Session.Add("name", aRow.name); Session.Add("email", aRow.email); HttpCookie aCookie = new HttpCookie("user"); aCookie["userID"] = aRow.userID.ToString(); Response.Cookies.Add(aCookie); if (Request.QueryString["ReturnUrl"] != string.Empty) { FormsAuthentication.RedirectFromLoginPage(userPK.ToString(), false); FormsAuthentication.SetAuthCookie(userPK.ToString(), false); } } } }
public usersRowChangeEvent(usersRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; }
public void RemoveusersRow(usersRow row) { this.Rows.Remove(row); }
public void AddusersRow(usersRow row) { this.Rows.Add(row); }
public usersettingsRow AddusersettingsRow(usersRow parentusersRowByFK_usersettings_users, int savepasswd, string passwd) { usersettingsRow rowusersettingsRow = ((usersettingsRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, null, savepasswd, passwd}; if ((parentusersRowByFK_usersettings_users != null)) { columnValuesArray[1] = parentusersRowByFK_usersettings_users[0]; } rowusersettingsRow.ItemArray = columnValuesArray; this.Rows.Add(rowusersettingsRow); return rowusersettingsRow; }