private void btnAdd_Click(object sender, EventArgs e) { FormExchangeRate_Edit objForm = new Base.FormExchangeRate_Edit(); objForm.iModel = 1; if (objForm.ShowDialog() == DialogResult.OK) { LoadDataSource(); } }
private void btnModify_Click(object sender, EventArgs e) { if (this.myDataGridView1.CurrentRowNew != null) { if (this.myDataGridView1.Rows[this.myDataGridView1.CurrentRowNew.Index].Cells["年"].Value != DBNull.Value) { int year = (int)this.myDataGridView1.Rows[this.myDataGridView1.CurrentRowNew.Index].Cells["年"].Value; int month = (int)this.myDataGridView1.Rows[this.myDataGridView1.CurrentRowNew.Index].Cells["月"].Value; decimal rate = (decimal)this.myDataGridView1.Rows[this.myDataGridView1.CurrentRowNew.Index].Cells["汇率"].Value; FormExchangeRate_Edit objForm = new Base.FormExchangeRate_Edit(); objForm.iModel = 2; objForm.iYear = year; objForm.iMonth = month; objForm.rate = rate; if (objForm.ShowDialog() == DialogResult.OK) { LoadDataSource(); } } } }