/// <summary> 查看 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void dgvRecord_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (this.dgvRecord.CurrentRow == null) { return; } try { DataRow dr = (this.dgvRecord.CurrentRow.DataBoundItem as DataRowView).Row; if (dr == null) { return; } UCCompanyEdit comEdit = new UCCompanyEdit(); comEdit.windowStatus = WindowStatus.View; comEdit.drRecord = dr; comEdit.uc = this; base.addUserControl(comEdit, "公司管理-查看", dr["com_id"].ToString(), this.Tag.ToString(), this.Name); } catch (Exception ex) { GlobalStaticObj_Server.GlobalLogService.WriteLog("公司档案", ex); MessageBoxEx.ShowWarning("程序异常"); } }
//新增 private void btnAdd_Click(object sender, EventArgs e) { try { UCCompanyEdit comAdd = new UCCompanyEdit(); comAdd.windowStatus = WindowStatus.Add; comAdd.uc = this; base.addUserControl(comAdd, "公司管理-添加", "Company_Add", this.Tag.ToString(), this.Name); } catch (Exception ex) { GlobalStaticObj_Server.GlobalLogService.WriteLog("公司档案", ex); MessageBoxEx.ShowWarning("程序异常"); } }
/// <summary> /// 浏览或者编辑 /// </summary> /// <param name="status"></param> private void ViewOrEdit(WindowStatus status, string menuName) { if (this.dgvRecord.CurrentRow == null) { return; } DataRow dr = (this.dgvRecord.CurrentRow.DataBoundItem as DataRowView).Row; if (dr == null) { return; } UCCompanyEdit comEdit = new UCCompanyEdit(dr, status, this.Name); comEdit.uc = this; base.addUserControl(comEdit, menuName, dr["com_id"].ToString(), this.Tag.ToString(), this.Name); }