public long m_lngUpdate(clsYBDefPayTypeVO objVo) { long lngRes = 0; string SQL = @"update t_opr_bih_ybdefpaytype set jslx = ?, rylb = ? where paytypeid_chr = ? "; long lngAffter = 0; try { clsHRPTableService objHRPSvc = new clsHRPTableService(); IDataParameter[] param = null; objHRPSvc.CreateDatabaseParameter(3, out param); param[0].Value = objVo.m_strYBJslx; param[1].Value = objVo.m_strYBRylb; param[2].Value = objVo.m_strPayTypeId; lngRes = objHRPSvc.lngExecuteParameterSQL(SQL, ref lngAffter, param); objHRPSvc.Dispose(); } catch (Exception objEx) { lngRes = 0; new clsLogText().LogError(objEx); } return(lngRes); }
public long m_lngInsert(clsYBDefPayTypeVO ybDefPayTypeVO) { long lngRes = 0; DataTable table = null; string sql = @" insert into t_opr_bih_ybdefpaytype(paytypeid_chr, jslx, rylb) values (?, ?, ?) "; try { clsHRPTableService hrpService = new clsHRPTableService(); IDataParameter[] objParams = null; hrpService.CreateDatabaseParameter(3, out objParams); objParams[0].Value = ybDefPayTypeVO.m_strPayTypeId; objParams[1].Value = ybDefPayTypeVO.m_strYBJslx; objParams[2].Value = ybDefPayTypeVO.m_strYBRylb; lngRes = hrpService.lngGetDataTableWithParameters(sql, ref table, objParams); } catch (Exception objEx) { lngRes = 0; new clsLogText().LogError(objEx); } return(lngRes); }
private clsYBDefPayTypeVO ConstructVO(DataRow dtRow) { clsYBDefPayTypeVO ybDefPayTypeVO = new clsYBDefPayTypeVO(); ybDefPayTypeVO.m_strPayTypeId = dtRow["paytypeid_chr"].ToString(); ybDefPayTypeVO.m_strPayTypeId = dtRow["jslx"].ToString(); ybDefPayTypeVO.m_strPayTypeId = dtRow["rylb"].ToString(); return(ybDefPayTypeVO); }
private void m_cmdDelete_Click(object sender, EventArgs e) { if (this.m_lsvYBPayTypes.FocusedItem == null) { return; } Cursor.Current = Cursors.WaitCursor; this.m_cmdDelete.Enabled = false; clsYBDefPayTypeVO objYBDefPayType = (clsYBDefPayTypeVO)this.m_lsvYBPayTypes.FocusedItem.Tag; clsYBDefPayTypeVO objCopy = new clsYBDefPayTypeVO(); objYBDefPayType.m_mthCopyTo(objCopy); long lngRes = clsDcl_YBDefPayTypeSmp.s_object.m_lngDelete(objCopy); if (lngRes > 0) {//成功 int intIdx = this.m_lsvYBPayTypes.FocusedItem.Index; this.m_lsvYBPayTypes.FocusedItem.Remove(); //设置新的具有焦点的 ListView 项 if (intIdx < this.m_lsvYBPayTypes.Items.Count) { this.m_lsvYBPayTypes.Items[intIdx].Selected = true; this.m_lsvYBPayTypes.Items[intIdx].Focused = true; this.m_lsvYBPayTypes_Click(null, null); } else if (intIdx - 1 >= 0) { this.m_lsvYBPayTypes.Items[intIdx - 1].Selected = true; this.m_lsvYBPayTypes.Items[intIdx - 1].Focused = true; this.m_lsvYBPayTypes_Click(null, null); } } else {//失败 MessageBox.Show("删除失败!"); } this.m_cmdDelete.Enabled = true; Cursor.Current = Cursors.Default; }
/// <summary> /// 插入新记录 /// </summary> /// <param name="ybDefPayTypeVO"></param> /// <returns></returns> public long m_lngInsert(clsYBDefPayTypeVO ybDefPayTypeVO) { long lngRes = 0; try { com.digitalwave.iCare.middletier.HIS.clsYBDefPayTypeSvc kk = (com.digitalwave.iCare.middletier.HIS.clsYBDefPayTypeSvc)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.iCare.middletier.HIS.clsYBDefPayTypeSvc)); lngRes = kk.m_lngInsert(ybDefPayTypeVO); } catch (Exception objEx) { lngRes = 0; new clsLogText().LogError(objEx); } return(lngRes); }
public long m_lngDelete(clsYBDefPayTypeVO objGroup) { long lngRes = 0; try { com.digitalwave.iCare.middletier.HIS.clsYBDefPayTypeSvc kk = (com.digitalwave.iCare.middletier.HIS.clsYBDefPayTypeSvc)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.iCare.middletier.HIS.clsYBDefPayTypeSvc)); lngRes = kk.m_lngDelete(objGroup); } catch { lngRes = 0; } return(lngRes); }
private clsYBDefPayTypeVO[] ConstructArrayVO(DataTable table) { if (IsTableNull(table)) { return(new clsYBDefPayTypeVO[0]); } int rowCount = table.Rows.Count; clsYBDefPayTypeVO[] arrYBDefPayType = new clsYBDefPayTypeVO[rowCount]; for (int i = 0; i < rowCount; i++) { arrYBDefPayType[i] = ConstructVO(table.Rows[i]); } return(arrYBDefPayType); }
//加载数据和填充列表 private void m_mthLoadYBDefPayTypes() { Cursor.Current = Cursors.WaitCursor; //加载数据 clsYBDefPayTypeVO[] arrYBDefPayTypes = null; clsDcl_YBDefPayTypeSmp.s_object.m_lngFindAll(out arrYBDefPayTypes); if (arrYBDefPayTypes == null) { arrYBDefPayTypes = new clsYBDefPayTypeVO[0]; } m_lsvYBPayTypes.Tag = arrYBDefPayTypes; //填充列表 m_mthShowYBDefPayTypesList(arrYBDefPayTypes); Cursor.Current = Cursors.Default; }
public long m_lngFind(string payTypeId, out clsYBDefPayTypeVO ybDefPayType) { long lngRes = 0; ybDefPayType = null; try { com.digitalwave.iCare.middletier.HIS.clsYBDefPayTypeSvc kk = (com.digitalwave.iCare.middletier.HIS.clsYBDefPayTypeSvc)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.iCare.middletier.HIS.clsYBDefPayTypeSvc)); lngRes = kk.m_lngFind(payTypeId, out ybDefPayType); } catch (Exception objEx) { lngRes = 0; new clsLogText().LogError(objEx); } return(lngRes); }
//列表选定项变更 private void m_lsvYBPayTypes_Click(object sender, EventArgs e) { if (this.m_lsvYBPayTypes.FocusedItem == null) { return; } //变更状态标志 this.m_blnNewYBDefPayTypes = false; this.m_txtTypeId.Enabled = false; this.m_cboTypeName.Enabled = false; clsYBDefPayTypeVO objPayTypeVO = (clsYBDefPayTypeVO)this.m_lsvYBPayTypes.FocusedItem.Tag; this.m_txtTypeId.Text = objPayTypeVO.m_strPayTypeId; SelectedTypeNameIndex(objPayTypeVO.m_strPayTypeId); this.m_cboYBJslxName.SelectedIndex = GetJslxIndex(objPayTypeVO.m_strYBJslx); this.m_cboYBRylxName.SelectedIndex = GetRylxIndex(objPayTypeVO.m_strYBRylb); }
public long m_lngFind(string payTypeId, out clsYBDefPayTypeVO ybDefPayType) { long lngRes = 0; DataTable table = null; ybDefPayType = null; string sql = @" select paytypeid_chr, jslx, rylb from t_opr_bih_ybdefpaytype where paytypeid_chr = ? "; try { clsHRPTableService hrpService = new clsHRPTableService(); IDataParameter[] objParams = null; hrpService.CreateDatabaseParameter(1, out objParams); objParams[0].Value = payTypeId; lngRes = hrpService.lngGetDataTableWithParameters(sql, ref table, objParams); if (IsTableNull(table)) { ybDefPayType = null; } else { ybDefPayType = ConstructVO(table.Rows[0]); } } catch (Exception objEx) { lngRes = 0; new clsLogText().LogError(objEx); } return(lngRes); }
public long m_lngDelete(clsYBDefPayTypeVO objVo) { long lngRes = 0; long lngAffter = 0; string strSQL = @"delete from t_opr_bih_ybdefpaytype where paytypeid_chr = ?"; try { clsHRPTableService objHRPSvc = new clsHRPTableService(); IDataParameter[] param = null; objHRPSvc.CreateDatabaseParameter(1, out param); param[0].Value = objVo.m_strPayTypeId; lngRes = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngAffter, param); objHRPSvc.Dispose(); } catch (Exception objEx) { lngRes = 0; new clsLogText().LogError(objEx); } return(lngRes); }
//保存 private void m_cmdSave_Click(object sender, EventArgs e) { if (m_lsvYBPayTypes.FocusedItem == null && !this.m_blnNewYBDefPayTypes) { return; } Cursor.Current = Cursors.WaitCursor; this.m_cmdSave.Enabled = false; if (this.m_blnNewYBDefPayTypes) {//新增的保存 clsYBDefPayTypeVO ybDefPayTypeVO = new clsYBDefPayTypeVO(); clsPatientType_VO patientPayType = this.m_cboTypeName.SelectedItem as clsPatientType_VO; if (patientPayType == null) { MessageBox.Show("请选择患者身份类型!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } ybDefPayTypeVO.m_strPayTypeId = patientPayType.m_strPayTypeID; ybDefPayTypeVO.m_strYBJslx = GetJslxId(this.m_cboYBJslxName.SelectedIndex); ybDefPayTypeVO.m_strYBRylb = GetRylxId(this.m_cboYBRylxName.SelectedIndex); ybDefPayTypeVO.m_strPayTypeName = patientPayType.m_strPayTypeName; clsYBDefPayTypeVO temp = null; clsDcl_YBDefPayTypeSmp.s_object.m_lngFind(ybDefPayTypeVO.m_strPayTypeId, out temp); if (temp != null) { MessageBox.Show("该患者身份类型已经添加!", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } long lngRes = clsDcl_YBDefPayTypeSmp.s_object.m_lngInsert(ybDefPayTypeVO); if (lngRes > 0) {//成功 //更新状态标志 this.m_blnNewYBDefPayTypes = false; //加入到集合 clsYBDefPayTypeVO[] objGroupArr = (clsYBDefPayTypeVO[])this.m_lsvYBPayTypes.Tag; clsYBDefPayTypeVO[] objGroupNewArr = new clsYBDefPayTypeVO[objGroupArr.Length + 1]; objGroupArr.CopyTo(objGroupNewArr, 0); objGroupNewArr[objGroupNewArr.Length - 1] = ybDefPayTypeVO; this.m_lsvYBPayTypes.Tag = objGroupNewArr; //添加新项 ListViewItem item = new ListViewItem(ybDefPayTypeVO.m_strPayTypeId); item.SubItems.Add(ybDefPayTypeVO.m_strPayTypeName); item.SubItems.Add(ybDefPayTypeVO.m_strYBJslxName()); item.SubItems.Add(ybDefPayTypeVO.m_strYBRylbName()); item.Tag = ybDefPayTypeVO; this.m_lsvYBPayTypes.Items.Add(item); item.Selected = true; item.Focused = true; this.m_txtTypeId.Enabled = false; this.m_lsvYBPayTypes_Click(null, null); } else {//失败 MessageBox.Show("新增数据失败!"); } } else {//修改的保存 clsPatientType_VO patientPayType = this.m_cboTypeName.SelectedItem as clsPatientType_VO; if (patientPayType == null) { MessageBox.Show("请选择患者身份类型!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } clsYBDefPayTypeVO objYBDefPayType = (clsYBDefPayTypeVO)this.m_lsvYBPayTypes.FocusedItem.Tag; clsYBDefPayTypeVO objGroup = new clsYBDefPayTypeVO(); objYBDefPayType.m_mthCopyTo(objGroup); objYBDefPayType.m_strPayTypeName = patientPayType.m_strPayTypeName; objYBDefPayType.m_strYBJslx = GetJslxId(this.m_cboYBJslxName.SelectedIndex); objYBDefPayType.m_strYBRylb = GetRylxId(this.m_cboYBRylxName.SelectedIndex); long lngRes = clsDcl_YBDefPayTypeSmp.s_object.m_lngUpdate(objYBDefPayType); if (lngRes > 0) {//成功 //objGroup.m_mthCopyTo(objYBDefPayType); this.m_lsvYBPayTypes.FocusedItem.Text = objYBDefPayType.m_strPayTypeId; this.m_lsvYBPayTypes.FocusedItem.SubItems[1].Text = objYBDefPayType.m_strPayTypeName; this.m_lsvYBPayTypes.FocusedItem.SubItems[2].Text = objYBDefPayType.m_strYBJslxName(); this.m_lsvYBPayTypes.FocusedItem.SubItems[3].Text = objYBDefPayType.m_strYBRylbName(); m_lsvYBPayTypes.Tag = objYBDefPayType; } else {//失败 MessageBox.Show("修改数据失败!"); } this.m_txtTypeId.Enabled = false; } this.m_cmdSave.Enabled = true; Cursor.Current = Cursors.Default; }