Example #1
0
        private void ListTS_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            switch (ListTS[e.ColumnIndex, e.RowIndex].Value)
            {
            case "Изменить":
                elementTS = new localhost.TS
                {
                    Id      = int.Parse(ListTS.Rows[e.RowIndex].Cells["Id"].Value.ToString()),
                    Surname = ListTS.Rows[e.RowIndex].Cells["Surname"].Value.ToString(),
                    Phone   = ListTS.Rows[e.RowIndex].Cells["Phone"].Value.ToString()
                };
                surnameEditTextBox.Text = ListTS.Rows[e.RowIndex].Cells["Surname"].Value.ToString();
                phoneEditTextBox.Text   = ListTS.Rows[e.RowIndex].Cells["Phone"].Value.ToString();
                break;

            case "Удалить":
                service.DeleteTS(int.Parse(ListTS.Rows[e.RowIndex].Cells["Id"].Value.ToString()));
                ReloadTable();
                break;
            }
        }
Example #2
0
 /// <remarks/>
 public void EditTSAsync(TS ts)
 {
     this.EditTSAsync(ts, null);
 }
Example #3
0
 /// <remarks/>
 public void AddTSAsync(TS ts)
 {
     this.AddTSAsync(ts, null);
 }