public virtual void AppendTempBCCSet() { DataGridView setDataGrid = CnasUtilityTools.FindControl <DataGridView>(this, "setDataGrid"); if (setDataGrid != null) { string tempBCCs = string.Empty; for (int i = 0; i < ScanBarCodes.Count; i++) { string key = ScanBarCodes.GetKey(i).ToString(); if (key.Contains(":BCC") || key.StartsWith("BCC")) { string bccCode = key.Substring(key.IndexOf("BCC"), 13); if (BarCodeHelper.IsOrderSet(bccCode) || BarCodeHelper.IsTempSet(bccCode)) { tempBCCs += string.Format("{0},", bccCode); } } } if (!string.IsNullOrEmpty(tempBCCs)) { tempBCCs = tempBCCs.TrimEnd(','); SortedList condition = new SortedList(); tempBCCs = tempBCCs.Replace(",", "','"); condition.Add(1, PdCode); condition.Add(2, "0"); condition.Add(3, tempBCCs); string testSql = RemoteClient.RemotInterface.CheckSelectData("HCS-workset-tempBCC-sec001", condition); DataTable data = RemoteClient.RemotInterface.SelectData("HCS-workset-tempBCC-sec001", condition); if (data != null) { foreach (DataRow item in data.Rows) { int rowIndex = -1; string bccCode = Convert.ToString(item["bar_code"]); if (item.Table.Columns.Contains("bar_code") && item["bar_code"] != null) { rowIndex = DataConverter.ConvertSetData(setDataGrid, item); } if (BarCodeHelper.IsOrderSet(bccCode) && item.Table.Columns.Contains("order_type") && setDataGrid.Columns.Contains("setTypeCol") && rowIndex >= 0) { setDataGrid.Rows[rowIndex].Cells["setTypeCol"].Value = item["order_type"]; } } } } } }
public void RefreshInstrumentSearchGrid() { try { CnasRemotCall remoteClient = new CnasRemotCall(); DataTable instrumentData = null; if (Data.ContainsKey("SetCode") && !BarCodeHelper.IsTempSet(Data["SetCode"])) { string setCode = Data["SetCode"]; if (!string.IsNullOrEmpty(setCode)) { bool isBCCS = BarCodeHelper.IsSpecialSet(setCode); string sql = "HCS-instrument-info-sec007"; SortedList condition = new SortedList(); condition.Add(1, CnasBaseData.SystemID); //CnasBaseData.SystemID condition.Add(2, setCode); if (BarCodeHelper.IsSpecialSet(setCode)) { sql = "HCS-instrument-info-sec002"; } else if (BarCodeHelper.IsOrderSet(setCode)) { sql = "HCS-instrument-info-sec008"; } string testSql = remoteClient.RemotInterface.CheckSelectData(sql, condition); instrumentData = remoteClient.RemotInterface.SelectData(sql, condition); } } else { SortedList condition = new SortedList(); condition.Add(1, CnasBaseData.UserBaseInfo.LocationId); condition.Add(2, CnasBaseData.SystemID); string testSql = remoteClient.RemotInterface.CheckSelectData("HCS-instrument-info-sec006", condition); instrumentData = remoteClient.RemotInterface.SelectData("HCS-instrument-info-sec006", condition); } if (instrumentData != null) { DataRow[] data = instrumentData.Select(string.Format("ca_name like '%{0}%'", instrumentNameTxt.Text)); if (data.Length > 0) { inSearchGrid.Rows.Clear(); foreach (DataRow row in data) { int rowIndex = inSearchGrid.Rows.Add(); if (row["id"] != null) { inSearchGrid.Rows[rowIndex].Cells["idCol"].Value = Convert.ToString(row["id"]); } if (row["ca_name"] != null) { inSearchGrid.Rows[rowIndex].Cells["nameCol"].Value = Convert.ToString(row["ca_name"]); } //if (row["costc_name"] != null) inSearchGrid.Rows[rowIndex].Cells["costCenterCol"].Value = Convert.ToString(row["costc_name"]); } } } } catch (Exception) { } }
/// <summary> /// 根据器械包条形码查询器械包信息 /// </summary> /// <param name="setBarCode">器械包条形码</param> public Dictionary <string, string> GetPackageByBarCode(string barCode) { Dictionary <string, string> packageInfo = null; SortedList condition = new SortedList(); condition.Add(1, barCode); bool isTempSet = BarCodeHelper.IsTempSet(barCode); string sql = BarCodeHelper.IsTempSet(barCode) ? "HCS_temp_set_sec001" : "HCS-procedure-info-config-sec002"; string testSql = _remoteClient.RemotInterface.CheckSelectData(sql, condition); DataTable data = _remoteClient.RemotInterface.SelectData(sql, condition); packageInfo = new Dictionary <string, string>(); if (data != null) { if (data.Rows != null && data.Rows.Count > 0) { DataRow row = data.Rows[0] as DataRow; if (isTempSet) { if (row["id"] != null) { packageInfo.Add("id", row["id"].ToString()); } if (row["bar_code"] != null) { packageInfo.Add("bar_code", row["bar_code"].ToString()); } if (row["ca_name"] != null) { packageInfo.Add("ca_name", row["ca_name"].ToString()); } } else { if (row["id"] != null) { packageInfo.Add("id", row["id"].ToString()); } if (row["bar_code"] != null) { packageInfo.Add("bar_code", row["bar_code"].ToString()); } if (row["base_setcode"] != null) { packageInfo.Add("base_setcode", row["base_setcode"].ToString()); } if (row["ca_name"] != null) { packageInfo.Add("ca_name", row["ca_name"].ToString()); } if (row["pa_type"] != null) { packageInfo.Add("pa_type", row["pa_type"].ToString()); } if (row["department_id"] != null) { packageInfo.Add("department_id", row["department_id"].ToString()); } if (row["cre_date"] != null) { packageInfo.Add("cre_date", row["cre_date"].ToString()); } if (row["st_pr_Name"] != null) { packageInfo.Add("st_pr_Name", row["st_pr_Name"].ToString()); } if (row["wa_pr_Name"] != null) { packageInfo.Add("wa_pr_Name", row["wa_pr_Name"].ToString()); } if (row["cost_center_name"] != null) { packageInfo.Add("cost_center_name", row["cost_center_name"].ToString()); } if (row["pa_priorty"] != null) { packageInfo.Add("pa_priorty", row["pa_priorty"].ToString()); } } } } return(packageInfo); }
private void but_select_Click(object sender, EventArgs e) { SortedList param01 = new SortedList(); SortedList param02 = new SortedList(); SortedList param03 = new SortedList(); SortedList param04 = new SortedList(); SortedList sqlParameters = new SortedList(); if (dgv_02.Rows.Count == 0) { MessageBox.Show("没有需要召回的包", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (cb_cycle.Text == "") { MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("fillralla", EnumPromptMessage.warning), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (MessageBox.Show("确定要召回该批次的包?", "是否召回", MessageBoxButtons.YesNo) == DialogResult.No) { return; } for (int i = 0; i < dgv_02.Rows.Count; i++) { string barCode = dgv_02.Rows[i].Cells["set_barcode"].Value.ToString(); SortedList updateWorkSet = new SortedList(); SortedList insertWorkSet = new SortedList(); SortedList insertReCall = new SortedList(); SortedList updateStorage = new SortedList(); updateWorkSet.Add(1, barCode); updateWorkSet.Add(2, dgv_02.Rows[i].Cells["s_bcu"].Value.ToString()); updateWorkSet.Add(3, dgv_02.Rows[i].Cells["wf_code"].Value.ToString()); param01.Add((param01.Count + 1), updateWorkSet); if (!BarCodeHelper.IsTempSet(barCode)) { insertWorkSet.Add(1, dgv_02.Rows[i].Cells["id"].Value.ToString()); insertWorkSet.Add(2, barCode); insertWorkSet.Add(3, dgv_02.Rows[i].Cells["base_set"].Value.ToString()); insertWorkSet.Add(4, cb_cycle.Text.Substring(0, 4)); param02.Add((param02.Count + 1), insertWorkSet); } insertReCall.Add(1, dgv_02.Rows[i].Cells["base_set"].Value.ToString()); insertReCall.Add(2, barCode); insertReCall.Add(3, tb_sterbar.Text); insertReCall.Add(4, tb_batch.Text); param03.Add((param03.Count + 1), insertReCall); updateStorage.Add(1, barCode); param04.Add((param04.Count + 1), updateStorage); } sqlParameters.Add(1, param01); sqlParameters.Add(2, param02); sqlParameters.Add(3, param03); sqlParameters.Add(4, param04); CnasRemotCall reCnasRemotCall = new CnasRemotCall(); string recsql = reCnasRemotCall.RemotInterface.CheckUPDataList("HCS-workset-add010", sqlParameters); int recint = reCnasRemotCall.RemotInterface.UPDataList("HCS-workset-add010", sqlParameters); if (recint <= -1) { return; } MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("successful", EnumPromptMessage.warning, new string[] { "召回包" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); }
public override void AppendTempBCCSet() { SortedList condition = new SortedList(); condition.Add(1, PdCode); condition.Add(2, "0"); condition.Add(3, _MachineCode); string testSql = RemoteClient.RemotInterface.CheckSelectData("HCS-workset-tempBCC-sec002", condition); DataTable data = RemoteClient.RemotInterface.SelectData("HCS-workset-tempBCC-sec002", condition); if (data != null) { foreach (DataRow item in data.Rows) { int rowIndex = -1; string bccCode = Convert.ToString(item["bar_code"]); if (item.Table.Columns.Contains("bar_code") && item["bar_code"] != null && (BarCodeHelper.IsTempSet(item["bar_code"].ToString()) || BarCodeHelper.IsOrderSet(item["bar_code"].ToString()))) { rowIndex = DataConverter.ConvertSetData(setDataGrid, item); } if (BarCodeHelper.IsOrderSet(bccCode) && item.Table.Columns.Contains("order_type") && setDataGrid.Columns.Contains("setTypeCol") && rowIndex >= 0) { setDataGrid.Rows[rowIndex].Cells["setTypeCol"].Value = item["order_type"]; } } } }