Example #1
0
    protected void submission(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            //check old password
            iVoteLoginProvider logger = new iVoteLoginProvider();
            databaseLogic dblogic = new databaseLogic();

            bool pw_correct = logger.ValidateUser(HttpContext.Current.User.Identity.Name.ToString(), oldPW.Text);
            if (pw_correct)
            {
                lblConfirm.Text = "Your password has been successfully changed.";
                string e_pw = logger.encrypt(newPW.Text);
                dblogic.updatePassword2(HttpContext.Current.User.Identity.Name.ToString(), e_pw);

            }
            else
                lblConfirm.Text = "Old password is incorrect.";
            //decrypt password fromt his
            //lblConfirm.Text = "Form in progress.";
            //change form state
            lblForm.Visible = false;
            //lblConfirm.Text = "Thank you.  Your password has been changed.";
        }
    }
Example #2
0
    protected void createScheme_Click(object sender, EventArgs e)
    {
        //Legacy
        databaseLogic dbLogic = new databaseLogic();
        dbLogic.createSchema();

        //NHibernate
        DatabaseEntities.NHibernateHelper.CreateSessionFactoryAndGenerateSchema();

        //Default committees
        ISession session = DatabaseEntities.NHibernateHelper.CreateSessionFactory().OpenSession();
        ITransaction transaction = session.BeginTransaction();

        Committee newCommittee = new Committee();
        newCommittee.Name = "Sabbatical Leave Committee";
        newCommittee.Description = "The Sabbatical Leave Committee receives applications for sabbatical and forwards recommendations to the University President.";
        newCommittee.PositionCount = 7;
        newCommittee.BargainingUnitRequired = true;
        newCommittee.TenureRequired = false;
        DatabaseEntities.NHibernateHelper.UpdateDatabase(session, newCommittee);

        newCommittee = new Committee();
        newCommittee.Name = "Promotion Committee";
        newCommittee.Description = "The University Promotion Committee reviews recommendations for promotion from Departmental Promotion Committees and recommends candidates for promotion to the University President. During the spring semester, members spend 4-6 hours per week in meetings.";
        newCommittee.PositionCount = 7;
        newCommittee.BargainingUnitRequired = true;
        newCommittee.TenureRequired = true;
        DatabaseEntities.NHibernateHelper.UpdateDatabase(session, newCommittee);

        newCommittee = new Committee();
        newCommittee.Name = "Tenure Committee";
        newCommittee.Description = "The University Tenure Committee reviews recommendations for tenure from Departmental Tenure Committees and recommends candidates for tenure to the University President. These activities take several hours per week during those periods when candidates are under active review.";
        newCommittee.PositionCount = 7;
        newCommittee.BargainingUnitRequired = true;
        newCommittee.TenureRequired = true;
        DatabaseEntities.NHibernateHelper.UpdateDatabase(session, newCommittee);

        DatabaseEntities.NHibernateHelper.Finished(transaction);

        createSchemaStatus.Visible = true;
        createScheme.Enabled = false;
    }
    protected void submission(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            //check old password
            iVoteLoginProvider logger = new iVoteLoginProvider();
            databaseLogic dblogic = new databaseLogic();

            bool pw_correct = logger.ValidateUser(HttpContext.Current.User.Identity.Name.ToString(), oldPW.Text);
            if (pw_correct && oldPW.Text != newPW.Text)
            {
                bool ChangePasswordSuccess = logger.ChangePassword(HttpContext.Current.User.Identity.Name.ToString(), oldPW.Text, newPW.Text);
                FailurePanel.Visible = false;
                SuccessPanel.Visible = true;
            }
            else
            {
                FailurePanel.Visible = true;
                SuccessPanel.Visible = false;
            }

        }
    }