예제 #1
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         var nPassword = NewPassword();
         var CompEmail = WSConfig.ObjNav.FnUpdatePassword(txtEmployeeNo.Text.Trim(), idNo.Text.Trim(), nPassword);
         if (WSConfig.MailFunction(string.Format("DEAR MEMBER,\n YOUR NEW PASSWORD IS {0}", nPassword), CompEmail,
                                   "PORTAL PASSWORD RESET") && !String.IsNullOrEmpty(CompEmail))
         {
             SACCOFactory.ShowAlert(
                 "A New Password has been generated and sent to your Personal mail.Kindly use to it to login to your Member portal");
         }
         else
         {
             SACCOFactory.ShowAlert(
                 "An error occurred while sending you a new password. Kindly consult ICT for more details.");
         }
     }
     catch (Exception exception)
     {
         SACCOFactory.ShowAlert(exception.Message);
     }
     btnSubmit.Visible   = false;
     btnBack.Visible     = false;
     btnPassword.Visible = true;
     btnLogin.Visible    = true;
     MultiView1.SetActiveView(View1);
 }
예제 #2
0
        protected void btnResetJpass_Click(object sender, EventArgs e)
        {
            string userName     = txtAccountno.Text.Trim().Replace("'", "");
            string userPassword = txtidNo.Text.Trim().Replace("'", "");



            var idcheck    = WSConfig.ObjNav.FnGetSignatoryId(userName, userPassword);
            var emalcheck  = WSConfig.ObjNav.FnGetSignatoryEmail(userName, userPassword);
            var phonecheck = WSConfig.ObjNav.FnGetSignatoryPhone(userName, userPassword);

            //var idcheck = nav.JointAccountLogin.Where(r => r.Account_No == userName).Select(k => k.ID_No).SingleOrDefault();
            //var emalcheck = nav.JointAccountLogin.Where(r => r.Account_No == userName).Select(k => k.Email_Address).SingleOrDefault();
            //var phonecheck = nav.JointAccountLogin.Where(r => r.Account_No == userName).Select(k => k.Mobile_Phone_No).SingleOrDefault();

            if (string.IsNullOrEmpty(userPassword) && string.IsNullOrEmpty(userName))
            {
                lblError.Text         = "Account No or National ID Empty!";
                btnResetJpass.Visible = true;
                btnBack.Visible       = true;
                //btnSignup.Visible = false;
                btnJlogin.Visible = false;
                MultiViewLoadLogins.SetActiveView(JointResetView);
                return;
            }
            else
            {
                try
                {
                    var nPassword = NewPassword();
                    var CompEmail = WSConfig.ObjNav.FnUpdatePasswordJointAccount(txtAccountno.Text.Trim(), txtidNo.Text.Trim(), EncryptP(nPassword));
                    if (WSConfig.MailFunction(string.Format("Dear Sacco Member,\n Your New password is: {0}", nPassword), CompEmail,
                                              "Portal password reset successful") && !String.IsNullOrEmpty(CompEmail))
                    {
                        SACCOFactory.ShowAlert(
                            "A New Password has been generated and sent to your Personal mail and Mobile Phone.Kindly use to it to login to your Member portal");
                        btnResetJpass.Visible = false;
                        //txtAccountno.Enabled = false;
                        //txtidNo.Enabled = false;
                        btnBack.Visible = false;
                        //MultiView1.SetActiveView(View1);
                        //btnSignup.Visible = true;
                        btnJlogin.Visible = true;
                        lblError.Text     = "";
                    }
                    else if (idcheck != userPassword)
                    {
                        SACCOFactory.ShowAlert(
                            "Your Password could not be reset. Account number does not match your ID number!");
                        btnSubmit.Visible = true;
                        btnBack.Visible   = true;
                        //btnSignup.Visible = false;
                        btnJlogin.Visible = false;
                        MultiViewLoadLogins.SetActiveView(JointResetView);
                    }
                    else if (string.IsNullOrEmpty(emalcheck) && phonecheck != null)
                    {
                        SACCOFactory.ShowAlert(
                            "Your Password was send to your Phone Number");
                        btnSubmit.Visible     = false;
                        txtEmployeeNo.Enabled = false;
                        idNo.Enabled          = false;
                        btnBack.Visible       = false;
                        //  MultiView1.SetActiveView(View1);
                        //btnSignup.Visible = true;
                        btnJlogin.Visible = true;
                        lblError.Text     = "";
                    }
                }
                catch (Exception exception)
                {
                    SACCOFactory.ShowAlert(exception.Message);
                }
            }
            btnResetJpass.Visible = true;
            btnBack.Visible       = true;
            //btnSignup.Visible = false;
            btnJlogin.Visible = false;
            MultiViewLoadLogins.SetActiveView(JointResetView);
        }
예제 #3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string userName     = txtEmployeeNo.Text.Trim().Replace("'", "");
            string userPassword = idNo.Text.Trim().Replace("'", "");

            var idcheck    = nav.MemberList.Where(r => r.No == userName).Select(k => k.ID_No).FirstOrDefault();
            var emalcheck  = nav.MemberList.Where(r => r.No == userName).Select(k => k.E_Mail).FirstOrDefault();
            var phonecheck = nav.MemberList.Where(r => r.No == userName).Select(k => k.Phone_No).FirstOrDefault();

            if (string.IsNullOrEmpty(userPassword) && string.IsNullOrEmpty(userName))
            {
                lblError.Text     = "Member No or National ID Empty!";
                btnSubmit.Visible = true;
                btnBack.Visible   = true;
                //btnSignup.Visible = false;
                btnLogin.Visible = false;
                MultiView1.SetActiveView(View2);
                return;
            }
            else
            {
                try
                {
                    var nPassword = NewPassword();
                    var CompEmail = WSConfig.ObjNav.FnUpdatePassword(txtEmployeeNo.Text.Trim(), idNo.Text.Trim(), nPassword);
                    if (WSConfig.MailFunction(string.Format("Dear Sacco Member,\n Your New password is: {0}", nPassword), CompEmail,
                                              "Portal password reset successful") && !String.IsNullOrEmpty(CompEmail))
                    {
                        SACCOFactory.ShowAlert(
                            "A New Password has been generated and sent to your Personal mail.Kindly use to it to login to your Member portal");
                        btnSubmit.Visible = true;
                        btnBack.Visible   = true;
                        //btnSignup.Visible = false;
                        btnLogin.Visible = false;
                        MultiView1.SetActiveView(View2);
                        lblError.Text = "New Password generated!";
                    }
                    else if (idcheck != userPassword)
                    {
                        SACCOFactory.ShowAlert(
                            "Your Password could not be reset. Member number does not match your ID number!");
                        btnSubmit.Visible = true;
                        btnBack.Visible   = true;
                        btnLogin.Visible  = false;
                        MultiView1.SetActiveView(View2);
                    }
                    else if (string.IsNullOrEmpty(emalcheck) && phonecheck != null)
                    {
                        SACCOFactory.ShowAlert(
                            "Your Password was send to your Phone Number");
                        btnSubmit.Visible     = false;
                        txtEmployeeNo.Enabled = false;
                        idNo.Enabled          = false;
                        btnBack.Visible       = false;
                        MultiView1.SetActiveView(View1);
                        btnLogin.Visible = true;
                        lblError.Text    = "Your Password was send to your Phone Number";
                    }
                }
                catch (Exception exception)
                {
                    SACCOFactory.ShowAlert(exception.Message);
                }
            }
            btnSubmit.Visible = true;
            btnBack.Visible   = true;
            //btnSignup.Visible = false;
            btnLogin.Visible = false;
            MultiView1.SetActiveView(View2);
        }