public virtual void ModifySpecialSetInstruments() { DataGridView setDataGrid = CnasUtilityTools.FindControl <DataGridView>(this, "setDataGrid"); if (setDataGrid != null) { if (setDataGrid.SelectedRows != null && setDataGrid.SelectedRows.Count == 1) { if (setDataGrid.Columns.Contains("setBarCodeCol")) { string setBarCode = setDataGrid.SelectedRows[0].Cells["setBarCodeCol"].Value.ToString(); bool isBCCSSet = BarCodeHelper.IsSpecialSet(setBarCode); if (isBCCSSet) { HCSWF_set_instrument_modify modifyDialog = new HCSWF_set_instrument_modify(setBarCode); modifyDialog.ShowDialog(); } else { MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("selectspecialset", EnumPromptMessage.warning), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } else { MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("selectspecialset", EnumPromptMessage.warning), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("notfindSetGrid", EnumPromptMessage.error), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void RefreshDataGrid() { bool isBCCS = BarCodeHelper.IsSpecialSet(Convert.ToString(setNameTxt.Tag)); string sql = isBCCS ?"HCS-instrument-info-sec002" : "HCS-instrument-info-sec001"; SortedList condition = new SortedList(); condition.Add(1, CnasBaseData.SystemID); condition.Add(2, isBCCS ? Convert.ToString(setNameTxt.Tag) : _packingSetBaseId.ToString()); string testSql = RemoteClient.RemotInterface.CheckSelectData(sql, condition); DataTable data = RemoteClient.RemotInterface.SelectData(sql, condition); if (data != null && data.Rows.Count > 0) { foreach (DataRow item in data.Rows) { int rowIndex = instrumentGrid.Rows.Add(); if (item["id"] != null) { instrumentGrid.Rows[rowIndex].Cells["idCol"].Value = item["id"]; } if (item["ca_name"] != null) { instrumentGrid.Rows[rowIndex].Cells["inNameCol"].Value = item["ca_name"]; } if (item["instrument_type"] != null) { instrumentGrid.Rows[rowIndex].Cells["inTypeCol"].Value = item["instrument_type"]; } if (item["instrument_num"] != null) { instrumentGrid.Rows[rowIndex].Cells["inNumCol"].Value = item["instrument_num"]; } if (item["costc_name"] != null) { instrumentGrid.Rows[rowIndex].Cells["costCNameCol"].Value = item["costc_name"]; } if (item["ca_price"] != null) { instrumentGrid.Rows[rowIndex].Cells["inPriceCol"].Value = item["ca_price"]; } instrumentGrid.Rows[rowIndex].Cells["isPackagedCol"].Value = (item["ca_type"] != null && _defaluePackInstrumentType.Contains(item["ca_type"].ToString()))? true : false; } if (_isNeedCheckAll) { instrumentGrid.ClearSelection(); instrumentGrid.Rows[0].Selected = true; instrumentGrid.Rows[0 + 1].Cells["isPackagedCol"].Selected = true; if (instrumentGrid.Columns["isPackagedCol"].Visible) { instrumentGrid.CurrentCell = instrumentGrid.Rows[0].Cells["isPackagedCol"]; } instrumentGrid.Focus(); instrumentGrid.BeginEdit(false); } } }
private void SetPackageInfo() { if (setDataGrid.SelectedRows != null && setDataGrid.SelectedRows.Count > 0 && setDataGrid.SelectedRows[0].Tag is DataRow) { DataRow data = setDataGrid.SelectedRows[0].Tag as DataRow; setInfoPanel.Tag = data; if (data["ca_name"] != null) { setNameTxt.Text = data["ca_name"].ToString(); } if (data["bar_code"] != null) { setBarCodeTxt.Text = data["bar_code"].ToString(); } if (data["pa_priorty"] != null) { setPriortyTxt.Text = data["pa_priorty"].ToString(); } if (data["cost_center_name"] != null) { costCNameTxt.Text = data["cost_center_name"].ToString(); } bool isBCCSSet = BarCodeHelper.IsSpecialSet(setBarCodeTxt.Text);; saveBtn.Visible = isBCCSSet ? true : false; confirmInNumLbl.Visible = isBCCSSet ? true : false; searchPanel.Visible = isBCCSSet ? true : false; instrumentSearchGrid.Visible = isBCCSSet ? true : false; moveBtnsPanel.Visible = isBCCSSet ? true : false;; searchBtn.Visible = isBCCSSet ? true : false; instrumentGrid.Columns["instrumentCostCNameCol"].ReadOnly = isBCCSSet ? false : true; if (isBCCSSet) //订单界面 { if (data["cost_center"] != null && data["cost_center_name"] != null && costNameCbx.Items != null && costNameCbx.Items.Count > 0) { KeyValuePair <string, string> lastCostCenter = (KeyValuePair <string, string>)costNameCbx.Items[costNameCbx.Items.Count - 1]; if (lastCostCenter.Key != data["cost_center"].ToString()) { costNameCbx.Items.Remove(costNameCbx.Items.Count - 1); costNameCbx.Items.Add(new KeyValuePair <string, string>(data["cost_center"].ToString(), data["cost_center_name"].ToString())); } } } RefreshInstrumentGrid(); if (isBCCSSet) { RefreshInstrumentSearchGrid(); } } }
/// <summary> /// 显示包、车列表信息 /// </summary> /// <param name="in_BCCdata"></param> private void showBCCdata(string in_BCCdata) { dgv_02.DataSource = null; dgv_02.DataSource = null; if (!string.IsNullOrEmpty(in_BCCdata)) { #region 显示手术包:器械清单、包清单 string str_bcx = in_BCCdata.Substring(0, 3); #region 处理替代条码 if (str_bcx == "BCU" && in_BCCdata.Length > 15) { //处理BUC拼装字符串中,找出BCC in_BCCdata = in_BCCdata.Substring(14); str_bcx = in_BCCdata.Substring(0, 3); } #endregion if (str_bcx == "BCC") { //rexxie需要开发显示每把实体器械。 CnasRemotCall reCnasRemotCall = new CnasRemotCall(); SortedList sttemp01 = new SortedList(); string instrumentSql = BarCodeHelper.IsSpecialSet(in_BCCdata) ? "HCS-workset-showlist-sec003" : "HCS-workset-showlist-sec002"; sttemp01.Add(1, in_BCCdata); //string aaa = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-workset-showlist-sec002", sttemp01); DataTable dtworktmp = reCnasRemotCall.RemotInterface.SelectData(instrumentSql, sttemp01); dgv_02.DataSource = dtworktmp; } else if (str_bcx == "BCD" || str_bcx == "BCW" || str_bcx == "BCZ") { CnasRemotCall reCnasRemotCall = new CnasRemotCall(); SortedList sttemp01 = new SortedList(); sttemp01.Add(1, PD_Code); sttemp01.Add(2, in_BCCdata); sttemp01.Add(3, 0); //string aaa = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-workset-showlist-sec001", sttemp01); DataTable dtworktmp = reCnasRemotCall.RemotInterface.SelectData("HCS-workset-showlist-sec001", sttemp01); dgv_02.DataSource = dtworktmp; } #endregion #region 显示手术包图片 SetPicData(in_BCCdata); #endregion } }
/// <summary> /// 加载grid数据 /// </summary> private void RefreshDataGrid() { CnasRemotCall RemoteClient = new CnasRemotCall(); bool isBCCS = BarCodeHelper.IsSpecialSet(setBarCodeTxt.Text); string sql = isBCCS ? "HCS-instrument-info-sec002" : "HCS-instrument-info-sec001"; SortedList condition = new SortedList(); condition.Add(1, CnasBaseData.SystemID); condition.Add(2, isBCCS ? setBarCodeTxt.Text : _packingSetBaseId.ToString()); string testSql = RemoteClient.RemotInterface.CheckSelectData(sql, condition); DataTable data = RemoteClient.RemotInterface.SelectData(sql, condition); if (data != null && data.Rows.Count > 0) { foreach (DataRow item in data.Rows) { GridViewRowInfo row = instrumentGrid.Rows.AddNew(); if (item["id"] != null) { row.Cells["idCol"].Value = item["id"]; } if (item["ca_name"] != null) { row.Cells["inNameCol"].Value = item["ca_name"]; } if (item["instrument_type"] != null) { row.Cells["inTypeCol"].Value = item["instrument_type"]; } if (item["instrument_num"] != null) { row.Cells["inNumCol"].Value = item["instrument_num"]; } if (item["costc_name"] != null) { row.Cells["costCNameCol"].Value = item["costc_name"]; } if (item["ca_price"] != null) { row.Cells["inPriceCol"].Value = item["ca_price"]; } } instrumentGrid.ClearSelection(); } }
private void OnSelectSetSelectionChanged(object sender, EventArgs e) { string selectValue = ((KeyValuePair <string, string>)cbbType.SelectedItem).Key; if (selectValue.Equals("1")) { if (dgv_Package.SelectedRows.Count == 1) { DataGridViewRow row = dgv_Package.SelectedRows[0]; string tempBarCode = Convert.ToString(row.Cells["pbar_code"].Value); string tempBarCodeId = Convert.ToString(row.Cells["pbase_set_id"].Value); if (!string.IsNullOrEmpty(tempBarCode) && !string.IsNullOrEmpty(tempBarCodeId)) { if (_tempBarCode != tempBarCode) { _tempBarCode = tempBarCode; int baseBarCodeId = 1; Int32.TryParse(tempBarCodeId, out baseBarCodeId); bool isBCCS = BarCodeHelper.IsSpecialSet(tempBarCode); string sql = isBCCS ? "HCS-instrument-info-sec002" : "HCS-instrument-info-sec001"; SortedList condition = new SortedList(); condition.Add(1, CnasBaseData.SystemID); //CnasBaseData.SystemID condition.Add(2, isBCCS ? tempBarCode : baseBarCodeId.ToString()); string testSql = RemoteClient.RemotInterface.CheckSelectData(sql, condition); DataTable getInstrumentdt = RemoteClient.RemotInterface.SelectData(sql, condition); if (getInstrumentdt != null) { _tempTableInstrument = getInstrumentdt; SetDataDgv_Instruments(getInstrumentdt); } else { MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("notfindInstrument", EnumPromptMessage.warning), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); } SetComboBoxReason(indgv_Instruments, "inireason"); } } } } }
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) { } }
public void RefreshInstrumentGrid() { instrumentGrid.Rows.Clear(); if (_workSpecialSet.ContainsKey(setBarCodeTxt.Text)) { foreach (DataRow item in _workSpecialSet[setBarCodeTxt.Text]) { int instrumentId = 0; if (item["id"] != null) { int.TryParse(item["id"].ToString(), out instrumentId); if (!_instrumentIds.ContainsKey(instrumentId)) { _instrumentIds.Add(instrumentId, item); } } GeneratorInstrumentRow(instrumentGrid, item); } } else { bool isBCCS = BarCodeHelper.IsSpecialSet(setBarCodeTxt.Text); //string sql = isBCCS ? "HCS-instrument-info-sec002" : "HCS-instrument-info-sec001"; string packingSetBaseId = string.Empty; if (setInfoPanel.Tag != null && setInfoPanel.Tag is DataRow) { DataRow setData = setDataGrid.SelectedRows[0].Tag as DataRow; if (setData["base_set_id"] != null) { packingSetBaseId = setData["base_set_id"].ToString(); } } SortedList condition = new SortedList(); condition.Add(1, CnasBaseData.SystemID); condition.Add(2, packingSetBaseId); string testSql = _remoteClient.RemotInterface.CheckSelectData("HCS-instrument-info-sec001", condition); DataTable data = _remoteClient.RemotInterface.SelectData("HCS-instrument-info-sec001", condition); if (data != null && data.Rows.Count > 0) { List <DataRow> inSpecialList = new List <DataRow>(); foreach (DataRow item in data.Rows) { int instrumentId = 0; if (item["id"] != null) { int.TryParse(item["id"].ToString(), out instrumentId); if (!_instrumentIds.ContainsKey(instrumentId)) { _instrumentIds.Add(instrumentId, item); } } GeneratorInstrumentRow(instrumentGrid, item); inSpecialList.Add(item); } if (isBCCS) { _workSpecialSet.Add(setBarCodeTxt.Text, inSpecialList); } } } }
/// <summary> /// 加载grid数据 /// </summary> private void RefreshDataGrid() { GetCountScanner(); bool isBCCS = BarCodeHelper.IsSpecialSet(setBarCodeTxt.Text); string sql = isBCCS ? "HCS-instrument-info-sec002" : "HCS-instrument-info-sec001"; CnasRemotCall remoteClient = new CnasRemotCall(); SortedList condition = new SortedList(); condition.Add(1, CnasBaseData.SystemID); condition.Add(2, _baseSetId.ToString()); string testSql = remoteClient.RemotInterface.CheckSelectData(sql, condition); DataTable _dgvDataTable = remoteClient.RemotInterface.SelectData(sql, condition); //if(PdCode=="3020") //{ // isPackagedCol.Visible = true; //} if (_isNewSet) { getNumCol.Visible = false; //getNumCol.DefaultCellStyle.ForeColor = Color.Red; needNumCol.DefaultCellStyle.ForeColor = Color.Red; } else { getNumCol.DefaultCellStyle.ForeColor = Color.Red; //needNumCol.DefaultCellStyle.ForeColor = Color.Red; } if (_dgvDataTable != null && _dgvDataTable.Rows.Count > 0) { foreach (DataRow item in _dgvDataTable.Rows) { int rowIndex = instrumentGrid.Rows.Add(); if (item["id"] != null) { instrumentGrid.Rows[rowIndex].Cells["idCol"].Value = item["id"]; } if (item["ca_name"] != null) { instrumentGrid.Rows[rowIndex].Cells["inNameCol"].Value = item["ca_name"]; } if (item["instrument_type"] != null) { instrumentGrid.Rows[rowIndex].Cells["inTypeCol"].Value = item["instrument_type"]; } if (item["instrument_num"] != null) { instrumentGrid.Rows[rowIndex].Cells["inNumCol"].Value = item["instrument_num"]; } if (item["costc_name"] != null) { instrumentGrid.Rows[rowIndex].Cells["costCNameCol"].Value = item["costc_name"]; } if (item["ca_price"] != null) { instrumentGrid.Rows[rowIndex].Cells["inPriceCol"].Value = item["ca_price"]; } if (_preDataTable != null) { string tempId = Convert.ToString(item["id"]); DataRow[] array = _preDataTable.Select("instrument_id='" + tempId + "'"); instrumentGrid.Rows[rowIndex].Cells["needNumCol"].Value = array == null?0:array.Length; } else { instrumentGrid.Rows[rowIndex].Cells["needNumCol"].Value = 0; } instrumentGrid.Rows[rowIndex].Cells["getNumCol"].Value = 0; } } }
public virtual void ReleaseSpecialSet() { DataGridView setDataGrid = CnasUtilityTools.FindControl <DataGridView>(this, "setDataGrid"); if (setDataGrid != null) { if (setDataGrid.SelectedRows != null && setDataGrid.SelectedRows.Count == 1) { if (setDataGrid.SelectedRows[0].Tag is DataRow) { DataRow rowData = setDataGrid.SelectedRows[0].Tag as DataRow; string setBarCode = rowData["bar_code"].ToString(); bool isBCCSSet = BarCodeHelper.IsSpecialSet(setBarCode); if (isBCCSSet) { string message = PromptMessageXmlHelper.Instance.GetPromptMessage("recyleset", EnumPromptMessage.warning, new string[] { setBarCode, rowData["ca_name"].ToString() }); SortedList condition = new SortedList(); condition.Add(1, CnasBaseData.SystemID); condition.Add(2, setBarCode); string testSql = RemoteClient.RemotInterface.CheckSelectData("HCS-instrument-info-sec002", condition); DataTable data = RemoteClient.RemotInterface.SelectData("HCS-instrument-info-sec002", condition); SortedList deleteData = new SortedList(); SortedList sqlParam = new SortedList(); SortedList input = new SortedList(); SortedList input01 = new SortedList(); input.Add(1, input01); sqlParam.Add(1, input); sqlParam.Add(2, deleteData); input01.Add(1, rowData["id"]); input01.Add(2, rowData["id"]); input01.Add(3, PdCode); if (data != null && data.Rows.Count > 0) { int index = 1; foreach (DataRow item in data.Rows) { SortedList deleteItem = new SortedList(); deleteData.Add(index, deleteItem); index++; if (item["ca_name"] != null && item["instrument_num"] != null) { message += string.Format("\r\n\t\t器械名称: {0},\t器械数量:{1}.", item["ca_name"].ToString(), item["instrument_num"].ToString()); } deleteItem.Add(1, rowData["ws_id"] != null ? rowData["ws_id"].ToString() : ""); deleteItem.Add(2, "9"); deleteItem.Add(3, item["wsin_id"]); } } if (MessageBox.Show(message, "信息提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK) { string testDeleteSql = RemoteClient.RemotInterface.CheckUPDataList("HCS-work-specialset-info-up002", sqlParam); int result = RemoteClient.RemotInterface.UPDataList("HCS-work-specialset-info-up002", sqlParam); if (result <= -1) { MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("failRecycleset", EnumPromptMessage.error), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { InitalizeControl(); if (setDataGrid.RowCount == 0) { if (setDataGrid.RowCount == 0) { if (this.ParentForm is HCSWF_dialog_container) { (ParentForm as HCSWF_dialog_container).DialogResultStatus = 3; } ParentForm.Close(); } } } } } else { MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("selectspecialset", EnumPromptMessage.warning), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } else { MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("selectset", EnumPromptMessage.warning), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("notfindSetGrid", EnumPromptMessage.error), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }