Example #1
0
    protected override bool InitCache()
    {
        try
        {
            string con = ConfigContext.GetInstance().DataBaseSettingProvider.SimpleManagerConnstring;
            string sGetSql = "select [PageID],[PageTitle],[PageUrl],[DisplayLeft],[PageDesc],[FatherPid],[LastModifyTime],[menuID] from GameOA.dbo.oa_purviewpage";
                using (SqlDataReader oReader = SqlHelper.ExecuteReader(con, CommandType.Text, sGetSql))
                {
                    if (oReader == null)
                    {
                        throw new Exception();
                    }
                    List<BasePurviewPage> tmpList = new List<BasePurviewPage>();
                    if (oReader.HasRows)
                    {
                        while (oReader.Read())
                        {
                            BasePurviewPage oTmp = new BasePurviewPage();
                            oTmp.InitData(oReader);
                            tmpList.Add(oTmp);
                        }
                    }
                    this.addCache(tmpList);
                    return true;
                }

        }
        catch (Exception ex)
        {
            this.SaveLog(ex);
            return false;
        }
    }
Example #2
0
    protected override bool InitCache()
    {
        try
        {
            string con = ConfigContext.GetInstance().DataBaseSettingProvider.SimpleManagerConnstring;
            string sGetSql = "select [PageID],[PageTitle],[PageUrl],[DisplayLeft],[PageDesc],[FatherPid],[LastModifyTime],[menuID] from GameOA.dbo.oa_purviewpage";
                using (SqlDataReader oReader = SqlHelper.ExecuteReader(con, CommandType.Text, sGetSql))
                {
                    if (oReader == null)
                    {
                        throw new Exception();
                    }
                    List<BasePurviewPage> tmpList = new List<BasePurviewPage>();
                    if (oReader.HasRows)
                    {
                        while (oReader.Read())
                        {
                            BasePurviewPage oTmp = new BasePurviewPage();
                            oTmp.InitData(oReader);
                            tmpList.Add(oTmp);
                        }
                    }
                    this.addCache(tmpList);
                    return true;
                }

        }
        catch (Exception ex)
        {
            this.SaveLog(ex);
            return false;
        }
    }