Exemple #1
0
    private void LoadUserRights()
    {
        DataSet dsSession = new DataSet();

        dsSession = objHotLeadBL.GetUserSession((Session[Constants.USER_ID].ToString()));

        if (dsSession.Tables[0].Rows[0]["SessionID"].ToString() != HttpContext.Current.Session.SessionID.ToString())
        {
            Session["SessionTimeOut"] = 1;
            Response.Redirect("Login.aspx");
        }
    }
    private void LoadUserRights()
    {
        DataSet dsSession = new DataSet();

        dsSession = objHotLeadBL.GetUserSession((Session[Constants.USER_ID].ToString()));

        if (dsSession.Tables[0].Rows[0]["SessionID"].ToString() != HttpContext.Current.Session.SessionID.ToString())
        {
            // objUserlog.Perform_LogOut(Convert.ToInt32(Session[Constants.USER_ID]), System.DateTime.Now, Convert.ToInt32(Session[Constants.USERLOG_ID]), 8);

            Session["SessionTimeOut"] = 1;
            Response.Redirect("Login.aspx");
        }
    }
Exemple #3
0
    private void LoadUserRights()
    {
        DataSet dsSession = new DataSet();

        dsSession = objHotLeadBL.GetUserSession(Session[Constants.USER_ID].ToString());

        if (dsSession.Tables[0].Rows[0]["SessionID"].ToString() != HttpContext.Current.Session.SessionID.ToString())
        {
            // objUserlog.Perform_LogOut(Convert.ToInt32(Session[Constants.USER_ID]), System.DateTime.Now, Convert.ToInt32(Session[Constants.USERLOG_ID]), 8);

            Session["SessionTimeOut"] = 1;
            Response.Redirect("Login.aspx");
        }

        DataSet dsModules = new DataSet();

        dsModules = objHotLeadBL.GetUsersModuleRites(Convert.ToInt32(Session[Constants.USER_ID]));

        Session[Constants.USER_Rights] = dsModules;
        if (dsModules.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < dsModules.Tables[0].Rows.Count; i++)
            {
                //lnkHome,userAdmin,lbtnManager,lnkReports

                //

                if (dsModules.Tables[0].Rows[i]["ModuleName"].ToString() == "New sale")
                {
                    if (dsModules.Tables[0].Rows[i]["ModuleActive"].ToString() == "1")
                    {
                        //lnkbtnNewSale.Enabled = true;
                        //lnkbtnDealerSale.Enabled = true;
                    }
                }
                if (dsModules.Tables[0].Rows[i]["ModuleName"].ToString() == "User management")
                {
                    if (dsModules.Tables[0].Rows[i]["ModuleActive"].ToString() == "1")
                    {
                        //lnkbtnAdmin.Enabled = true;
                    }
                }
                if (dsModules.Tables[0].Rows[i]["ModuleName"].ToString() == "Agent report")
                {
                    if (dsModules.Tables[0].Rows[i]["ModuleActive"].ToString() == "1")
                    {
                        //lnkbtnAgentReport.Enabled = true;
                        //lnkbtnMyDealerRep.Enabled = true;
                    }
                }
                if (dsModules.Tables[0].Rows[i]["ModuleName"].ToString() == "Center report")
                {
                    if (dsModules.Tables[0].Rows[i]["ModuleActive"].ToString() == "1")
                    {
                        //lnkbtnCentralReport.Enabled = true;
                    }
                }
                if (dsModules.Tables[0].Rows[i]["ModuleName"].ToString() == "Transfers")
                {
                    if (dsModules.Tables[0].Rows[i]["ModuleActive"].ToString() == "1")
                    {
                        ////lnkbtnTransfers.Enabled = true;
                        //lnkbtnNewSale.Visible = false;
                        //lnkbtnAdmin.Visible = false;
                        //lnkbtnIntromail.Visible = false;
                        //lnkbtnCentralReport.Visible = false;
                    }
                }
            }
        }
    }