/// <summary> /// ConvertMedstore /// </summary> void ConvertMedstore() { if (this.gvMain.SelectedRows.Count > 0) { EntityParm vo = null; List <EntityParm> lstParm = new List <EntityParm>(); for (int i = 0; i < this.gvMain.SelectedRows.Count; i++) { if (this.gvMain.SelectedRows[i].Cells["sendstatus"].Value.ToString() == "撤销" || this.gvMain.SelectedRows[i].Cells["sendstatus"].Value.ToString() == "未发送") { vo = new EntityParm(); vo.funcCode = "convert"; vo.groupNo = this.gvMain.SelectedRows[i].Cells["recipeno"].Value.ToString(); vo.opIp = this.rdoOp.Checked ? "1" : "2"; // 1 门诊; 2 住院 vo.recorderId = this.LoginInfo.m_strEmpID; vo.recipeId = this.gvMain.SelectedRows[i].Cells["recipeid1"].Value.ToString(); vo.putMedId = this.rdoOp.Checked ? this.gvMain.SelectedRows[i].Cells["putmedid"].Value.ToString() : this.GetPutMedId(vo.recipeId, vo.groupNo); lstParm.Add(vo); } } if (lstParm.Count == 0) { MessageBox.Show("请选择需要转门诊中药房发药的处方。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } string groupNos = string.Empty; string recipeIds = string.Empty; string putMedIds = string.Empty; foreach (EntityParm item in lstParm) { groupNos += item.groupNo + ","; putMedIds += item.putMedId + ","; recipeIds += "'" + item.recipeId + "',"; } // 最后校验 clsDomainControlOPMedStore svc = new clsDomainControlOPMedStore(); if (svc.CheckIsSend(putMedIds.TrimEnd(','), true)) { MessageBox.Show("药品处方已发送,不能转门诊中药房发药。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Query(); return; } string empId = string.Empty; if (clsPublic.m_dlgConfirm(this.LoginInfo.m_strEmpNo, out empId) == DialogResult.Yes) { if (svc.ConvertMedStore(recipeIds.TrimEnd(','), putMedIds.TrimEnd(','), empId, (this.rdoOp.Checked ? 1 : 2)) > 0) { MessageBox.Show("转门诊中药房成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Query(); } else { MessageBox.Show("转门诊中药房失败。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } svc = null; } else { MessageBox.Show("请选择需要取消发送的药品处方。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Cancel /// </summary> void Cancel() { if (this.gvMain.SelectedRows.Count > 0) { EntityParm vo = null; List <EntityParm> lstParm = new List <EntityParm>(); for (int i = 0; i < this.gvMain.SelectedRows.Count; i++) { if (this.gvMain.SelectedRows[i].Cells["sendstatus"].Value.ToString() == "已发送") { vo = new EntityParm(); vo.funcCode = "cancel"; vo.groupNo = this.gvMain.SelectedRows[i].Cells["recipeno"].Value.ToString(); vo.opIp = this.rdoOp.Checked ? "1" : "2"; // 1 门诊; 2 住院 vo.recorderId = this.LoginInfo.m_strEmpID; vo.recipeId = this.gvMain.SelectedRows[i].Cells["recipeid1"].Value.ToString(); vo.putMedId = this.rdoOp.Checked ? this.gvMain.SelectedRows[i].Cells["putmedid"].Value.ToString() : this.GetPutMedId(vo.recipeId, vo.groupNo); lstParm.Add(vo); } } if (lstParm.Count == 0) { MessageBox.Show("请选择需要取消发送的药品处方。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } string groupNos = string.Empty; string recipeIds = string.Empty; string putMedIds = string.Empty; foreach (EntityParm item in lstParm) { groupNos += item.groupNo + ","; putMedIds += item.putMedId + ","; recipeIds += "'" + item.recipeId + "',"; } // 最后校验 clsDomainControlOPMedStore svc = new clsDomainControlOPMedStore(); if (svc.CheckIsSend(putMedIds.TrimEnd(','), false)) { MessageBox.Show("药品处方未发送,不需要取消发送。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Query(); return; } svc = null; string empId = string.Empty; if (clsPublic.m_dlgConfirm(this.LoginInfo.m_strEmpNo, out empId) == DialogResult.Yes) { string request = string.Empty; request += "<req>" + Environment.NewLine; request += string.Format("<funcCode>{0}</funcCode>", lstParm[0].funcCode) + Environment.NewLine; request += string.Format("<opIp>{0}</opIp>", lstParm[0].opIp) + Environment.NewLine; request += string.Format("<recipeId>{0}</recipeId>", recipeIds.TrimEnd(',')) + Environment.NewLine; request += string.Format("<groupNo>{0}</groupNo>", groupNos.TrimEnd(',')) + Environment.NewLine; request += string.Format("<recorderId>{0}</recorderId>", empId) + Environment.NewLine; request += string.Format("<putMedId>{0}</putMedId>", putMedIds.TrimEnd(',')) + Environment.NewLine; request += "</req>" + Environment.NewLine; if (this.WebPost(request)) { MessageBox.Show("处方取消发送成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Query(); } else { MessageBox.Show("处方取消发送失败.", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } else { MessageBox.Show("请选择需要取消发送的药品处方。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }