/// <summary> /// 查询明细信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TmshowDtl_Click(object sender, EventArgs e) { try { if (gvdtl.Rows.Count == 0) { throw new Exception("没有内容,不能查阅"); } if (gvdtl.SelectedRows.Count == 0) { throw new Exception("没有选中的行,请选中后继续."); } var accountAddFrm = new AccountAddFrm(); //将相关变量传递至指定窗体内 accountAddFrm.FunState = "R"; accountAddFrm.Userid = Convert.ToInt32(gvdtl.Rows[gvdtl.CurrentCell.RowIndex].Cells[0].Value); //获取所选择行的userid accountAddFrm.OnInitialize(); accountAddFrm.StartPosition = FormStartPosition.CenterScreen; accountAddFrm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// 帐户新增 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TmAdd_Click(object sender, EventArgs e) { try { var accountAddFrm = new AccountAddFrm(); //将相关变量传递至指定窗体内 accountAddFrm.FunState = "C"; accountAddFrm.StartPosition = FormStartPosition.CenterScreen; accountAddFrm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }