private void but_update_Click(object sender, EventArgs e) { if (dgv_01.SelectedRows.Count == 0) { MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("choicechange", EnumPromptMessage.warning, new string[] { "修改的", "运营成本" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } SortedList slttep = new SortedList(); int selectedIndex = dgv_01.Rows.IndexOf(dgv_01.SelectedRows[0]); string strmoney = dgv_01.SelectedRows[0].Cells["moneyCol"].Value.ToString(); slttep.Add("id", dgv_01.SelectedRows[0].Cells["idCol"].Value); slttep.Add("type", dgv_01.SelectedRows[0].Cells["typeCol"].Value); slttep.Add("money", double.Parse(strmoney.Substring(1))); slttep.Add("time", dgv_01.SelectedRows[0].Cells["timeCol"].Value); slttep.Add("remark", dgv_01.SelectedRows[0].Cells["remarkCol"].Value); HCSRS_operational_costs_new HCRS = new HCSRS_operational_costs_new(slttep); HCRS.ShowDialog(); Loaddata(); if (dgv_01.Rows.Count > selectedIndex) { dgv_01.CurrentRow = dgv_01.Rows[selectedIndex]; } }
private void but_new_Click_1(object sender, EventArgs e) { HCSRS_operational_costs_new HCRS = new HCSRS_operational_costs_new(null); HCRS.ShowDialog(); Loaddata(); }