Exemple #1
0
        }         // btnAdminCreateUser_Click

        protected void btnAdminResetPass_Click(object sender, EventArgs e)
        {
            divAdminMsg.InnerText = "Performing task...";

            if (selAdminUserResetPass.SelectedItem == null)
            {
                divAdminMsg.InnerText = "User not selected.";
                return;
            }             // if

            string sUserName = selAdminUserResetPass.SelectedItem.Value;

            string sPassword = edtAdminPassword.Text.Trim();

            if (sPassword.Length < 6)
            {
                divAdminMsg.InnerText = "Password too short.";
                return;
            }             // if

            var rpta = new ReportAuthenticationLib.ReportAuthentication(oDB, Log);

            try {
                rpta.ResetPassword(sUserName, sPassword);
                divAdminMsg.InnerText = "Password has been reset.";
            }
            catch (Exception ex) {
                divAdminMsg.InnerText = string.Format("Action failed: {0}", ex.Message);
            }             // try

            InitAdminArea(oDB);
        }         // btnAdminResetPass_Click
Exemple #2
0
        }         // btnAdminResetPass_Click

        protected void btnAdminDropUser_Click(object sender, EventArgs e)
        {
            divAdminMsg.InnerText = "Performing task...";

            if (selAdminUserDrop.SelectedItem == null)
            {
                divAdminMsg.InnerText = "User not selected.";
                return;
            }             // if

            var rpta = new ReportAuthenticationLib.ReportAuthentication(oDB, Log);

            try {
                int nUserID = Convert.ToInt32(selAdminUserDrop.SelectedItem.Value);
                rpta.DropUser(nUserID);
                divAdminMsg.InnerText = "User has been dropped.";
            }
            catch (Exception ex) {
                divAdminMsg.InnerText = string.Format("Action failed: {0}", ex.Message);
            }             // try

            InitAdminArea(oDB);
        }         // btnAdminDropUser_Click
Exemple #3
0
        }         // rblFilter_SelectedIndexChanged

        protected void btnAdminCreateUser_Click(object sender, EventArgs e)
        {
            divAdminMsg.InnerText = "Performing task...";

            string sUserName = edtAdminUserName.Text.Trim();

            if (sUserName.Length < 3)
            {
                divAdminMsg.InnerText = "User name too short.";
                return;
            }             // if

            var rpta = new ReportAuthenticationLib.ReportAuthentication(oDB, Log);

            try {
                rpta.AddUserToDb(sUserName, sUserName);
                divAdminMsg.InnerText = "User has been created.";
            }
            catch (Exception ex) {
                divAdminMsg.InnerText = string.Format("Action failed: {0}", ex.Message);
            }             // try

            InitAdminArea(oDB);
        }         // btnAdminCreateUser_Click