/// <summary> /// Delete /// </summary> void Delete() { EntityBihSadcExperts expertVo = this.txtCon.Tag as EntityBihSadcExperts; if (MessageBox.Show("删除前请再次确认?", "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { this.Cursor = Cursors.WaitCursor; expertVo.responsedesc = null; expertVo.responsedate = null; clsBIHOrderService svc = new clsDcl_GetSvcObject().m_GetOrderSvcObject(); int ret = svc.SaveSadcResponse(expertVo); svc = null; if (ret > 0) { LoadData(expertVo.applyid); SetData(null); MessageBox.Show("删除成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("删除失败。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show(ex.Message, "删除异常", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; } } }
/// <summary> /// Save /// </summary> void Save() { EntityBihSadcExperts expertVo = this.txtCon.Tag as EntityBihSadcExperts; expertVo.responsedesc = this.txtCon.Text.Trim(); expertVo.expertname = this.txtDoct.Text.Trim(); expertVo.responsedate = this.dtpDoct.Value; if (expertVo.responsedesc == string.Empty) { MessageBox.Show("会诊意见不能为空", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.txtCon.Focus(); return; } if (expertVo.expertname == string.Empty) { MessageBox.Show("会诊医师不能为空", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.txtDoct.Focus(); return; } if (expertVo.responsedate <= Convert.ToDateTime("2018-01-01 00:00:00")) { MessageBox.Show("签名日期不能小于2018-01-01", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.dtpDoct.Focus(); return; } try { this.Cursor = Cursors.WaitCursor; clsBIHOrderService svc = new clsDcl_GetSvcObject().m_GetOrderSvcObject(); int ret = svc.SaveSadcResponse(expertVo); svc = null; if (ret > 0) { LoadData(expertVo.applyid); MessageBox.Show("保存成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("保存失败。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show(ex.Message, "保存异常", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; } }