protected void uiGridViewCurrentUsers_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditUser") { SiteUsers objData = new SiteUsers(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); CurrentSiteUsers = objData; uiTextBoxFullName.Text = objData.UserFullName; uiTextBoxUserName.Text = objData.UserName; uiTextBoxTele.Text = objData.Telephone; uiFCKeditorPage.Value = Server.HtmlDecode(objData.UserPage); uiTextBoxMail.Text = objData.Email; uiTextBoxJob.Text = objData.Job; uiTextBoxInfo.Text = objData.OtherInfo; if(!objData.IsColumnNull("IsApproved")) uiCheckBoxApproved.Checked = objData.IsApproved; uiPanelViewAllPages.Visible = false; uiPanelEdit.Visible = true; } else if (e.CommandName == "DeleteUser") { SiteUsers objData = new SiteUsers(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); BindData(); BindDataRequests(); } }
protected void uiButtonLogin_Click(object sender, EventArgs e) { SiteUsers user = new SiteUsers(); uiLabelError.Visible = false; uiLabelError.Visible = false; user.GetUserByUserNameAndPassword(uiTextBoxUserName.Text, uiTextBoxPassword.Text); if (user.RowCount == 0) { uiLabelError.Visible = true; } else { if (user.IsColumnNull("IsApproved") || !user.IsApproved) { uiLabelError.Visible = false; uiLabelNotApproved.Visible = true; } else { Session["CurrentUser"] = user; ViewLoginPanel(); } } }
protected void uiButtonUpdate_Click(object sender, EventArgs e) { SiteUsers user = new SiteUsers(); uiLabelError.Visible = false; user.GetUserByUserNameAndPassword(uiTextBoxUserName.Text, uiTextBoxPassword.Text); if (user.RowCount == 0) { uiLabelError.Visible = true; } else { if (user.IsColumnNull("IsApproved") || !user.IsApproved) { uiLabelError.Visible = false; uiLabelNotApproved.Visible = true; } else { Session["CurrentUser"] = user; Response.Redirect("Default.aspx"); } } }