Exemple #1
0
        // 获取未获奖人员
        private void RefreshDrawPerson()
        {
            noprizePersons.Clear();
            var  wpl = GetWinPerson();
            bool isWin;

            for (int i = 0; i < persons.Count; i++)
            {
                isWin = false;
                Person per = persons.GetPerson(i);
                foreach (var wp in wpl)
                {
                    if (per.Equals(wp))
                    {
                        // 此乃人生赢家
                        isWin = true;
                        break;
                    }
                }
                if (!isWin)
                {
                    noprizePersons.Add(per);
                }
            }
        }
Exemple #2
0
        private void updateBt_Click(object sender, EventArgs e)
        {
            int index;

            try
            {
                index = personsLv.SelectedIndices[0];
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("{0}", ex.Message);
                return;
            }
            string name    = persons.GetPerson(index).Name;
            Person tperson = new Person(persons.GetPerson(index).Name, persons.GetPerson(index).Text, persons.GetPerson(index).Picpath);
            var    epdlg   = new EditPersonForm("修改", tperson);

            epdlg.StartPosition = FormStartPosition.CenterParent;
            if (epdlg.ShowDialog() == DialogResult.OK)
            {
                persons.UpdatePerson(index, tperson);
                personsLv.Invalidate();
            }
        }