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"); }
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); } }
[WebMethod()] public static string CheckUserID(string UserID) { Employee_BLogic BAL_Employee = new Employee_BLogic(); bool IsExists = BAL_Employee.BAL_Employee_CheckLogin(UserID); if (IsExists) { return("True"); } else { return("False"); } }
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); } }
protected ArrayList GenerateEmailAddress(Int64 EmployeeID) { ArrayList AlistEmailID = new ArrayList(); DataSet dsEmail = new DataSet(); EmployeeBlogic = new Employee_BLogic(); try { dsEmail = EmployeeBlogic.SelectEmployeeDetailByEmployeeID(EmployeeID); if (dsEmail != null & dsEmail.Tables.Count > 0) { if (dsEmail.Tables[0].Rows.Count > 0) { AlistEmailID.Add(dsEmail.Tables[0].Rows[0]["EmailID"].ToString()); ViewState["TempEmp"] = dsEmail.Tables[0].Rows[0]["FirstName"].ToString(); } } } catch (Exception ex) { WebMsg.Show(ex.Message); } return(AlistEmailID); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Page.Title = "Manage User"; string IFormat = "dd-MMM-yyyy"; SYS_Role_BLogic obj_BAL_SYS_Role = new SYS_Role_BLogic(); DataSet dsSelect = new DataSet(); dsSelect = obj_BAL_SYS_Role.BAL_SYS_Role_SelectAll(); if (Session["RoleID"].ToString() == Convert.ToString((int)EnumFile.Role.E_Admin)) { //EAdmin foreach (DataRow dr in dsSelect.Tables[0].Rows) { if ((Convert.ToString(dr["RoleID"]) == "2") || Convert.ToString(dr["RoleID"]) == "3") { ListItem oList = new ListItem(Convert.ToString(dr["Role"]), Convert.ToString(dr["RoleID"])); ddlRole.Items.Add(oList); } } } else if (Session["RoleID"].ToString() == Convert.ToString((int)EnumFile.Role.S_Admin)) { //SAdmin foreach (DataRow dr in dsSelect.Tables[0].Rows) { if (Convert.ToString(dr["RoleID"]) == "3") { ListItem oList = new ListItem(Convert.ToString(dr["Role"]), Convert.ToString(dr["RoleID"])); ddlRole.Items.Add(oList); } } } //ddlRole.DataSource = dsSelect.Tables[0]; //ddlRole.DataTextField = "Role"; //ddlRole.DataValueField = "RoleID"; //ddlRole.DataBind(); ddlRole.Items.Insert(((int)EnumFile.AssignValue.Zero), new ListItem("-- Select --", "0")); if (Request.QueryString["Employeeid"] != "0" & Request.QueryString["Employeeid"] != null) { this.ViewState["Employeeid"] = Request.QueryString["Employeeid"]; ArrayList AlistEmailID = new ArrayList(); DataSet dsEmail = new DataSet(); BAL_Employee = new Employee_BLogic(); try { dsEmail = BAL_Employee.SelectEmployeeDetailByEmployeeID(Convert.ToInt64(this.ViewState["Employeeid"])); if (dsEmail != null & dsEmail.Tables.Count > 0) { if (dsEmail.Tables[0].Rows.Count > 0) { //EmployeeID, Code, RoleID, SchoolID, FirstName, MiddleName, LastName, Gender, DateOfBirth, BloodGroup, Address, EmailID, ContactNo, Qualification, // Designation, SecurityQuestion, SecurityAnswer, LoginID, Password, Image, LastLoginDate, AttemptCount, IsActive, CreatedOn, CreatedBy, ModifiedOn, // ModifiedBy, AllowMultipleSession ddlRole.SelectedValue = Convert.ToString(dsEmail.Tables[0].Rows[0]["RoleID"]); txtAddFirstName.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["FirstName"]); txtAddMiddleName.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["MiddleName"]); txtAddLastName.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["LastName"]); rlstAddGender.SelectedValue = Convert.ToString(dsEmail.Tables[0].Rows[0]["Gender"]); DateTime dt; if (DateTime.TryParse(Convert.ToString(dsEmail.Tables[0].Rows[0]["DateOfBirth"]), out dt)) { txtAddDOB.Text = dt.ToString(IFormat); } txtAddBloodGroup.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["BloodGroup"]); txtAddPermanentAddress.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["Address"]); txtAddEmail.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["EmailID"]); txtAddContactNumber.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["ContactNo"]); txtAddQualification.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["Qualification"]); txtAddDesignation.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["Designation"]); tLoginId.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["LoginID"]); hdnLoginid.Value = Convert.ToString(dsEmail.Tables[0].Rows[0]["LoginID"]); lblAddTitle.Text = "Update User: " + txtAddFirstName.Text; } } } catch (Exception ex) { WebMsg.Show(ex.Message); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Page.Title = "Update Pofile"; string IFormat = "dd-MMM-yyyy"; if (Session["RoleID"].ToString() == Convert.ToString((int)EnumFile.Role.E_Admin)) { lblRole.Text = "E-Admin"; } else if (Session["RoleID"].ToString() == Convert.ToString((int)EnumFile.Role.S_Admin)) { lblRole.Text = "S-Admin"; } else if (Session["RoleID"].ToString() == Convert.ToString((int)EnumFile.Role.Teacher)) { lblRole.Text = "Teacher"; } if (Request.QueryString["Employeeid"] != "0" & Request.QueryString["Employeeid"] != null) { this.ViewState["Employeeid"] = AppSessions.EmpolyeeID; ArrayList AlistEmailID = new ArrayList(); DataSet dsEmail = new DataSet(); BAL_Employee = new Employee_BLogic(); try { dsEmail = BAL_Employee.SelectEmployeeDetailByEmployeeID(Convert.ToInt64(this.ViewState["Employeeid"])); if (dsEmail != null & dsEmail.Tables.Count > 0) { if (dsEmail.Tables[0].Rows.Count > 0) { //EmployeeID, Code, RoleID, SchoolID, FirstName, MiddleName, LastName, Gender, DateOfBirth, BloodGroup, Address, EmailID, ContactNo, Qualification, // Designation, SecurityQuestion, SecurityAnswer, LoginID, Password, Image, LastLoginDate, AttemptCount, IsActive, CreatedOn, CreatedBy, ModifiedOn, // ModifiedBy, AllowMultipleSession txtAddFirstName.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["FirstName"]); txtAddMiddleName.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["MiddleName"]); txtAddLastName.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["LastName"]); rlstAddGender.SelectedValue = Convert.ToString(dsEmail.Tables[0].Rows[0]["Gender"]); DateTime dt; if (DateTime.TryParse(Convert.ToString(dsEmail.Tables[0].Rows[0]["DateOfBirth"]), out dt)) { txtAddDOB.Text = dt.ToString(IFormat); } txtAddBloodGroup.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["BloodGroup"]); txtAddPermanentAddress.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["Address"]); txtAddEmail.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["EmailID"]); txtAddContactNumber.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["ContactNo"]); txtAddQualification.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["Qualification"]); txtAddDesignation.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["Designation"]); tLoginId.Text = Convert.ToString(dsEmail.Tables[0].Rows[0]["LoginID"]); hdnLoginid.Value = Convert.ToString(dsEmail.Tables[0].Rows[0]["LoginID"]); lblAddTitle.Text = "Update Profile: " + txtAddFirstName.Text; } } } catch (Exception ex) { WebMsg.Show(ex.Message); } } } }
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 { } }