Beispiel #1
0
        protected void LoadDicts()
        {

            PermissionServiceClient cliet = new PermissionServiceClient();
            cliet.GetSysDictionaryByCategoryCompleted += (o, e) =>
            {
                List<T_SYS_DICTIONARY> dicts = new List<T_SYS_DICTIONARY>();
                dicts = e.Result == null ? null : e.Result.ToList();
                if (dicts != null)
                    Application.Current.Resources.Add("SYS_DICTIONARY", dicts);
            };
            if (Application.Current.Resources["SYS_DICTIONARY"] == null)
            {
                cliet.GetAllSysDictionaryCompleted += (o, e) =>
                    {
                        List<T_SYS_DICTIONARY> dicts = new List<T_SYS_DICTIONARY>();
                        dicts = e.Result == null ? null : e.Result.ToList();
                        if (dicts != null)
                            Application.Current.Resources.Add("SYS_DICTIONARY", dicts);
                    };
                cliet.GetAllSysDictionaryAsync();
            }
            //TODO: 按需取出字典值
            //cliet.GetSysDictionaryByCategoryAsync("CHECKSTATE");
            cliet.GetSysDictionaryByCategoryAsync("");
            

            //PermissionServiceClient client = new PermissionServiceClient();
            //client.GetSysDictionaryByCategoryByUpdateDateCompleted += (o, e) =>
            //{
            //    //List<T_SYS_DICTIONARY> dicts = new List<T_SYS_DICTIONARY>();
            //    //dicts = e.Result == null ? null : e.Result.ToList();
            //    List<V_Dictionary> viewDicts = e.Result == null ? null : e.Result.ToList();
                
            //    List<T_SYS_DICTIONARY> dictionary = new List<T_SYS_DICTIONARY>();
            //    if (viewDicts != null)
            //    {
            //        foreach (V_Dictionary item in viewDicts)
            //        {
            //            T_SYS_DICTIONARY dictItem = new T_SYS_DICTIONARY();
            //            dictItem.DICTIONARYID = item.DICTIONARYID;
            //            dictItem.DICTIONARYNAME = item.DICTIONARYNAME;
            //            dictItem.DICTIONARYVALUE = item.DICTIONARYVALUE;
            //            dictItem.DICTIONCATEGORY = item.DICTIONCATEGORY;
            //            if (!string.IsNullOrEmpty(item.FATHERID))
            //            {
            //                dictItem.T_SYS_DICTIONARY2 = new T_SYS_DICTIONARY();
            //                dictItem.T_SYS_DICTIONARY2.DICTIONARYID = item.FATHERID;
                            
            //            }
            //            var ent = dictionary.Where(s => s.DICTIONARYID == item.DICTIONARYID).FirstOrDefault();
            //            if (ent != null)
            //            {
            //                dictionary.Remove(ent);
            //                dictionary.Add(dictItem);
            //            }
            //            else
            //            {
            //                dictionary.Add(dictItem);
            //            }
            //        }
            //    }
            //    if (Application.Current.Resources["SYS_DICTIONARY"] == null)
            //    {
            //        Application.Current.Resources.Add("SYS_DICTIONARY", dictionary);
            //    }
            //    //LoadCompanyInfo();
            //};
            ////TODO: 按需取出字典值
            ////client.GetSysDictionaryByCategoryAsync("");
            //DateTime dt = new DateTime();
            
            
            //client.GetSysDictionaryByCategoryByUpdateDateAsync("", dt);
            
            
        }
Beispiel #2
0
        protected void LoadDicts()
        {
            PermissionServiceClient cliet = new PermissionServiceClient();

            cliet.GetSysDictionaryByCategoryCompleted += (o, e) =>
            {
                List <T_SYS_DICTIONARY> dicts = new List <T_SYS_DICTIONARY>();
                dicts = e.Result == null ? null : e.Result.ToList();
                if (dicts != null)
                {
                    Application.Current.Resources.Add("SYS_DICTIONARY", dicts);
                }
            };
            if (Application.Current.Resources["SYS_DICTIONARY"] == null)
            {
                cliet.GetAllSysDictionaryCompleted += (o, e) =>
                {
                    List <T_SYS_DICTIONARY> dicts = new List <T_SYS_DICTIONARY>();
                    dicts = e.Result == null ? null : e.Result.ToList();
                    if (dicts != null)
                    {
                        Application.Current.Resources.Add("SYS_DICTIONARY", dicts);
                    }
                };
                cliet.GetAllSysDictionaryAsync();
            }
            //TODO: 按需取出字典值
            //cliet.GetSysDictionaryByCategoryAsync("CHECKSTATE");
            cliet.GetSysDictionaryByCategoryAsync("");


            //PermissionServiceClient client = new PermissionServiceClient();
            //client.GetSysDictionaryByCategoryByUpdateDateCompleted += (o, e) =>
            //{
            //    //List<T_SYS_DICTIONARY> dicts = new List<T_SYS_DICTIONARY>();
            //    //dicts = e.Result == null ? null : e.Result.ToList();
            //    List<V_Dictionary> viewDicts = e.Result == null ? null : e.Result.ToList();

            //    List<T_SYS_DICTIONARY> dictionary = new List<T_SYS_DICTIONARY>();
            //    if (viewDicts != null)
            //    {
            //        foreach (V_Dictionary item in viewDicts)
            //        {
            //            T_SYS_DICTIONARY dictItem = new T_SYS_DICTIONARY();
            //            dictItem.DICTIONARYID = item.DICTIONARYID;
            //            dictItem.DICTIONARYNAME = item.DICTIONARYNAME;
            //            dictItem.DICTIONARYVALUE = item.DICTIONARYVALUE;
            //            dictItem.DICTIONCATEGORY = item.DICTIONCATEGORY;
            //            if (!string.IsNullOrEmpty(item.FATHERID))
            //            {
            //                dictItem.T_SYS_DICTIONARY2 = new T_SYS_DICTIONARY();
            //                dictItem.T_SYS_DICTIONARY2.DICTIONARYID = item.FATHERID;

            //            }
            //            var ent = dictionary.Where(s => s.DICTIONARYID == item.DICTIONARYID).FirstOrDefault();
            //            if (ent != null)
            //            {
            //                dictionary.Remove(ent);
            //                dictionary.Add(dictItem);
            //            }
            //            else
            //            {
            //                dictionary.Add(dictItem);
            //            }
            //        }
            //    }
            //    if (Application.Current.Resources["SYS_DICTIONARY"] == null)
            //    {
            //        Application.Current.Resources.Add("SYS_DICTIONARY", dictionary);
            //    }
            //    //LoadCompanyInfo();
            //};
            ////TODO: 按需取出字典值
            ////client.GetSysDictionaryByCategoryAsync("");
            //DateTime dt = new DateTime();


            //client.GetSysDictionaryByCategoryByUpdateDateAsync("", dt);
        }