private void button1_Click(object sender, EventArgs e) { using (var dialog = new EditFeed()) { dialog.EditType = 1; if (dialog.ShowDialog() == DialogResult.OK) { BindData(GetFeeds()); } } }
private void button2_Click(object sender, EventArgs e) { using (var dialog = new EditFeed()) { if (dataGrid1.SelectedRows[0] != null) { var editRow = dataGrid1.SelectedRows[0]; dialog.EditType = 2; dialog.FeedId = Convert.ToInt16(editRow.Cells["Id"].Value); dialog.textBox1.Text = editRow.Cells["FeedCity"].Value.ToString(); dialog.textBox2.Text = editRow.Cells["FeedState"].Value.ToString(); dialog.textBox3.Text = editRow.Cells["FeedRssLink"].Value.ToString(); dialog.checkBox1.Checked = Convert.ToBoolean(editRow.Cells["FeedActive"].Value); if (dialog.ShowDialog() == DialogResult.OK) { BindData(GetFeeds()); } } else MessageBox.Show("Must select row"); } }
private void button2_Click(object sender, EventArgs e) { using (var dialog = new EditFeed()) { if (dataGrid1.SelectedRows[0] != null) { var editRow = dataGrid1.SelectedRows[0]; dialog.EditType = 2; dialog.FeedId = Convert.ToInt16(editRow.Cells["Id"].Value); dialog.textBox1.Text = editRow.Cells["FeedCity"].Value.ToString(); dialog.textBox2.Text = editRow.Cells["FeedState"].Value.ToString(); dialog.textBox3.Text = editRow.Cells["FeedRssLink"].Value.ToString(); dialog.checkBox1.Checked = Convert.ToBoolean(editRow.Cells["FeedActive"].Value); if (dialog.ShowDialog() == DialogResult.OK) { BindData(GetFeeds()); } } else { MessageBox.Show("Must select row"); } } }