Exemple #1
0
 protected void cmdYes_Click(object sender, EventArgs e)
 {
     try
     {
         if (!String.IsNullOrEmpty(LabelEA.Text))
         {
             string sMessage = SM.DeleteADAccount(LabelEA.Text.Trim());
             if (sMessage.Contains("deleted"))
             {
                 string saltShakerUserName = string.Format("AMSA\\{0}", SaltShakerSession.UserId);
                 Members.SetMemberTableActiveFlag(false, LabelEA.Text, saltShakerUserName);
             }
             ShowMessage(sMessage);
             PHAlertbox.Visible       = false;
             CheckBoxActive.Text      = "Deactivated";
             CheckBoxActive.BackColor = Color.Red;
             CheckBoxActive.Checked   = true;
             CheckBoxActive.Enabled   = false;
             //deactivation also sets WelcomeEmail, but member is no refresh yet
         }
     }
     catch (Exception ex)
     {
         ExceptionMessageException Oops = new ExceptionMessageException(String.Format(GlobalMessages.sMSG_WARNING, ex.Message));
         ShowMessage(Oops.Message);
         PHAlertbox.Visible = false;
     }
 }
Exemple #2
0
        //protected void cmdToggleActivate_Click(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        if (!String.IsNullOrEmpty(SaltUserEmail.Text))
        //        {
        //            string sMessage = SM.Deactivate(SaltUserEmail.Text);
        //            if (sMessage.IndexOf("deactivated") < 0)
        //            {
        //                cmdToggleActivate.Text = "Deactivate user";
        //                BL.SetMemberTableActiveFlag(true, SaltUserEmail.Text);
        //            }
        //            else
        //            {
        //                cmdToggleActivate.Text = "Re-Activate user";
        //                BL.SetMemberTableActiveFlag(false, SaltUserEmail.Text);
        //            }

        //            ShowMessage(sMessage);

        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        //needs loging
        //        ExceptionMessageException Oops = new ExceptionMessageException(String.Format(sMSG_WARNING, ex.Message));
        //        ShowMessage(Oops.Message);
        //    }
        //}

        protected void cmdYes_Click(object sender, EventArgs e)
        {
            try
            {
                if (!String.IsNullOrEmpty(SaltUserEmail.Text))
                {
                    string sMessage = SM.DeleteADAccount(SaltUserEmail.Text.Trim());
                    if (sMessage.Contains("deleted"))
                    {
                        string userName = string.Format("AMSA\\{0}", SaltShakerSession.UserId);
                        BL.SetMemberTableActiveFlag(false, SaltUserEmail.Text, userName);
                        PHListUserInfo.Visible = false;
                    }
                    SaltUserEmail.Text        = "";
                    TextUserEmailAddress.Text = "";
                    ShowMessage(sMessage);
                    PHAlertbox.Visible = false;
                }
            }
            catch (Exception ex)
            {
                //needs loging
                ExceptionMessageException Oops = new ExceptionMessageException(String.Format(sMSG_WARNING, ex.Message));
                ShowMessage(Oops.Message);
                PHListUserInfo.Visible = true;
                PHAlertbox.Visible     = false;
            }
        }