Ejemplo n.º 1
0
        private void comboBoxOrgInCardMgr_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBoxOrgInCardMgr.SelectedIndex <= 0)
            {
                return;
            }

            int orgid = (int)comboBoxOrgInCardMgr.SelectedValue;
            List <DisplayStringValueInt> lstCommValues = new List <DisplayStringValueInt>();

            MemCfgInfo.MemOrgInfo memorg = MemCfgInfo.MemDbMgr.Get().dicMemOrgWithAllInfo[orgid];

            lstCommValues.Add(new DisplayStringValueInt()
            {
                MemberValue  = 0,
                DisplayValue = "--All--",
            });
            foreach (var item in memorg.DicGroupOfOrg)
            {
                lstCommValues.Add(new DisplayStringValueInt()
                {
                    MemberValue  = item.Value.GroupInfo.Id,
                    DisplayValue = item.Value.GroupInfo.GroupName,
                });
            }
            comboBoxGroupInCardMgr.DisplayMember = "DisplayValue";
            comboBoxGroupInCardMgr.ValueMember   = "MemberValue";
            comboBoxGroupInCardMgr.DataSource    = lstCommValues;

            comboBoxProjectInCardMgr.SelectedIndex = -1;
        }
Ejemplo n.º 2
0
 private void MakeMemOrg(int iUpdateFlag)
 {
     foreach (var item in lstOrgsByDb)
     {
         if (dicMemOrgWithAllInfo.ContainsKey(item.Id))
         {
             MemOrgInfo mem = dicMemOrgWithAllInfo[item.Id];
             mem.UpdateFlag = iUpdateFlag;
             if (mem.Org.UpdateDt != item.UpdateDt)
             {
                 mem.Org = item; // 更新
                 // todo 可能会造成内存泄漏,一直有部分list没有删除
             }
         }
         else
         {
             MemOrgInfo aNewMemObj = new MemOrgInfo()
             {
                 Org = item,
                 //DicCardOfProject = new Dictionary<int, MemCardInfo>(),
                 //DicCommDevOfProject =  new Dictionary<int, MemCommDev>(),
                 UpdateFlag = iUpdateFlag
             };
             dicMemOrgWithAllInfo.Add(item.Id, aNewMemObj);
         }
     }
 }
Ejemplo n.º 3
0
        private void comboBoxSelOrg_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBoxSelOrg.SelectedIndex < 0)
            {
                return;
            }

            //comboBoxSelGroup.Items.Clear();
            List <DisplayStringValueInt> lstCommValues = new List <DisplayStringValueInt>();

            lstCommValues.Add(new DisplayStringValueInt()
            {
                MemberValue  = 0,
                DisplayValue = "All"
            });

            comboBoxSelGroup.DisplayMember = "DisplayValue";
            comboBoxSelGroup.ValueMember   = "MemberValue";

            int orgid = (int)comboBoxSelOrg.SelectedValue;

            if (orgid <= 0)
            {
                comboBoxSelGroup.DataSource = lstCommValues;
                return;
            }


            MemCfgInfo.MemOrgInfo memorg = MemCfgInfo.MemDbMgr.Get().dicMemOrgWithAllInfo[orgid];

            foreach (var item in memorg.DicGroupOfOrg)
            {
                lstCommValues.Add(new DisplayStringValueInt()
                {
                    MemberValue  = item.Value.GroupInfo.Id,
                    DisplayValue = item.Value.GroupInfo.GroupName,
                });
            }
            comboBoxSelGroup.DataSource = lstCommValues;
        }