Exemplo n.º 1
0
 protected void btncpsubmit_Click(object sender, EventArgs e)
 {
     if (AppSessions.RoleID == 4)//student
     {
         Employee_BLogic BEmployee = new Employee_BLogic();
         Employee        PEmployee = new Employee();
         PEmployee.roleid      = AppSessions.RoleID;
         PEmployee.userid      = "";
         PEmployee.Studentlist = Convert.ToString(AppSessions.StudentID);
         PEmployee.password    = txtnp.Text;
         PEmployee.modifiedby  = AppSessions.EmpolyeeID;
         BEmployee.BAL_Employee_Password_Update(PEmployee);
     }
     else if (AppSessions.RoleID == 3 || AppSessions.RoleID == 2 || AppSessions.RoleID == 1) //3-teacher,2-sadmin,1-epath-admin
     {
         Employee_BLogic BEmployee = new Employee_BLogic();
         Employee        PEmployee = new Employee();
         PEmployee.roleid      = AppSessions.RoleID;
         PEmployee.userid      = Convert.ToString(AppSessions.EmpolyeeID);
         PEmployee.Studentlist = "";
         PEmployee.password    = txtnp.Text;
         PEmployee.modifiedby  = AppSessions.EmpolyeeID;
         BEmployee.BAL_Employee_Password_Update(PEmployee);
     }
     Response.Redirect("~/index.aspx?frm=cp");
 }
Exemplo n.º 2
0
    protected void btnChangesubmit_Click(object sender, EventArgs e)
    {
        if (AppSessions.RoleID == 4)//student
        {
            //Employee_BLogic BEmployee = new Employee_BLogic();
            //Employee PEmployee = new Employee();
            //PEmployee.roleid = AppSessions.RoleID;
            //PEmployee.userid = "";
            //PEmployee.Studentlist = Convert.ToString(AppSessions.StudentID);
            //PEmployee.password = txtnp.Text;
            //PEmployee.modifiedby = AppSessions.EmpolyeeID;
            //BEmployee.BAL_Employee_Password_Update(PEmployee);
            //lblmsg.Visible = true;
            DataSet   dtLogin   = new DataSet();
            DataTable LoginInfo = new DataTable();
            DataTable UserInfo  = new DataTable();

            SYS_Role        obj_SYS_Role     = new SYS_Role();
            SYS_Role_BLogic obj_BAL_SYS_Role = new SYS_Role_BLogic();
            obj_SYS_Role.Username = AppSessions.LoginID;
            obj_SYS_Role.Password = txtop.Text;

            dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Student_Login(obj_SYS_Role);
            LoginInfo = dtLogin.Tables[0];

            if (LoginInfo.Rows.Count > 0 && LoginInfo != null)
            {
                Employee_BLogic BEmployee = new Employee_BLogic();
                Employee        PEmployee = new Employee();
                PEmployee.roleid      = AppSessions.RoleID;
                PEmployee.userid      = "";
                PEmployee.Studentlist = Convert.ToString(AppSessions.StudentID);
                PEmployee.password    = txtnp.Text;
                PEmployee.modifiedby  = AppSessions.EmpolyeeID;
                BEmployee.BAL_Employee_Password_Update(PEmployee);
                lblmsg.Text = "Password changed successfully";

                TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), StringEnum.stringValueOf(EnumFile.AccessedPages.AccessMyAccount), "Change Password Tab", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.MyAccountChangedPassword), "Changed Password > From :  " + txtop.Text + " To : " + txtnp.Text, 0);
            }
            else
            {
                lblmsg.Visible = true;
                lblmsg.Text    = "Please enter valid old password.";
                //WebMsg.Show("Please enter valid old password.");
            }
        }
        else if (AppSessions.RoleID == 3 || AppSessions.RoleID == 2 || AppSessions.RoleID == 1) //3-teacher,2-sadmin,1-epath-admin
        {
            Employee_BLogic BEmployee = new Employee_BLogic();
            Employee        PEmployee = new Employee();
            PEmployee.roleid      = AppSessions.RoleID;
            PEmployee.userid      = Convert.ToString(AppSessions.EmpolyeeID);
            PEmployee.Studentlist = "";
            PEmployee.password    = txtnp.Text;
            PEmployee.modifiedby  = AppSessions.EmpolyeeID;
            BEmployee.BAL_Employee_Password_Update(PEmployee);
        }
    }
Exemplo n.º 3
0
    protected void btncpsubmit_Click(object sender, EventArgs e)
    {
        if (AppSessions.RoleID == 4)//student
        {
            DataSet   dtLogin   = new DataSet();
            DataTable LoginInfo = new DataTable();
            DataTable UserInfo  = new DataTable();

            SYS_Role        obj_SYS_Role     = new SYS_Role();
            SYS_Role_BLogic obj_BAL_SYS_Role = new SYS_Role_BLogic();
            obj_SYS_Role.Username = AppSessions.LoginID;
            obj_SYS_Role.Password = txtop.Text;

            dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Student_Login(obj_SYS_Role);
            LoginInfo = dtLogin.Tables[0];

            if (LoginInfo.Rows.Count > 0 && LoginInfo != null)
            {
                Employee_BLogic BEmployee = new Employee_BLogic();
                Employee        PEmployee = new Employee();
                PEmployee.roleid      = AppSessions.RoleID;
                PEmployee.userid      = "";
                PEmployee.Studentlist = Convert.ToString(AppSessions.StudentID);
                PEmployee.password    = txtnp.Text;
                PEmployee.modifiedby  = AppSessions.EmpolyeeID;
                BEmployee.BAL_Employee_Password_Update(PEmployee);
                //Response.Redirect("~/otherpages/Landing.aspx?frm=cp");
                Response.Redirect("../NewPublic/login.aspx?frm=cp");
            }
            else
            {
                WebMsg.Show("Please enter valid old password.");
            }
        }
        else if (AppSessions.RoleID == 3 || AppSessions.RoleID == 2 || AppSessions.RoleID == 1) //3-teacher,2-sadmin,1-epath-admin
        {
            Employee_BLogic BEmployee = new Employee_BLogic();
            Employee        PEmployee = new Employee();
            PEmployee.roleid      = AppSessions.RoleID;
            PEmployee.userid      = Convert.ToString(AppSessions.EmpolyeeID);
            PEmployee.Studentlist = "";
            PEmployee.password    = txtnp.Text;
            PEmployee.modifiedby  = AppSessions.EmpolyeeID;
            BEmployee.BAL_Employee_Password_Update(PEmployee);
        }
    }
Exemplo n.º 4
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (AppSessions.RoleID == 4)//student
            {
                DataSet   dtLogin   = new DataSet();
                DataTable LoginInfo = new DataTable();
                DataTable UserInfo  = new DataTable();

                SYS_Role        obj_SYS_Role     = new SYS_Role();
                SYS_Role_BLogic obj_BAL_SYS_Role = new SYS_Role_BLogic();
                obj_SYS_Role.Username = AppSessions.LoginID;
                // obj_SYS_Role.Password = TxtOldPassword.Text;
                if (!string.IsNullOrEmpty(TxtOldPassword.Text))
                {
                    dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Student_Login(obj_SYS_Role);
                    LoginInfo = dtLogin.Tables[0];

                    if (LoginInfo.Rows.Count > 0 && LoginInfo != null)
                    {
                        oStudent.password = TxtNewPassword.Text;
                    }
                    else
                    {
                        WebMsg.Show("Please enter valid old password.");
                    }
                }
            }
            else if (AppSessions.RoleID == 3 || AppSessions.RoleID == 2 || AppSessions.RoleID == 1) //3-teacher,2-sadmin,1-epath-admin
            {
                Employee_BLogic BEmployee = new Employee_BLogic();
                Employee        PEmployee = new Employee();
                PEmployee.roleid      = AppSessions.RoleID;
                PEmployee.userid      = Convert.ToString(AppSessions.EmpolyeeID);
                PEmployee.Studentlist = "";
                PEmployee.password    = TxtNewPassword.Text;
                PEmployee.modifiedby  = AppSessions.EmpolyeeID;
                BEmployee.BAL_Employee_Password_Update(PEmployee);
            }
            oStudent    = new Student();
            BAL_Student = new Student_BLogic();

            string IFormat = "dd-MMM-yyyy";
            oStudent.studentid = AppSessions.StudentID;
            oStudent.firstname = txtAddFirstName.Text;
            //  oStudent.middlename = txtAddMiddleName.Text;
            oStudent.lastname = txtAddLastName.Text;
            if (rlstAddGender.SelectedIndex == (int)EnumFile.AssignValue.Zero)
            {
                oStudent.gender = 'M';
            }
            else if (rlstAddGender.SelectedIndex == (int)EnumFile.AssignValue.One)
            {
                oStudent.gender = 'F';
            }
            if (!string.IsNullOrEmpty(txtAddDOB.Text))

            {
                oStudent.dateofbirth = Convert.ToDateTime(DateTime.Parse(txtAddDOB.Text).ToString(IFormat));
            }
            //else
            //{

            //    oStudent.dateofbirth = null;


            //}
            //oStudent.bloodgroup = ""; //txtAddBloodGroup.Text;
            if (!string.IsNullOrEmpty(txtAddPermanentAddress.Text))
            {
                oStudent.Address = txtAddPermanentAddress.Text;
            }
            if (!string.IsNullOrEmpty(txtAddEmail.Text))
            {
                oStudent.emailid = txtAddEmail.Text;
            }
            if (!string.IsNullOrEmpty(txtAddContactNumber.Text))
            {
                oStudent.contactno = Convert.ToInt64(txtAddContactNumber.Text);
            }
            if (!string.IsNullOrEmpty(txtAddMobileNumber.Text))
            {
                oStudent.mobileno = Convert.ToInt64(txtAddMobileNumber.Text);
            }

            bool Status = this.BAL_Student.BAL_Student_UpdateProfile(oStudent);

            if (Status)
            {
                ResetControl();
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alert('Update profile sucessfully');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alert('Update profile Failed');", true);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
        }
    }