public string str_sumover = "";//状态 private void bt_find_Click(object sender, EventArgs e) { if (dtp_begin.Value > dtp_end.Value) { MessageBox.Show("开始日期不能大于结束日期!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.ActiveControl = dtp_begin; return; } string str_xsfs = "0"; if (cmb_xsfs.Text == "个人体检") { txt_tjdw.Tag = ""; txt_tjdw.Text = ""; str_xsfs = "1"; } if (cmb_xsfs.Text == "单位体检") { if (txt_tjdw.Tag.ToString().Trim() == "") { MessageBox.Show("请选择体检单位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.ActiveControl = bt_tjdw; return; } str_xsfs = "2"; } string str_dwbh = ""; if (txt_tjdw.Tag.ToString().Trim() != "") { str_dwbh = txt_tjdw.Tag.ToString().Trim().Substring(0, 4); } string str_bmbh = txt_tjdw.Tag.ToString().Trim(); if (str_bmbh.Length == 4) { str_bmbh = ""; } //string cmb_KS = cmb_ks1.SelectedValue.ToString();//科室 System.Data.DataRowView dv = (System.Data.DataRowView)cmb_ks1.SelectedValue; string cmb_KS = ""; if (dv != null) { cmb_KS = dv.Row[1].ToString(); } //string cmb_KS = cmb_ks1.SelectedItem.ToString();//科室 dgv_tjdjb.DataSource = tjglbiz.Get_TJ_TJDJB(dtp_begin.Value.ToString("yyyy-MM-dd"), dtp_end.Value.ToString("yyyy-MM-dd"), txt_xm.Text.Trim(), str_dwbh, str_bmbh, str_xsfs, cmb_KS); ChargeColor(); }
void BindData() { cmb_xb.DataSource = xtbiz.GetXtZd(1);//性别 cmb_xb.DisplayMember = "xmmc"; cmb_xb.ValueMember = "bzdm"; cmb_xb.SelectedIndex = -1; cmb_mz.DataSource = xtbiz.GetXtZd(2);//民族 cmb_mz.DisplayMember = "xmmc"; cmb_mz.ValueMember = "bzdm"; cmb_mz.SelectedIndex = -1; DataTable dt = tjdjbiz.Get_TJ_TJDJB(str_tjbh, str_tjcs); if (dt.Rows.Count < 1) { return; } str_djlsh = dt.Rows[0]["djlsh"].ToString().Trim(); txt_xm.Text = dt.Rows[0]["xm"].ToString().Trim(); cmb_xb.SelectedValue = dt.Rows[0]["xb"].ToString().Trim(); txt_nl.Text = dt.Rows[0]["nl"].ToString().Trim(); cmb_mz.SelectedValue = dt.Rows[0]["mz"].ToString().Trim(); txt_mobile.Text = dt.Rows[0]["mobile"].ToString().Trim(); txt_sfzh.Text = dt.Rows[0]["sfzh"].ToString().Trim(); }
private void btnNext_Click(object sender, EventArgs e) { if (str_tjrq == "") { return; } string str_djlsh = txt_djlsh.Text.Trim(); if (str_djlsh == "") { return; } DataTable dt = djBiz.Get_TJ_TJDJB(str_tjrq); int index = 0; int count = dt.Rows.Count; if (count < 1) { return; } for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["djlsh"].ToString().Trim() == str_djlsh) { index = i; break; } } if (index == count - 1) { MessageBox.Show("已到当前日期最后一条记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { index = index + 1; } str_tjbh = dt.Rows[index]["tjbh"].ToString().Trim(); str_tjcs = dt.Rows[index]["tjcs"].ToString().Trim(); str_sumover = dt.Rows[index]["sumover"].ToString().Trim(); TJDJB_DataBind(str_tjbh, str_tjcs); TJJLB_WJ_DataBind(str_tjbh, str_tjcs); }
private void bt_select_Click(object sender, EventArgs e) { //Form_printWaiting frm = new Form_printWaiting(); //frm.Show(); //return; if (dtp_begin.Value > dtp_end.Value) { MessageBox.Show("开始日期不能大于结束日期!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.ActiveControl = dtp_begin; return; } if (txt_tjdw.Text == "") { txt_tjdw.Tag = ""; } string str_dwbh = ""; if (txt_tjdw.Tag.ToString().Trim() != "") { str_dwbh = txt_tjdw.Tag.ToString().Trim().Substring(0, 4); } string str_bmbh = txt_tjdw.Tag.ToString().Trim(); if (str_bmbh.Length == 4) { str_bmbh = ""; } string str_xb = "%"; if (!object.Equals(null, cmb_xb.SelectedValue)) { str_xb = cmb_xb.SelectedValue.ToString().Trim(); } string str_zjzt = "0"; if (cmb_zjzt.Text == "已总检") { str_zjzt = "2"; } else if (cmb_zjzt.Text == "未总检") { str_zjzt = "1"; } else//全部 { str_zjzt = "0"; } dgv_tjdjb.DataSource = tjdjbiz.Get_TJ_TJDJB(dtp_begin.Value.ToString("yyyy-MM-dd"), dtp_end.Value.ToString("yyyy-MM-dd"), txt_tjbh1.Text.Trim(), txt_tjbh2.Text.Trim(), txt_xm.Text.Trim(), str_xb, str_dwbh, str_bmbh, str_zjzt); ChargeColor(); }
void LoadDefault() { //默认折扣类型:1金额,2比例 string str_mrzklx = xtbiz.GetXtCsz("mrzklx"); if (str_mrzklx == "1") { rbt_je.Checked = true; } if (str_mrzklx == "2") { rbt_bl.Checked = true; } //默认收费日期:登录日期 int mrsfrq = Convert.ToInt16(xtbiz.GetXtCsz("mrsfrq")); if (Convert.ToInt16(mrsfrq) >= 0) //正值 { dtp_tjrq.Value = xtbiz.GetServerDate(); } else //负值 { dtp_tjrq.Value = xtbiz.GetServerDate().AddDays(mrsfrq); } //办证收费金额默认:1-不可修改,0-可以修改 string str_bzjems = xtbiz.GetXtCsz("bzsfjems"); if (str_bzjems == "1") { txt_bzsfje.ReadOnly = true; } if (str_bzjems == "0") { txt_bzsfje.ReadOnly = false; } dgv_tjdjb.DataSource = tjdjbiz.Get_TJ_TJDJB(dtp_tjrq.Value.ToString("yyyy-MM-dd"), txt_dah.Text.Trim(), txt_xm.Text.Trim(), "0", ""); }
void TJDJB_DataBind(string tjbh, string tjcs) { DataTable dt = tjdjbiz.Get_TJ_TJDJB(str_tjbh, str_tjcs); if (dt.Rows.Count < 1) { return; } if (dt.Rows[0]["tjlb"].ToString().Trim() != "05")//不是中医体检 { MessageBox.Show("该人员体检类型有误,请检查!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); str_tjbh = ""; str_tjcs = ""; return; } txt_xm.Text = dt.Rows[0]["xm"].ToString().Trim(); str_sumover = dt.Rows[0]["sumover"].ToString().Trim(); txt_nl.Text = dt.Rows[0]["nl"].ToString().Trim(); cmb_xb.SelectedValue = dt.Rows[0]["xb"].ToString().Trim(); txt_djlsh.Text = dt.Rows[0]["djlsh"].ToString().Trim(); str_tjlb = dt.Rows[0]["tjlb"].ToString().Trim(); }
private void bt_read_Click(object sender, EventArgs e) { if (txt_dw.Text.Trim() == "") { MessageBox.Show("请选择体检单位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.ActiveControl = bt_dw; return; } if (dtp_begin.Value > dtp_end.Value) { MessageBox.Show("开始日期不能大于结束日期!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.ActiveControl = dtp_begin; return; } string str_dwbh = txt_dw.Tag.ToString().Trim().Substring(0, 4); string str_bmbh = txt_dw.Tag.ToString(); if (str_bmbh.Length == 4) { str_bmbh = ""; } dt_excel = tjglbiz.Get_TJ_TJDJB(dtp_begin.Value.ToString("yyyy-MM-dd"), dtp_end.Value.ToString("yyyy-MM-dd"), str_dwbh, str_bmbh); dgv_excel.DataSource = dt_excel; cmb_coloum.SelectedIndexChanged -= new EventHandler(cmb_coloum_SelectedIndexChanged); cmb_coloum.Items.Clear(); foreach (DataGridViewColumn dgc in dgv_excel.Columns) { cmb_coloum.Items.Add(dgc.HeaderText); } cmb_coloum.Items.Remove("选"); cmb_coloum.SelectedIndexChanged += new EventHandler(cmb_coloum_SelectedIndexChanged); txt_tjdw.Text = ""; txt_tjdw.Tag = ""; }