/// <summary> /// 颜色 /// </summary> private void ColorS() { //去掉默认选中 //if (Dgv_Info.Rows.Count>0) if (Dgv_Info.SelectedRows.Count > 0) { Dgv_Info.Rows[0].Selected = false; } string groupno = ""; //用来隔开每个处方。每组处方加1,奇数组处方是一个颜色,偶数组处方是另一个颜色 int Count = 0; //取颜色 DataSet ChangeColords = DB.GetPIVAsDB(select.IVRecordSetUp(pvb.DEmployeeID)); for (int i = 0; i < Dgv_Info.Rows.Count; i++) { if (ChangeColords.Tables[0].Rows[0]["DrugColor1"] != null && ChangeColords.Tables[0].Rows[0]["DrugColor1"].ToString().Trim().Length != 0) { Dgv_Info.Rows[i].DefaultCellStyle.BackColor = System.Drawing.ColorTranslator.FromHtml(ChangeColords.Tables[0].Rows[0]["DrugColor1"].ToString()); Dgv_Info.Rows[i].HeaderCell.Style.BackColor = System.Drawing.ColorTranslator.FromHtml(ChangeColords.Tables[0].Rows[0]["DrugColor1"].ToString()); //Dgv_Info.DefaultCellStyle.SelectionBackColor = Color.Purple; } if (Dgv_Info.Rows[i].Cells["colGroupNo"].Value.ToString().CompareTo(groupno) != 0 || i == 0) { groupno = Dgv_Info.Rows[i].Cells["colGroupNo"].Value.ToString(); Count++; } if (Count % 2 != 0) { if (ChangeColords.Tables[0].Rows[0]["DrugColor2"] != null && ChangeColords.Tables[0].Rows[0]["DrugColor2"].ToString().Trim().Length != 0) { Dgv_Info.Rows[i].DefaultCellStyle.BackColor = System.Drawing.ColorTranslator.FromHtml(ChangeColords.Tables[0].Rows[0]["DrugColor2"].ToString()); Dgv_Info.Rows[i].HeaderCell.Style.BackColor = System.Drawing.ColorTranslator.FromHtml(ChangeColords.Tables[0].Rows[0]["DrugColor2"].ToString()); // Dgv_Info.DefaultCellStyle.SelectionBackColor = Color.Red; } groupno = Dgv_Info.Rows[i].Cells["colGroupNo"].Value.ToString(); } if (Dgv_Info.Rows[i].Cells["colGroupNo"].Value.ToString().CompareTo(Groupno) == 0) { if (!isSelect) { isSelect = true; }//==Select if (ChangeColords.Tables[0].Rows[0]["SelectionColor2"] != null && ChangeColords.Tables[0].Rows[0]["SelectionColor2"].ToString().Trim().Length != 0) { Dgv_Info.Rows[i].DefaultCellStyle.BackColor = System.Drawing.ColorTranslator.FromHtml(ChangeColords.Tables[0].Rows[0]["SelectionColor2"].ToString()); Dgv_Info.Rows[i].DefaultCellStyle.SelectionBackColor = System.Drawing.ColorTranslator.FromHtml(ChangeColords.Tables[0].Rows[0]["SelectionColor2"].ToString()); Dgv_Info.Rows[i].HeaderCell.Style.BackColor = System.Drawing.ColorTranslator.FromHtml(ChangeColords.Tables[0].Rows[0]["SelectionColor2"].ToString()); } Dgv_Info.Rows[i].Selected = isSelect; if (isSelect == true) { this.Dgv_Info.FirstDisplayedScrollingRowIndex = i; } } } }
/// <summary> /// 显示病人列表 /// </summary> public void ShowData() { ChangeColords = db.GetPIVAsDB(select.IVRecordSetUp(ECode)); if (Dgv_Patient.Rows.Count > 0) { Dgv_Patient.Rows[0].Selected = true; if (batch.Panel_Patient.Visible == true) { batch.Panel_Patient.AutoScroll = false; } NewMethod(); SelectedInfo(); } else { foreach (Control c in batch.Panel_BatchRule.Controls) { c.Dispose(); } GC.Collect(); } }
/// <summary> /// 浏览设置 /// </summary> private void DataShow() { DataSet ds = db.GetPIVAsDB(select.IVRecordSetUp(Uid)); if (ds.Tables[0].Rows.Count > 0) { //显示模式 Comb_PreviewMode.SelectedIndex = int.Parse(ds.Tables[0].Rows[0]["PreviewMode"].ToString()) == 3 ? 1 : int.Parse(ds.Tables[0].Rows[0]["PreviewMode"].ToString()); //显示排序条件 Comb_LabelOrderBy.SelectedIndex = int.Parse(ds.Tables[0].Rows[0]["LabelOrderBy"].ToString()); //有数据病区 if (int.Parse(ds.Tables[0].Rows[0]["WardIdle"].ToString()) == 0) { Check_WardIdle.Checked = true; } else { Check_WardIdle.Checked = false; } //开放病区 if (int.Parse(ds.Tables[0].Rows[0]["WardOpen"].ToString()) == 0) { Check_WardOpen.Checked = true; } else { Check_WardOpen.Checked = false; } //进入批次时生成瓶签 if (int.Parse(ds.Tables[0].Rows[0]["AutoGetOrder"].ToString()) == 0) { Check_AutoGetOrder.Checked = false; } else { Check_AutoGetOrder.Checked = true; } //停留在此画面不操作 if (ds.Tables[0].Rows[0]["TimeCount"] != null && ds.Tables[0].Rows[0]["TimeCount"].ToString().Trim().Length != 0) { Com_TimeCount.Text = ds.Tables[0].Rows[0]["TimeCount"].ToString().Trim(); } else { Com_TimeCount.SelectedIndex = 0; } //不计算空包 if (int.Parse(ds.Tables[0].Rows[0]["IsPack"].ToString()) == 0) { Check_Nothing.Checked = true; } else { Check_Nothing.Checked = false; } //时间点,在这个时间点后显示第二天数据 if (ds.Tables[0].Rows[0]["NextDay"] != null && ds.Tables[0].Rows[0]["NextDay"].ToString().Trim().Length != 0) { string[] time = ds.Tables[0].Rows[0]["NextDay"].ToString().Split(','); Cob_Hour.Text = time[0]; Cob_Month.Text = time[1]; } else { Cob_Hour.SelectedText = "18"; Cob_Month.SelectedText = "00"; } if (ds.Tables[0].Columns.Contains("Refresh")) { if (ds.Tables[0].Rows[0]["Refresh"].ToString() == "1") { check_refresh.Checked = true; } } else { MessageBox.Show("请在数据库里增加Refresh字段"); } } else { db.SetPIVAsDB(inert.OrderFormSet(Uid)); Comb_PreviewMode.SelectedItem = 0; Check_WardIdle.Checked = true; Check_WardOpen.Checked = true; } string dossage = db.IniReadValuePivas("PivasBatch", "AllDrugDossage"); if (string.IsNullOrEmpty(dossage) || dossage == "0") { checkBox1.Checked = false; } else { checkBox1.Checked = true; } ds.Dispose(); }