/// <summary> /// 복사 신청서 인쇄 - 굽기 화면에서 호출 /// </summary> /// <param name="PatientID"></param> /// <param name="PatientName"></param> /// <param name="StudyDesc"></param> public void PrintCopyRequestForm(string PatientID, string PatientName, string StudyDesc) { try { if (!StudyDesc.EndsWith("^^")) { StudyDesc += "^^"; } string[] arrStudy = Utils.SplitByString(StudyDesc, "^^"); ArrayList _listDataSource = new ArrayList(); string sDate = string.Empty; string sCont = string.Empty; string yyyy = string.Empty; string mm = string.Empty; string dd = string.Empty; int cnt = 0; PatientInfo pInfo = null; foreach (string study in arrStudy) { if (!string.IsNullOrWhiteSpace(study)) { cnt++; sDate = study.Substring(0, study.IndexOf(':')); sCont = study.Substring(study.IndexOf(':') + 2); if (sDate.Length > 7) { yyyy = sDate.Substring(0, 4); mm = sDate.Substring(4, 2); dd = sDate.Substring(6, 2); sDate = string.Format("{0}-{1}-{2}", yyyy, mm, dd); } if (cnt % 2 != 0) { pInfo = new PatientInfo(sDate, sCont); _listDataSource.Add(pInfo); } else { int indx = (cnt / 2) - 1; ((PatientInfo)_listDataSource[indx]).StudyDate2 = sDate; ((PatientInfo)_listDataSource[indx]).StudyDesc2 = sCont; } } } if (_listDataSource.Count > 0) { this.PrintDirect(PatientID, PatientName, _listDataSource, cnt); } } catch { } }
/// <summary> /// 신청서 인쇄 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnApplicationPrint_Click(object sender, EventArgs e) { if (this.xTabReport.SelectedTabPage == this.xPageResultSearch) { if (this.gridView1.SelectedRowsCount < 1) { MessageBox.Show("인쇄할 환자를 선택하세요.", "Rimage Message", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (this.gridView1.GetFocusedRow() != null) { try { string regID = this.gridView1.GetFocusedRowCellValue("PatientID").ToString(); string patName = this.gridView1.GetFocusedRowCellValue("PatientName").ToString(); long? rowid = this.gridView1.GetFocusedRowCellValue("rowid") as long?; int rowHandle = this.gridView1.FocusedRowHandle; this.gridView1.ExpandMasterRow(rowHandle); GridView view = this.gridView1.GetDetailView(rowHandle, 0) as GridView; DataView dv = view.DataSource as DataView; DataTable dt = dv.Table; DataRow[] rows = dt.Select("rowid = " + rowid.Value.ToString()); //dtD.Columns.Add("rowid", typeof(long)); //dtD.Columns.Add("StartDateTime", typeof(string)); ArrayList _listDataSource = new ArrayList(); int cnt = 0; PatientInfo pInfo = null; foreach (DataRow dr in rows) { cnt++; string studyDate = dr["StudyDate"].ToString(); //string yyyy = string.Empty; //string mm = string.Empty; //string dd = string.Empty; //if (studyDate.Length > 7) //{ // yyyy = studyDate.Substring(0, 4); // mm = studyDate.Substring(4, 2); // dd = studyDate.Substring(6, 2); // studyDate = string.Format("{0}-{1}-{2}", yyyy, mm, dd); //} if (cnt % 2 != 0) { pInfo = new PatientInfo(studyDate, dr["StudyDescription"].ToString()); _listDataSource.Add(pInfo); } else { int indx = (cnt / 2) - 1; ((PatientInfo)_listDataSource[indx]).StudyDate2 = studyDate; ((PatientInfo)_listDataSource[indx]).StudyDesc2 = dr["StudyDescription"].ToString(); } } this.PrintReport(regID, patName, _listDataSource, cnt); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }