示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_ConfigHelper      = new ConfigHelper();
        m_WebLogService     = new WebLogService();
        m_PostFactory       = new PostFactory();
        m_MemberFactory     = new MemberFactory();
        m_AuthFactory       = new AuthFactory();
        m_HttpHelper        = new HttpHelper();
        m_SessionHelper     = new SessionHelper();
        m_AccountingFactory = new AccountingFactory();
        m_AuthService       = m_AuthFactory.GetAuthService();
        m_MemberService     = m_MemberFactory.GetMemberService();
        m_PostService       = m_PostFactory.GetPostService();
        m_AccountingService = m_AccountingFactory.GetAccountingService();

        if (!IsPostBack)
        {
            InitDDL();
            ShowMode();

            fillGridView();

            new Thread(new ThreadStart(ApiUtil.UpdateMemberToServer)).Start();
            new Thread(new ThreadStart(() => ApiUtil.UpdateFileToServer(Server.MapPath("../../App_Data/upload/")))).Start();
            new Thread(new ThreadStart(() => ApiUtil.UpdatePostToServer(2))).Start();
            //LoadTotalCommission();
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     m_AuthFactory   = new AuthFactory();
     m_AuthService   = m_AuthFactory.GetAuthService();
     m_MemberFactory = new MemberFactory();
     m_MemberService = m_MemberFactory.GetMemberService();
 }
示例#3
0
    public void FillLog(object sender, EventArgs e)
    {
        HttpApplication application = (HttpApplication)sender;

        string rawUrl = application.Request.RawUrl;

        rawUrl = rawUrl.ToLower();

        //只欄aspx
        if (rawUrl.IndexOf(".aspx") == -1)
        {
            return;
        }

        if (rawUrl.IndexOf("schema.aspx") != -1)
        {
            return;
        }


        //將function Name存入log

        if (!string.IsNullOrEmpty(rawUrl))
        {
            string path = rawUrl;

            string phypath = application.Request.ApplicationPath.ToLower();

            if (!string.IsNullOrEmpty(phypath) && !phypath.Equals("/"))
            {
                path = path.Replace(phypath, "");
            }

            if (path.StartsWith("/"))
            {
                path = path.Substring(1);
            }


            AuthFactory  authFactory = new AuthFactory();
            IAuthService authService = authFactory.GetAuthService();

            IList <MenuFuncVO> menuFuncList = authService.GetMenuFuncList("as vo where vo.MainPath='" + path + "'", 0, 1);

            //checkMainPath
            if (menuFuncList != null && menuFuncList.Count > 0)
            {
                FillLog(menuFuncList[0]);
            }

            ////check functionPath
            //IList<FunctionPathVO> fpaths = authService.DaoGetByWhere<FunctionPath>("as vo where vo.Path='" + path + "'", 0, 1);
            //if (fpaths != null && fpaths.Count > 0)
            //{
            //    FillLog(fpaths[0].BelongMenuFunc);
            //}
        }
    }
        private static void initAllMenu()
        {
            AuthFactory  authFactory = new AuthFactory();
            IAuthService authService = authFactory.GetAuthService();

            IList <MenuFuncVO> iList = authService.GetTopMenuFuncNoLazy();

            m_UserMenuFunc.AllMenu = iList;
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        m_AuthFactory = new AuthFactory();
        m_AuthService = m_AuthFactory.GetAuthService();

        if (!Page.IsPostBack)
        {
            // setPrgName();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        m_WebLogService = new WebLogService();
        m_AuthFactory   = new AuthFactory();
        m_AuthService   = m_AuthFactory.GetAuthService();

        if (!Page.IsPostBack)
        {
            initData();
        }
    }
示例#7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_WebLogService = new WebLogService();
        m_AuthFactory   = new AuthFactory();
        m_AuthService   = m_AuthFactory.GetAuthService();

        //載入清單
        LoadDataToUI();

        //新增模式
        ToInsertMode();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        m_SystemFactory = new SystemFactory();
        m_AuthFactory   = new AuthFactory();
        m_LogService    = m_SystemFactory.GetLogService();
        m_AuthSevice    = m_AuthFactory.GetAuthService();

        if (!Page.IsPostBack)
        {
            InitData();
            fillGridView();
        }
    }
        private static void initAllRole()
        {
            AuthFactory  authFactory = new AuthFactory();
            IAuthService authService = authFactory.GetAuthService();

            IList <LoginRoleVO> roleList = authService.GetAllLoginRoleListNoLazy();

            m_UserMenuFunc.RoleDic = new Dictionary <int, LoginRoleVO>();

            foreach (LoginRoleVO role in roleList)
            {
                m_UserMenuFunc.RoleDic.Add(role.RoleId, role);
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        m_WebLogService = new WebLogService();
        m_AuthFactory   = new AuthFactory();
        m_AuthService   = m_AuthFactory.GetAuthService();


        string userId = Request.QueryString["UserId"];

        if (!Page.IsPostBack)
        {
            initData(userId);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        m_AuthFactory = new AuthFactory();
        m_AuthService = m_AuthFactory.GetAuthService();

        if (!Page.IsPostBack)
        {
            initMenu();

            new TreeViewState().RestoreTreeView(tvMenu, this.GetType().ToString());

            //初始選單下方左邊資料
            initLeftData();
        }
    }
示例#12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_AuthFactory   = new AuthFactory();
        m_AuthService   = m_AuthFactory.GetAuthService();
        m_MemberFactory = new MemberFactory();
        m_MemberService = m_MemberFactory.GetMemberService();
        m_PostFactory   = new PostFactory();
        m_PostService   = m_PostFactory.GetPostService();

        if (!IsPostBack)
        {
            IList <NodeVO> storeList = m_PostService.GetNodeListByParentName("店家");
            ltlTitle.Text  = string.Format("<title> 品讚行動通訊聯合系統-{0}</title>", storeList[0].Name);
            ltlTitle2.Text = string.Format("<品讚行動通訊聯合系統-{0}", storeList[0].Name);
        }
    }
        /// <summary>
        /// 載入user的資料
        /// </summary>
        /// <param name="userId"></param>
        private void loadUser(string userId)
        {
            m_UserDic = m_UserMenuFunc.m_UserDic;

            AuthFactory  authFactory = new AuthFactory();
            IAuthService authService = authFactory.GetAuthService();

            LoginUserVO user = authService.GetLoginUserByIdNoLazy(userId);

            m_Log.Debug("lock UserMenuFuncContainer loadUser");
            lock (typeof(UserMenuFuncContainer))
            {
                m_UserDic.Remove(userId);
                m_UserDic.Add(userId, user);
            }
        }
示例#14
0
    private void FillLog(MenuFuncVO m)
    {
        AuthFactory  authFactory = new AuthFactory();
        IAuthService authService = authFactory.GetAuthService();

        MenuFuncVO parentMenu      = authService.GetMenuFuncById(m.ParentMenu.MenuFuncId);
        string     functionName    = parentMenu.MenuFuncName;
        string     subfunctionName = m.MenuFuncName;

        m_Log.Debug("functionName:" + functionName + " >> " + m.MenuFuncName);
        SessionHelper sessionHelper = new SessionHelper();
        LogSystemVO   logSystemVO   = new LogSystemVO();

        logSystemVO.Fucntion    = functionName;
        logSystemVO.SubFucntion = subfunctionName;
        sessionHelper.LogVO     = logSystemVO;
    }
示例#15
0
 public void TestCaseInit()
 {
     m_AuthFactory        = new AuthFactory();
     m_PostFactory        = new PostFactory();
     m_SystemFactory      = new SystemFactory();
     m_StorageFactory     = new StorageFactory();
     m_MemberFactory      = new MemberFactory();
     m_AccountingFactory  = new AccountingFactory();
     m_AuthService        = m_AuthFactory.GetAuthService();
     m_PostService        = m_PostFactory.GetPostService();
     m_TemplateService    = m_SystemFactory.GetTemplateService();
     m_SystemService      = m_SystemFactory.GetSystemService();
     m_MessageService     = m_PostFactory.GetMessageService();
     m_StorageFileService = m_StorageFactory.GetStorageFileService();
     m_MemberService      = m_MemberFactory.GetMemberService();
     m_AccountingService  = m_AccountingFactory.GetAccountingService();
 }
示例#16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_ConfigHelper  = new ConfigHelper();
        m_WebLogService = new WebLogService();
        m_PostFactory   = new PostFactory();
        m_AuthFactory   = new AuthFactory();
        m_SessionHelper = new SessionHelper();
        m_AuthService   = m_AuthFactory.GetAuthService();
        m_PostService   = m_PostFactory.GetPostService();

        if (!IsPostBack)
        {
            InitDDL();
            pnlContent.Visible = false;
            fillGridView();
            ShowMode();
        }
    }
示例#17
0
    /// <summary>
    /// 檢查權限
    /// </summary>
    /// <param name="application"></param>
    /// <param name="uri"></param>
    /// <param name="rawUrl"></param>
    private void CheckAuth(HttpApplication application, Uri uri, string rawUrl)
    {
        SessionHelper sHelper = new SessionHelper();

        LoginUserVO loginUser = sHelper.LoginUser;

        string applicationPath = application.Request.ApplicationPath;

        string mamagePath = String.IsNullOrEmpty(applicationPath) ? "/admin" : applicationPath + "/admin";

        mamagePath = mamagePath.Replace("//", "/");

        if (rawUrl.StartsWith(mamagePath) == true)
        {
            AuthFactory  authFactory = new AuthFactory();
            IAuthService authService = authFactory.GetAuthService();

            if (loginUser == null)
            {
                toLoginPage(application.Response);
                return;
            }

            string userId = loginUser.UserId;

            //判斷只有主路徑是否有權限
            //if (!PathHasRight(UserMenuFuncContainer.GetInstance().GetUser(userId), uri, UserMenuFuncContainer.GetInstance().PathFunc))
            //{
            //    toLoginNoAuthPage(application.Response);
            //}


            //判斷所有路徑是否有權限
            if (!authService.PathHasAuth(UserMenuFuncContainer.GetInstance().GetUser(userId), uri))
            {
                toLoginNoAuthPage(application.Response);
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        m_WebLogService     = new WebLogService();
        m_PostFactory       = new PostFactory();
        m_MemberFactory     = new MemberFactory();
        m_AuthFactory       = new AuthFactory();
        m_HttpHelper        = new HttpHelper();
        m_SessionHelper     = new SessionHelper();
        m_AccountingFactory = new AccountingFactory();
        m_AuthService       = m_AuthFactory.GetAuthService();
        m_MemberService     = m_MemberFactory.GetMemberService();
        m_PostService       = m_PostFactory.GetPostService();
        m_AccountingService = m_AccountingFactory.GetAccountingService();

        if (!IsPostBack)
        {
            ////先更新到今天之前的結帳
            m_AccountingService.UpdateCash();
            txtDate.Text = ConvertUtil.UtcDateTimeToTaiwanDateTime(DateTime.UtcNow).ToString("yyyy/MM/dd");

            ShowMode();
            LoadDataToUI();
        }
    }
        private static void initAllRole()
        {
            AuthFactory authFactory = new AuthFactory();
            IAuthService authService = authFactory.GetAuthService();

            IList<LoginRoleVO> roleList = authService.GetAllLoginRoleListNoLazy();
            m_UserMenuFunc.RoleDic = new Dictionary<int, LoginRoleVO>();

            foreach (LoginRoleVO role in roleList)
            {
                m_UserMenuFunc.RoleDic.Add(role.RoleId, role);
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     m_WebLogService = new WebLogService();
     m_AuthFactory   = new AuthFactory();
     m_AuthService   = m_AuthFactory.GetAuthService();
 }
        /// <summary>
        /// 載入user的資料
        /// </summary>
        /// <param name="userId"></param>
        private void loadUser(string userId)
        {
            m_UserDic = m_UserMenuFunc.m_UserDic;

            AuthFactory authFactory = new AuthFactory();
            IAuthService authService = authFactory.GetAuthService();

            LoginUserVO user = authService.GetLoginUserByIdNoLazy(userId);

            m_Log.Debug("lock UserMenuFuncContainer loadUser");
            lock (typeof(UserMenuFuncContainer))
            {
                m_UserDic.Remove(userId);
                m_UserDic.Add(userId, user);
            }
        }
 public TreeveiwService()
 {
     m_AuthFactory = new AuthFactory();
     m_AuthService = m_AuthFactory.GetAuthService();
 }
        private static void initAllMenu()
        {
            AuthFactory authFactory = new AuthFactory();
            IAuthService authService = authFactory.GetAuthService();

            IList<MenuFuncVO> iList = authService.GetTopMenuFuncNoLazy();

            m_UserMenuFunc.AllMenu = iList;
        }