Exemplo n.º 1
0
        private void AddAgent()
        {
            Agent    tempAgent = new Agent();
            AddAgent AA        = new AddAgent(tempAgent, tempAgent, ds)
            {
                Title = "Додати агент"
            };

            if (AA.ShowDialog() == true)
            {
                //dataGridView1.Rows.Add(new ThreadAgent(tempAgent, null));
                bindingSource1.Add(new ThreadAgent(tempAgent, null));
            }
            dataGridView1.Refresh();
        }
Exemplo n.º 2
0
        private void EditAgent()
        {
            Agent    editAgent = (Agent)dataGridView1.CurrentRow.Cells["Agent"].Value;
            Agent    tempAgent = editAgent.Clone();
            AddAgent AA        = new AddAgent(tempAgent, editAgent, ds)
            {
                Title = "Редагувати агент"
            };

            if (AA.ShowDialog() == true)
            {
                dataGridView1.CurrentRow.Cells["Agent"].Value = tempAgent;
            }
            dataGridView1.Refresh();
        }