private void tbYBH_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { lbDataReading.Visible = true; PMS.Model.MedicarePerson mp = new PMS.Model.MedicarePerson(); mp = bllMedicarePerson.GetMedicarePerson(tbYBH.Text); if (mp.Name == "") { lbBXPersonName.Text = "数据库中无此人"; this.Text = "数据库中无此人"; } else { lbBXPersonName.Text = mp.Name; this.Text = "医保号:" + tbYBH.Text + " 姓名:" + mp.Name; } lbMedicareId.Text = mp.MedicareId; lbJobNumber.Text = mp.JobNumber; lbIdentityCard.Text = mp.IdentityCard; lbBirthday.Text = mp.Birthday.ToShortDateString(); lbOrganization.Text = mp.Organization; lbSex.Text = mp.Sex; lbPsnType.Text = mp.PsnType; lbDataReading.Visible = false; pnlPersonInfo.Visible = true; splitContainer1.Panel2Collapsed = false; btnGetInvoice.Focus(); } }
public void ShowInfo(string medicareId) { PMS.Model.MedicarePerson mp = new PMS.Model.MedicarePerson(); mp = bll_MedicarePerson.GetMedicarePerson(medicareId); if (mp.Name == "") { tablePersonInfo.Visible = false; message.Visible = true; ltlBXPersonName.Text = "数据库中无此人"; ltlMedicareId.Text = string.Empty; ltlJobNumber.Text = string.Empty; ltlIdentityCard.Text = string.Empty; ltlBirthday.Text = string.Empty; ltlOrganization.Text = string.Empty; ltlSex.Text = string.Empty; ltlPsnType.Text = string.Empty; ltlBankAccount.Text = string.Empty; } else { tablePersonInfo.Visible = true; message.Visible = false; ltlBXPersonName.Text = mp.Name; ltlMedicareId.Text = mp.MedicareId; ltlJobNumber.Text = mp.JobNumber; ltlIdentityCard.Text = mp.IdentityCard; ltlBirthday.Text = mp.Birthday.ToShortDateString(); ltlOrganization.Text = mp.Organization; ltlSex.Text = mp.Sex; ltlPsnType.Text = mp.PsnType; string strBA = mp.BankAccount; System.Text.StringBuilder sb = new System.Text.StringBuilder(); for (int i = 0; i < strBA.Length; i++) { if (i % 4 == 0) { sb.Append(" "); } sb.Append(strBA[i]); } ltlBankAccount.Text = sb.ToString(); } }
private void btnQuery_Click(object sender, EventArgs e) { PMS.Model.MedicarePerson mp = new PMS.Model.MedicarePerson(); mp = bll_MedicarePerson.GetMedicarePerson(tbYBH.Text); if (mp.Name == "") { lbBXPersonName.Text = "数据库中无此人"; lbMedicareId.Text = string.Empty; lbJobNumber.Text = string.Empty; lbIdentityCard.Text = string.Empty; lbBirthday.Text = string.Empty; lbOrganization.Text = string.Empty; lbSex.Text = string.Empty; lbPsnType.Text = string.Empty; lbBankAccount.Text = string.Empty; } else { this.Text = "医保号:" + tbYBH.Text + " 姓名:" + mp.Name; lbBXPersonName.Text = mp.Name; lbMedicareId.Text = mp.MedicareId; lbJobNumber.Text = mp.JobNumber; lbIdentityCard.Text = mp.IdentityCard; lbBirthday.Text = mp.Birthday.ToShortDateString(); lbOrganization.Text = mp.Organization; lbSex.Text = mp.Sex; lbPsnType.Text = mp.PsnType; string strBA = mp.BankAccount; System.Text.StringBuilder sb = new StringBuilder(); for (int i = 0; i < strBA.Length; i++) { if (i % 4 == 0) { sb.Append(" "); } sb.Append(strBA[i]); } lbBankAccount.Text = sb.ToString(); } }
public void ActiveTabIndividualQuery(string ybh) { string tabPageText = string.Empty; if (!string.IsNullOrEmpty(ybh)) { PMS.BLL.MedicarePerson bll_person = new PMS.BLL.MedicarePerson(); PMS.Model.MedicarePerson person = bll_person.GetMedicarePerson(ybh); tabPageText = person.Name + ybh; } else { tabPageText = "个人报销记录查询"; } bool hasYbh = false; foreach (TabPage tabPage in tabWorkSpace.TabPages) { if (tabPage.Text == tabPageText) { tabWorkSpace.SelectedTab = tabPage; hasYbh = true; } } if (hasYbh == false) { TabPage tabPage = new TabPage(tabPageText); UC.IndividualQuery iq = new UC.IndividualQuery(); iq.SetYbh(this.ybh); tabPage.Controls.Clear(); tabPage.Controls.Add(iq as Control); tabPage.ToolTipText = "双击可关闭选项卡"; iq.Dock = DockStyle.Fill; tabWorkSpace.TabPages.Add(tabPage); tabWorkSpace.SelectedTab = tabPage; } }
private void QueryPersonInfo() { PMS.Model.MedicarePerson mp = new PMS.Model.MedicarePerson(); mp = bllMedicarePerson.GetMedicarePerson(tbYBH.Text); if (mp.Name == "") { lbBXPersonName.Text = "数据库中无此人"; } else { lbBXPersonName.Text = mp.Name; } lbMedicareId.Text = mp.MedicareId; lbJobNumber.Text = mp.JobNumber; lbIdentityCard.Text = mp.IdentityCard; lbBirthday.Text = mp.Birthday.ToShortDateString(); lbOrganization.Text = mp.Organization; lbSex.Text = mp.Sex; lbPsnType.Text = mp.PsnType; pnlPersonInfo.Visible = true; }
void BxMain_YbhChanged(object sender, EventArgs e) { lbYbh.Text = this.ybh; PMS.Model.MedicarePerson mPerson = bll_mPerson.GetMedicarePerson(this.ybh); lbBxrName.Text = mPerson.Name; }
private void btnExportExcel_Click(object sender, EventArgs e) { if (gvPaymentList.Rows.Count > 0) { beginDate = dtpBeginDate.Value.Date; endDate = dtpEndDate.Value.AddDays(1).Date; IList <MRS.Model.AccountBook> accountBooks = new List <MRS.Model.AccountBook>(); accountBooks = bllAccountBook.Select_AccountBook_PaymentList(beginDate, endDate); System.Text.StringBuilder fileName = new StringBuilder(); fileName.Append("医保报销帐单 "); fileName.Append(DateTime.Now.Year.ToString()); fileName.Append(DateTime.Now.Month.ToString().PadLeft(2, '0')); fileName.Append(DateTime.Now.Day.ToString().PadLeft(2, '0')); fileName.Append(".xls"); XlsDocument xlsDoc = new XlsDocument(); xlsDoc.FileName = fileName.ToString(); //定义Excel文档属性. xlsDoc.SummaryInformation.Author = "Cobe lee"; xlsDoc.SummaryInformation.Title = "医保报销帐单"; xlsDoc.SummaryInformation.Comments = "This workbook generated by ZPITC! http://www.tiyi.biz"; xlsDoc.SummaryInformation.Subject = "医保报销帐单"; xlsDoc.DocumentSummaryInformation.Company = "镇海石化工业贸易有限责任公司"; Worksheet sheet = xlsDoc.Workbook.Worksheets.Add("Sheet1"); xlsDoc.Workbook.Worksheets.Add("Sheet2"); xlsDoc.Workbook.Worksheets.Add("Sheet3"); Cells cells = sheet.Cells; //以下定义 银行帐号 及 身份证号 的列宽. ColumnInfo col0 = new ColumnInfo(xlsDoc, sheet); col0.ColumnIndexEnd = 0; col0.ColumnIndexStart = 0; col0.Width = 21 * 269; sheet.AddColumnInfo(col0); ColumnInfo col3 = new ColumnInfo(xlsDoc, sheet); col3.ColumnIndexEnd = 3; col3.ColumnIndexStart = 3; col3.Width = 21 * 269; sheet.AddColumnInfo(col3); //以下定义文档标题 副标题 int rint = 1; cells.Merge(rint, rint, 1, 5); Cell cell = cells.Add(rint, 1, "医保报销帐单"); cell.Font.Height = 16 * 20; cell.HorizontalAlignment = HorizontalAlignments.Centered; rint++; cells.Merge(rint, rint, 1, 5); Cell cell2 = cells.Add(rint, 1, "( " + beginDate.ToShortDateString() + "至" + dtpEndDate.Value.ToShortDateString() + " )"); cell2.Font.Height = 12 * 20; cell2.Font.FontName = "宋体"; cell2.HorizontalAlignment = HorizontalAlignments.Centered; rint++; FormatHead(cells.Add(rint, 1, "银行帐号")); FormatHead(cells.Add(rint, 2, "金额")); FormatHead(cells.Add(rint, 3, "姓名")); FormatHead(cells.Add(rint, 4, "身份证号")); FormatHead(cells.Add(rint, 5, "备注")); foreach (MRS.Model.AccountBook account in accountBooks) { rint++; PMS.BLL.MedicarePerson bll_mp = new PMS.BLL.MedicarePerson(); string bankAccount = bll_mp.GetMedicarePerson(account.YBH).BankAccount; if (bankAccount != null) { FormatCellNumber(cells.Add(rint, 1, bankAccount)); FormatCellAmount(cells.Add(rint, 2, Convert.ToDouble(account.BXJE))); FormatCellName(cells.Add(rint, 3, account.Name)); FormatCellNumber(cells.Add(rint, 4, account.IdentityCard)); FormatCellName(cells.Add(rint, 5, "报销")); } } rint++; FormatCellButtom(cells.Add(rint, 1, "")); FormatCellButtom(cells.Add(rint, 2, "")); FormatCellButtom(cells.Add(rint, 3, "")); FormatCellButtom(cells.Add(rint, 4, "")); FormatCellButtom(cells.Add(rint, 5, "")); saveFileDialog1.DefaultExt = "xls"; saveFileDialog1.FileName = fileName.ToString(); saveFileDialog1.Filter = "Excel 97-2003 工作簿(*.xls)|*.xls"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { string path = System.IO.Path.GetDirectoryName(saveFileDialog1.FileName); try { xlsDoc.Save(path, true); } catch { MessageBox.Show("文件 \"" + System.IO.Path.GetFileName(saveFileDialog1.FileName) + "\" 正被其它程序打开,\n请关闭该文件,并重试!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } else { MessageBox.Show("无医保报销帐单!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }