예제 #1
0
 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();
     }
 }
예제 #2
0
        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();

                }
            }
        }
예제 #3
0
        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");

                }
            }
        }