예제 #1
0
        private void LoadData()
        {
            LinksRepository   lr = new LinksRepository();
            List <shortLinks> ll = lr.ReadALL();

            dataGridView1.DataSource = ll;
            dataGridView1.ReadOnly   = true;
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            LinksRepository   lr = new LinksRepository();
            List <shortLinks> ll = lr.ReadALL();

            if (check_id(ll, Int32.Parse(textBox1.Text)))
            {
                textBox2.Text = lr.ReadById(Int32.Parse(textBox1.Text));
                lr.updateCount(Int32.Parse(textBox1.Text));
            }
            else
            {
                MessageBox.Show("Ошибка. Проверьте выбранный id");
            }
        }