private void b_new_Click(object sender, EventArgs e) { common_file.common_app.get_czsj(); Yyxzx.Yxsy_add_edit Yxsy_add_edit_new = new Yxsy_add_edit(this); Yxsy_add_edit_new.StartPosition = FormStartPosition.CenterScreen; Yxsy_add_edit_new.ShowDialog(); Cursor.Current = Cursors.Default; }
private void b_delete_Click(object sender, EventArgs e) { if (dg_yxsy.CurrentRow != null) { int i = dg_yxsy.CurrentRow.Index; DataRowView dgr = dg_yxsy.Rows[i].DataBoundItem as DataRowView; i = DS_Yxsy.Tables[0].Rows.IndexOf(dgr.Row); if (DS_Yxsy.Tables[0].Rows[i]["id"].ToString() != "") { Yyxzx.Yxsy_add_edit Yxsy_add_edit_new = new Yxsy_add_edit(this); Yxsy_add_edit_new.Yxsy_id = DS_Yxsy.Tables[0].Rows[i]["id"].ToString(); B_Yxsy.Delete(int.Parse(Yxsy_add_edit_new.Yxsy_id)); } refresh_app(); } }
private void b_amend_Click(object sender, EventArgs e) { common_file.common_app.get_czsj(); if (dg_yxsy.CurrentRow != null) { int i = dg_yxsy.CurrentRow.Index; DataRowView dgr = dg_yxsy.Rows[i].DataBoundItem as DataRowView; i = DS_Yxsy.Tables[0].Rows.IndexOf(dgr.Row); if (DS_Yxsy.Tables[0].Rows[i]["id"].ToString() != "") { Yyxzx.Yxsy_add_edit Yxsy_add_edit_new = new Yxsy_add_edit(this); Yxsy_add_edit_new.StartPosition = FormStartPosition.CenterScreen; Yxsy_add_edit_new.judge_add_edit = common_file.common_app.get_edit; Yxsy_add_edit_new.Yxsy_id = DS_Yxsy.Tables[0].Rows[i]["id"].ToString(); Yxsy_add_edit_new.tB_xsy.Text = DS_Yxsy.Tables[0].Rows[i]["xsy"].ToString(); Yxsy_add_edit_new.tB_zjm.Text = DS_Yxsy.Tables[0].Rows[i]["zjm"].ToString(); Yxsy_add_edit_new.ShowDialog(); } Cursor.Current = Cursors.Default; } }