示例#1
0
        public void UpdateDest()
        {
            // DestInfos = Clone<BaseDataInfo>(SrcInfos);
            DestInfos = SrcInfos.DeepClone();
            string path = GetMapPath();

            if (File.Exists(path))
            {
                var mapperInfos = MappInfo.Deserialize(path);
                var tmp         = new List <BaseDataInfo>();
                DestInfos.ForEach(x =>
                {
                    var info = mapperInfos.FirstOrDefault(y => y.Key == x.技能组);
                    if (info != null)
                    {
                        if (info.Value == "-1")
                        {
                            // DestInfos.Remove(x);
                        }
                        else
                        {
                            x.技能组 = info.Value;
                            tmp.Add(x);
                        }
                    }
                    else
                    {
                        tmp.Add(x);
                    }
                });
                DestInfos = tmp;
            }
        }
示例#2
0
 private bool LoadSrcInfo(string path)
 {
     if (string.IsNullOrEmpty(path) || !File.Exists(path))
     {
         return(false);
     }
     try
     {
         var dt = NPOIHelper.ImportExceltoDt(path, 0, 0);
         SrcInfos = Common.DTToList <BaseDataInfo>(dt);
         SrcInfos = SrcInfos.Where(x => !string.IsNullOrEmpty(x.姓名)).ToList();
         SrcInfos = FilterUsers(SrcInfos);
         return(true);
     }
     catch (Exception ex)
     {
     }
     return(false);
 }
示例#3
0
        private void OpenSettingDig()
        {
            var list = SrcInfos.GroupBy(x => x.技能组).ToDictionary(x => x.Key, x => x.ToList());

            new SettingGroups(list.Select(x => x.Key).ToList()).ShowDialog();
        }