コード例 #1
0
ファイル: Main.cs プロジェクト: elkavitaly/Coursework
        /// <summary>
        /// Кнопка добавления коллекционера.
        /// </summary>
        private void addCButton_Click(object sender, EventArgs e)
        {
            AddingCol addCol = new AddingCol();

            if (addCol.ShowDialog() == DialogResult.OK)
            {
                collectorList = new CollectorList();
                CollectorList();
            }
        }
コード例 #2
0
        /// <summary>
        /// Список стран.
        /// </summary>
        public string[] CountryList()
        {
            CollectorList    colList    = new CollectorList();
            List <string>    result     = new List <string>();
            List <Collector> collectors = colList.collectorList;

            foreach (Collector m in collectors)
            {
                if (result.IndexOf(m.country) == -1)
                {
                    result.Add(m.country);
                }
            }

            return(result.ToArray());
        }
コード例 #3
0
ファイル: Main.cs プロジェクト: elkavitaly/Coursework
        /// <summary>
        /// Открытие окна редактирования записи коллекционера.
        /// </summary>
        private void button1_Click(object sender, EventArgs e)
        {
            int ind = TableColData.CurrentRow.Index;

            string[] arr = new string[TableColData.ColumnCount];
            for (int i = 0; i < TableColData.ColumnCount; i++)
            {
                arr[i] = TableColData[i, ind].Value.ToString();
            }

            EditCol edit = new EditCol(arr[0], arr[1], arr[2], arr[3], arr[4]);

            if (edit.ShowDialog() == DialogResult.OK)
            {
                collectorList = new CollectorList();
                List <Collector> collectors = collectorList.collectorList;
                collectors.RemoveAt(ind);
                collectorList.collectorList = collectors;
                collectorList.WriteList();

                CollectorList();
            }
        }