Ejemplo n.º 1
0
 /// <summary>
 /// 根据企业类型获取企业信息
 /// </summary>
 /// <param name="ete">企业类型</param>
 /// <returns></returns>
 public static List<Companys> GetCompanyListByType(EnTypeEnum ete)
 {
     SAS.Cache.SASCache cache = SAS.Cache.SASCache.GetCacheService();
         string cachekey = CacheKeys.SAS_COMPANY_INDEX_ENTYPE + Convert.ToInt16(ete);
         List<Companys> companylist = cache.RetrieveObject(cachekey) as List<Companys>;
         if (companylist == null)
         {
             companylist = new List<Companys>();
             List<Companys> tempcompanylist = SAS.Data.DataProvider.Companies.GetCompanyListByType(Convert.ToInt16(ete), 10);
             foreach (Companys compinfo in tempcompanylist)
             {
                 if (compinfo.En_cataloglist.Length > 0)
                 {
                     compinfo.TempCatalogID = TypeConverter.StrToInt(compinfo.En_cataloglist.Split(',')[0]);
                     CatalogInfo _catalog = Catalogs.GetCatalogCacheInfo(compinfo.TempCatalogID);
                     if (_catalog != null) compinfo.CatalogName = _catalog.name;
                 }
                 companylist.Add(compinfo);
             }
             SAS.Cache.ICacheStrategy ica = new SASCacheStrategy();
             ica.TimeOut = 300;
             cache.LoadCacheStrategy(ica);
             cache.AddObject(cachekey, companylist);
             cache.LoadDefaultCacheStrategy();
         }
         return companylist;
 }
        private void SourDataBind()
        {
            EnTypeEnum ete = new EnTypeEnum();
            enType.Items.Clear();
            foreach (string cname in Enum.GetNames(ete.GetType()))
            {
                int s_value = Convert.ToInt16(Enum.Parse(ete.GetType(), cname));
                string s_text = EnumCatch.GetCompanyType(s_value);
                enType.Items.Add(new ListItem(s_text, s_value.ToString()));
            }

            CommTypeEnum cte = new CommTypeEnum();
            enco.Items.Clear();
            foreach (string ecname in Enum.GetNames(cte.GetType()))
            {
                int s_value = Convert.ToInt16(Enum.Parse(cte.GetType(), ecname));
                string s_text = EnumCatch.GetEnCommType(s_value);
                enco.Items.Add(new ListItem(s_text, s_value.ToString()));
            }

            enconfig.AddTableData(CardConfigs.GetCardConfigList(), "ccname", "id");
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 获取企业类型名称
 /// </summary>
 public static string GetCompanyType(EnTypeEnum ete)
 {
     return GetCompanyType(Convert.ToInt16(ete));
 }