private void comboBoxGroupInCardMgr_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBoxGroupInCardMgr.SelectedIndex <= 0)
            {
                return;
            }

            int groupId = (int)comboBoxGroupInCardMgr.SelectedValue;
            List <DisplayStringValueInt> lstCommValues = new List <DisplayStringValueInt>();

            MemCfgInfo.MemGroupInfo memGroup = MemCfgInfo.MemDbMgr.Get().dicMemGroupWithAllInfo[groupId];

            lstCommValues.Add(new DisplayStringValueInt()
            {
                MemberValue  = 0,
                DisplayValue = "--All--",
            });
            foreach (var item in memGroup.DicProject)
            {
                lstCommValues.Add(new DisplayStringValueInt()
                {
                    MemberValue  = item.Value.Project.Id,
                    DisplayValue = item.Value.Project.ProjectName,
                });
            }
            comboBoxProjectInCardMgr.DisplayMember = "DisplayValue";
            comboBoxProjectInCardMgr.ValueMember   = "MemberValue";
            comboBoxProjectInCardMgr.DataSource    = lstCommValues;
        }
Exemple #2
0
 private void MakeMemGroup(int iUpdateFlag)
 {
     foreach (var item in lstGroupsByDb)
     {
         if (dicMemGroupWithAllInfo.ContainsKey(item.Id))
         {
             MemGroupInfo mem = dicMemGroupWithAllInfo[item.Id];
             mem.UpdateFlag = iUpdateFlag;
             if (mem.GroupInfo.UpdateDt != item.UpdateDt)
             {
                 mem.GroupInfo = item; // 更新
                 // todo 可能会造成内存泄漏,一直有部分list没有删除
             }
         }
         else
         {
             MemGroupInfo aNewMemObj = new MemGroupInfo()
             {
                 GroupInfo = item,
                 RefOrg    = null,
                 //DicCardOfProject = new Dictionary<int, MemCardInfo>(),
                 //DicCommDevOfProject =  new Dictionary<int, MemCommDev>(),
                 UpdateFlag = iUpdateFlag
             };
             dicMemGroupWithAllInfo.Add(item.Id, aNewMemObj);
         }
     }
 }