/// <summary> /// Page_Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { try { Page.Form.DefaultButton = btnSubmit.UniqueID; Page.Form.DefaultFocus = txtOldPwd.ClientID; if (!IsPostBack) { //if (Session["CompanyID"] != null && Session["CompanyID"].ToString() != "") if (SessionControl.CompanyID != 0) { _companyID = Convert.ToInt32(Session["CompanyID"]); _userID = Convert.ToInt32(Session["UserID"]); UsersXPagesDL _usersXPagesDL = new UsersXPagesDL(_userID, _companyID, CommonDL.GetPageID(), true); if (!_usersXPagesDL.IsAddorEdit) { Response.Redirect("~/Login.aspx", false); } } else { Response.Redirect("~/Login.aspx", false); } txtpwd.Attributes.Add("onblur", "LengthValidation('" + txtpwd.ClientID + "')"); txtOldPwd.Attributes.Add("onblur", "LengthValidation('" + txtOldPwd.ClientID + "')"); } } catch (Exception ex) { ErrorLog.LogErrorMessageToDB("ChangePassword.aspx", "", "Page_Load", ex.Message.ToString(), new ACEConnection()); } }
/// <summary> /// Page_Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { int UserID = 0; //UserID = Convert.ToInt32(Session["UserID"]); UserID = SessionControl.UserID.cxToInt32(); hfUserID.Value = UserID.ToString(); LoadDateFormatDropDown(); GetUserSettings(Convert.ToInt32(hfUserID.Value), true); //_companyID = Convert.ToInt32(Session["CompanyID"]); //_userID = Convert.ToInt32(Session["UserID"]); _companyID = SessionControl.CompanyID.cxToInt32(); _userID = SessionControl.UserID.cxToInt32(); UsersXPagesDL _usersXPagesDL = new UsersXPagesDL(_userID, _companyID, CommonDL.GetPageID(), true); if (!_usersXPagesDL.IsAddorEdit) { Response.Redirect("~/Login.aspx", false); } } } catch (Exception ex) { ErrorLog.LogErrorMessageToDB("Settings.aspx", "", "Page_Load", ex.Message, new ACEConnection()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int companyID = 0; int userID = 0; //if (Session["CompanyID"] != null && Session["CompanyID"].ToString() != "") if (SessionControl.CompanyID != 0) { //companyID = Convert.ToInt32(Session["CompanyID"]); //userID = Convert.ToInt32(Session["UserID"]); companyID = SessionControl.CompanyID.cxToInt32(); userID = SessionControl.UserID.cxToInt32(); UsersXPagesDL _usersXPagesDL = new UsersXPagesDL(userID, companyID, CommonDL.GetPageID(), true); if (_usersXPagesDL.IsAddorEdit) { } else { Response.Redirect("~/Login.aspx", false); } } else { Response.Redirect("~/Login.aspx", false); } GridViewProperties.AssignGridViewProperties(gvRoleSettings); LoadDropDownList(); gvRoleSettings.AllowPaging = false; btnSave.Visible = false; btnCancel.Visible = false; } }
/// <summary> /// Page_Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { _companyID = Convert.ToInt32(Session["CompanyID"]); _userID = Convert.ToInt32(Session["UserID"]); _dateFormat = Convert.ToString(Session["DateFormat"]); GridViewProperties.AssignGridViewProperties(gvErrorLog); if (_dateFormat == null || _dateFormat == "") { Response.Redirect("~/Login.aspx", false); } if (!IsPostBack) { if (Session["CompanyID"] != null && Session["CompanyID"].ToString() != "") { UsersXPagesDL _usersXPagesDL = new UsersXPagesDL(_userID, _companyID, CommonDL.GetPageID(), true); if (!_usersXPagesDL.IsAddorEdit) { Response.Redirect("~/Login.aspx", false); } LoadErrorLogList(); } //else //{ // Response.Redirect("~/Login.aspx", false); //} } }
/// <summary> /// Page_Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { try { //Commentedd on 17/04/2014 //_companyID = Convert.ToInt32(Session["CompanyID"]); //_userID = Convert.ToInt32(Session["UserID"]); //_dateFormat = Convert.ToString(Session["DateFormat"]); _companyID = SessionControl.CompanyID.cxToInt32(); _userID = SessionControl.UserID.cxToInt32(); _dateFormat = SessionControl.DateFormat.ToString(); if (_dateFormat == null || _dateFormat == "") { Response.Redirect("~/Login.aspx", false); } ceDOB.Format = _dateFormat; ceDOJ.Format = _dateFormat; if (!IsPostBack) { //commented on 17/04/2014 //if (Session["CompanyID"] != null && Session["CompanyID"].ToString() != "") if (_companyID != 0) { UsersXPagesDL _usersXPagesDL = new UsersXPagesDL(_userID, _companyID, CommonDL.GetPageID(), true); if (!_usersXPagesDL.IsAddorEdit) { Response.Redirect("~/Login.aspx", false); } } else { Response.Redirect("~/Login.aspx", false); } // Set ViewState Variables ViewState["SortDirection"] = "ASC"; ViewState["SortExpression"] = "EmployeeCode"; // Page.Form.DefaultButton = btnSearch.UniqueID; Page.Form.DefaultFocus = txtSearchID.UniqueID; // Assign Common GridView Properties to all GridViews used in the page GridViewProperties.AssignGridViewProperties(gvEmployeeDetails); LoadDropDownList(); GetEmployeeDetails("", Convert.ToBoolean(rblReportOption.SelectedValue)); } } catch (Exception ex) { ErrorLog.LogErrorMessageToDB("ManageEmployee.aspx", "", "Page_Load", ex.Message.ToString(), new ACEConnection()); } }
/// <summary> /// btnSave_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { try { // Adding RolesXPages TransactionResult result; CheckBox chkIsAddEdit; CheckBox chkIsDelete; _users = new UsersDL(); foreach (GridViewRow outerRow in gvUserPageSettings.Rows) { GridView outerGrid = (GridView)outerRow.FindControl("gvUpdateUserPageSettings"); foreach (GridViewRow innerRow in outerGrid.Rows) { _usersXPages = new UsersXPagesDL(); _usersXPages.CompanyID = Convert.ToInt32(ddlCompany.SelectedValue.ToString()); _usersXPages.UserID = Convert.ToInt32(ddlEmployee.SelectedValue.ToString()); _usersXPages.PageID = Convert.ToInt32(innerRow.Cells[1].Text.ToString()); chkIsAddEdit = (CheckBox)(innerRow.Cells[6].FindControl("cbCheckBoxAdd")); _usersXPages.IsAddorEdit = chkIsAddEdit.Checked; chkIsDelete = (CheckBox)(innerRow.Cells[7].FindControl("cbCheckBoxDelete")); _usersXPages.IsDelete = chkIsDelete.Checked; _usersXPages.ScreenMode = ScreenMode.Add; _users.UserPages.Add(_usersXPages); // Add / Edit the UsersXPages } } //If successful, get the RolesXPages details _users.ScreenMode = ScreenMode.Edit; result = _users.Commit(); // Display the Status - Whether successfully saved or not System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("<script>alert('" + result.Message.ToString() + ".');"); sb.Append("</script>"); ScriptManager.RegisterStartupScript(this.Page, typeof(string), "MyScript", sb.ToString(), false); ddlEmployee_SelectedIndexChanged(sender, e); } catch (Exception ex) { ErrorLog.LogErrorMessageToDB("UserPageSettings.aspx", "", "btnSave_Click", ex.Message.ToString(), new ACEConnection()); } }
/// <summary> /// Page_Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { try { //_companyID = Convert.ToInt32(Session["CompanyID"]); //_userID = Convert.ToInt32(Session["UserID"]); _companyID = SessionControl.CompanyID.cxToInt32(); _userID = SessionControl.UserID.cxToInt32(); ViewState["PageID"] = CommonDL.GetPageID(); if (!IsPostBack) { //if (Session["CompanyID"] != null && Session["CompanyID"].ToString() != "") if (SessionControl.CompanyID != 0) { UsersXPagesDL _usersXPagesDL = new UsersXPagesDL(_userID, _companyID, CommonDL.GetPageID(), true); if (!_usersXPagesDL.IsAddorEdit) { //Response.Redirect("~/Login.aspx", false); gvUserDetails.Columns[10].Visible = false; } } else { Response.Redirect("~/Login.aspx", false); } // Set ViewState Variables ViewState["SortDirection"] = "ASC"; ViewState["SortExpression"] = "UserName"; // Assign Common GridView Properties to all GridViews used in the page GridViewProperties.AssignGridViewProperties(gvUserDetails); GridViewProperties.AssignGridViewProperties(gvUserCompanies); // Get the UserID QueryString Value [if QueryString exists] if (Request.QueryString["UserID"] != null && Request.QueryString["UserID"] != "null") { // Get the details of the User with the UserID QueryString Value GetUserDetails(Convert.ToInt32(Request.QueryString["UserID"].ToString()), true); trUserDetailView.Visible = true; trUserDetailTabs.Visible = true; trUpdateCancelButtonRow.Visible = true; trSearchAndAddRow.Visible = false; trGridRow.Visible = false; tblUser.Visible = false; } else { // Get the list of users GetUserDetails(Convert.ToString(txtSearchID.Text.ToString()), Convert.ToBoolean(rblReportOption.SelectedValue)); // Show only the list of users and hide an individual user detail view trUserDetailView.Visible = false; trUserDetailTabs.Visible = false; trUpdateCancelButtonRow.Visible = false; trSearchAndAddRow.Visible = true; trGridRow.Visible = true; tblUser.Visible = true; } } } catch (Exception ex) { ErrorLog.LogErrorMessageToDB("ViewUser.aspx", "", "Page_Load", ex.Message.ToString(), new ACEConnection()); } }