Exemple #1
0
        /// <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());
            }
        }
        /// <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());
            }
        }
Exemple #3
0
        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)
        {
            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());
            }
        }
 /// <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);
         //}
     }
 }
Exemple #6
0
        /// <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());
            }
        }