Exemple #1
0
        void _services_GetTaskConfigInfoByUserCompleted(object sender, Client.PlatformWS.GetTaskConfigInfoByUserCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result != null)
                {
                    var catalog = e.Result.GroupBy(x => new { x.SystemType });
                    List <NewTaskInfo> itemsource = new List <NewTaskInfo>();
                    foreach (var systemMenu in catalog)
                    {
                        if (systemMenu.Key.SystemType != null)
                        {
                            ModuleInfo parentModule = e.Result.FirstOrDefault(item => item.ModuleCode == systemMenu.Key.SystemType);
                            if (parentModule != null)
                            {
                                NewTaskInfo menu = new NewTaskInfo();
                                menu.ModuleName = parentModule.ModuleName;

                                foreach (var tempMenu in systemMenu.ToList())
                                {
                                    menu.Items.Add(tempMenu);
                                }
                                itemsource.Add(menu);
                            }
                        }
                    }

                    itmcTaskList.ItemsSource = itemsource;
                }
            }
        }
Exemple #2
0
        void _services_GetTaskConfigInfoByUserCompleted(object sender, GetTaskConfigInfoByUserCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result != null)
                {
                    var catalog = e.Result.GroupBy(x => new { x.SystemType });
                    List<NewTaskInfo> itemsource = new List<NewTaskInfo>();
                    foreach (var systemMenu in catalog)
                    {

                        if (systemMenu.Key.SystemType != null)
                        {
                            ModuleInfo parentModule = e.Result.FirstOrDefault(item => item.ModuleCode == systemMenu.Key.SystemType);
                            if (parentModule != null)
                            {
                                NewTaskInfo menu = new NewTaskInfo();
                                menu.ModuleName = parentModule.ModuleName;

                                foreach (var tempMenu in systemMenu.ToList())
                                {
                                    menu.Items.Add(tempMenu);
                                }
                                itemsource.Add(menu);
                            }
                        }
                    }

                    itmcTaskList.ItemsSource = itemsource;
                }
            }
        }