protected void Page_Error(object sender, EventArgs e)
    {
        ErrorLogProvider provider = null;

        try
        {
            // Current exception.
            Exception exception = HttpContext.Current.Error;

            // Insert error log.
            provider            = new ErrorLogProvider();
            provider.AppManager = this.mAppManager;
            provider.Insert(exception);
        }
        catch
        {
            throw;
        }
        finally
        {
            if (provider != null)
            {
                provider.Dispose();
            }
        }
    }
 protected virtual void LogError(ExceptionContext filterContext)
 {
     // Log the error if an error log provider is specified
     if (ErrorLogProvider != null && filterContext.Exception != null)
     {
         ErrorLogProvider.LogError(filterContext.Exception);
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        mappmanager = Session["APP_MANAGER"] as IAppManager;
        if (mappmanager.LoginUser.HasAdminRights == false)
        {
            ErrorLogProvider provider = null;
            try
            {
                //create a exception.
                Exception exception = HttpContext.Current.Error;

                //insert into Error log.
                provider            = new ErrorLogProvider();
                provider.AppManager = this.mappmanager;
                provider.Insert1(exception);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (provider != null)
                {
                    provider.Dispose();
                }
            }
            //   this.DisplayMessage("YOU DO NOT HAVE ACCESS TO THIS PAGE");
            Response.Redirect("~/Homepage.aspx");
        }

        UserAuthentication muserauthentication = new UserAuthentication();

        this.mappmanager = muserauthentication.AppManager;
        LoadLabels();

        if (!Page.IsPostBack)
        {
            if (Convert.ToString(Session["UserPermissionAddOrUpdate"]) != null)
            {
                if (Convert.ToString(Session["UserPermissionAddOrUpdate"]).Equals("TRUE"))
                {
                    Session["UserPermissionAddOrUpdate"] = null;
                    this.DisplayList(this.SearchUsersPermissions());
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            // Get from master.
            this.mAppManager = this.Master.AppManager;

            if (mAppManager.LoginUser.HasAdminRights == false)
            {
                ErrorLogProvider provider = null;
                try
                {
                    //create a exception.
                    Exception exception = HttpContext.Current.Error;

                    //insert into Error log.
                    provider            = new ErrorLogProvider();
                    provider.AppManager = this.mAppManager;
                    provider.Insert1(exception);
                }
                catch
                {
                    throw;
                }
                finally
                {
                    if (provider != null)
                    {
                        provider.Dispose();
                    }
                }
                //   this.DisplayMessage("YOU DO NOT HAVE ACCESS TO THIS PAGE");
                Response.Redirect("~/Homepage.aspx");
            }

            LoadLabels();

            // Fetch from session.
            if (Session[ACTIVITY_SUMMARY] != null)
            {
                this.mActivitySummary = Session[ACTIVITY_SUMMARY] as List <CustomEntity>;
            }
        }
        catch { throw; }
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        mappmanager = Session["APP_MANAGER"] as IAppManager;
        if (mappmanager.LoginUser.HasAdminRights == false)
        {
            ErrorLogProvider provider = null;
            try
            {
                //create a exception.
                Exception exception = HttpContext.Current.Error;

                //insert into Error log.
                provider            = new ErrorLogProvider();
                provider.AppManager = this.mappmanager;
                provider.Insert1(exception);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (provider != null)
                {
                    provider.Dispose();
                }
            }
            //   this.DisplayMessage("YOU DO NOT HAVE ACCESS TO THIS PAGE");
            Response.Redirect("~/Homepage.aspx");
        }

        UserAuthentication muserauthentication = new UserAuthentication();

        this.mappmanager = muserauthentication.AppManager;
        LoadLabels();

        if (!Page.IsPostBack)
        {
            //Display the Inital view.
            this.InitalView();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            //divMessage.Visible = false;

            mAppManager = Session["APP_MANAGER"] as IAppManager;
            if (mAppManager.LoginUser.HasAdminRights == false)
            {
                ErrorLogProvider provider = null;
                try
                {
                    //create a exception.
                    Exception exception = HttpContext.Current.Error;

                    //insert into Error log.
                    provider            = new ErrorLogProvider();
                    provider.AppManager = this.mAppManager;
                    provider.Insert1(exception);
                }
                catch
                {
                    throw;
                }
                finally
                {
                    if (provider != null)
                    {
                        provider.Dispose();
                    }
                }
                //   this.DisplayMessage("YOU DO NOT HAVE ACCESS TO THIS PAGE");
                Response.Redirect("~/Homepage.aspx");
            }

            this.InitializeUserSearchViewDialogScript();

            // TODO: Need to remove.
            UserAuthentication authentication = new UserAuthentication();
            this.mAppManager = authentication.AppManager;

            // Retrieve values from session.
            this.RetrieveValuesFromSession();

            if (!Page.IsPostBack)
            {
                ShowHideEditControls(false);
                txtSearchName.Focus();
                this.lnkrefresh.Enabled = false;
            }


            this.ShowOrHideSuccessmessage(false);

            LoadLabels();

            if (hdnClientId.Value != "0")
            {
                btnUpdate.Text = BTNMODIFY;
            }
            else
            {
                btnUpdate.Text = BTNADD;
            }
        }
        catch { throw; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            mAppManager = Session["APP_MANAGER"] as IAppManager;
            LoadLabels();
            if (mAppManager.LoginUser.HasAdminRights == false)
            {
                ErrorLogProvider provider = null;
                try
                {
                    //create a exception.
                    Exception exception = HttpContext.Current.Error;

                    //insert into Error log.
                    provider            = new ErrorLogProvider();
                    provider.AppManager = this.mAppManager;
                    provider.Insert1(exception);
                }
                catch
                {
                    throw;
                }
                finally
                {
                    if (provider != null)
                    {
                        provider.Dispose();
                    }
                }
                //   this.DisplayMessage("YOU DO NOT HAVE ACCESS TO THIS PAGE");
                Response.Redirect("~/Homepage.aspx");
            }

            this.InitializeUserSearchViewDialogScript();
            muserauthentication            = new UserAuthentication();
            this.mAppManager               = muserauthentication.AppManager;
            this.UserSearchView.AppManager = this.mAppManager;
            if (!IsPostBack)
            {
                //_treeNode = new TreeNode("Organization", "0");

                //TreHierarchy.Nodes.Add(_treeNode);

                //RetrieveAttachedUsers("0");
                this.alertError.Style["display"] = "none";
                this.alertError.InnerHtml        = "";
                Hidhierarchy.Value = "";
                pnlmanager.Visible = false;
                RetrieveAttachedUsers();
                //ShowAttachedUser("0");
                AttachedUsers.Visible   = true;
                UnAttachedUsers.Visible = false;
                // Display current date as default date.
                this.txtmanagerdate.Text = this.RetrieveSystemCurrentDateTime().ToString("MM/dd/yyyy");
            }
            this.alertError.Style["display"] = "none";
            this.alertError.InnerHtml        = "";
        }
        catch { throw; }
        finally
        {
        }
    }
Esempio n. 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            this.InitializeUserSearchViewDialogScript();
            //create a instance.


            this.mappmanager = Master.AppManager;
            this.UserSearchView.AppManager = this.mappmanager;

            LoadLabels();

            if (hdnuserid.Value != "0")
            {
                btnUpdate.Text = BTNMODIFY;
            }
            else
            {
                btnUpdate.Text = BTNADD;
            }

            string aa;
            aa = this.mappmanager.LoginUser.HasAdminRights.ToString();

            if (aa == "False")
            {
                ErrorLogProvider provider = null;
                try
                {
                    //create a exception.
                    Exception exception = HttpContext.Current.Error;

                    //insert into Error log.
                    provider            = new ErrorLogProvider();
                    provider.AppManager = this.mappmanager;
                    provider.Insert1(exception);
                }
                catch
                {
                    throw;
                }
                finally
                {
                    if (provider != null)
                    {
                        provider.Dispose();
                    }
                }
//                this.DisplayMessage("YOU DO NOT HAVE ACCESS TO THIS PAGE");
                Response.Redirect("~/Homepage.aspx");
            }

            if (!Page.IsPostBack)
            {
                //focus the control.
                txtlastname.Focus();

                this.FillUserType();

                this.FillUserProfile();

                //this.FillUserShift();
                if (((object)this.Page.RouteData.Values["Id"]) != null)
                //if (Request.QueryString["id"] != null)
                {
                    //this.Reterive(Int32.Parse(Request.QueryString["id"].ToString()));
                    this.Reterive(Int32.Parse(this.Page.RouteData.Values["Id"].ToString()));

                    //Default value.
                    this.btnUpdate.Text    = BTNMODIFY;
                    this.heading.InnerText = PAGEHEADINGEDIT;

                    //Show the Controls.
                    this.MaKeControlVisible();
                    this.txtDateOfRelieving.Visible = true;
                    this.lblDateOfRelieving.Visible = true;
                    this.ImgDateOfRelieving.Visible = true;
                    this.divOtherinfo.Visible       = true;
                }
                else
                {
                    //Default value while add new User.
                    this.heading.InnerText          = PAGEHEADINGADD;
                    this.txtDateOfRelieving.Visible = false;
                    this.lblDateOfRelieving.Visible = false;
                    this.ImgDateOfRelieving.Visible = false;
                    this.chkIsactive.Checked        = true;
                    this.divOtherinfo.Visible       = false;
                    //this.txtuser.Value = "press F2 to search users";
                    this.txtuser.Value = "";
                }
            }
        }
        catch { throw; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            this.mappmanager = Master.AppManager;



            string aa;
            aa = this.mappmanager.LoginUser.HasAdminRights.ToString();

            if (aa == "False")
            {
                ErrorLogProvider provider = null;
                try
                {
                    //create a exception.
                    Exception exception = HttpContext.Current.Error;

                    //insert into Error log.
                    provider            = new ErrorLogProvider();
                    provider.AppManager = this.mappmanager;
                    provider.Insert1(exception);
                }
                catch
                {
                    throw;
                }
                finally
                {
                    if (provider != null)
                    {
                        provider.Dispose();
                    }
                }
                this.DisplayMessage("YOU DO NOT HAVE ACCESS TO THIS PAGE");
                Response.Redirect("~/Homepage.aspx");
            }

            if (Session["Userid"] != null)
            {
                this.BindLocation();
                if (Session["Userid"].ToString() != "0")
                {
                    this.DisplayList(this.SearchUsers());
                    this.DisplayMessage("Record Inserted Sucessfully");
                }
                else
                {
                    //Bind the grid.

                    this.DisplayList(this.SearchUsers());
                    this.DisplayMessage("Record Updated successfully");
                    this.InitalBind.Visible = false;
                }
                //clear the session.
                Session["Userid"] = null;
            }

            else
            {
                if (!Page.IsPostBack)
                {
                    this.BindLocation();
                }
                //Display the Inital view.
                this.InitalView();
                this.DisplayMessage(string.Empty);
            }


            txtName.Focus();

            LoadLabels();
        }
        catch { throw; }
    }