private void GetData() { try { try { ParameterEx[] parameters = new ParameterEx[5]; parameters[0].Text = "@sourceType"; parameters[0].Value = cmbSource.SelectedIndex; parameters[1].Text = "@ksType"; int j = 0; if (cmbGroup.SelectedIndex == 2) { j = 0; } else if (cmbGroup.SelectedIndex < 2) { j = cmbGroup.SelectedIndex + 1; } else { j = cmbGroup.SelectedIndex; } parameters[1].Value = j.ToString(); parameters[2].Text = "@rq1"; parameters[2].Value = dtpBjksj.Value.ToString(); parameters[3].Text = "@rq2"; parameters[3].Value = dtpEjksj.Value.ToString(); parameters[4].Text = "@deptID"; parameters[4].Value = this._deptID; DataSet dset = new DataSet(); TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("report_BusinessIncomeReport", parameters, dset, "sfmx", 30); Fun.AddRowtNo(dset.Tables[0]); this.dataGridView1.Columns.Clear(); this.dataGridView1.DataSource = dset.Tables[0]; for (int i = 0; i < this.dataGridView1.Columns.Count; i++) { this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable; } } catch (System.Exception err)//如果没有8个参数,那么就条用7个的 { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void butref_Click(object sender, System.EventArgs e) { try { if (chkghdw.Checked == false && chkdjh.Checked == false && chkdjsj.Checked == false && rdo2.Checked == true) { MessageBox.Show("查询的记录范围太大,请重新选择查询条件"); return; } if (txtghdw.Text.Trim() == "" && txtghdw.Enabled == true) { MessageBox.Show("请输入药房名称"); return; } if (txtdjh.Text.Trim() == "" && txtdjh.Enabled == true) { MessageBox.Show("请输入单据号"); return; } ParameterEx[] parameters = new ParameterEx[11]; parameters[0].Value = _menuTag.FunctionTag.Trim(); parameters[1].Value = this.chkghdw.Checked == true?Convert.ToInt32(this.txtghdw.Tag) : 0; parameters[2].Value = chkdjsj.Checked == true?dtp1.Value.ToShortDateString() : ""; parameters[3].Value = chkdjsj.Checked == true?dtp2.Value.ToShortDateString() : ""; parameters[4].Value = chkdjh.Checked == true?Convert.ToInt64(Convertor.IsNull(txtdjh.Text, "0")) : 0; parameters[5].Value = ""; parameters[6].Value = ""; parameters[7].Value = this.rdo1.Checked == true?0:1; parameters[8].Value = Convert.ToInt32(Convertor.IsNull(cmbck.SelectedValue, "0")); parameters[9].Value = _menuTag.Function_Name.Trim(); parameters[10].Value = InstanceForm.BCurrentDept.DeptId; parameters[0].Text = "@ywlx"; parameters[1].Text = "@wldw"; parameters[2].Text = "@dtp1"; parameters[3].Text = "@dtp2"; parameters[4].Text = "@djh"; parameters[5].Text = "@fph"; parameters[6].Text = "@shdh"; parameters[7].Text = "@shbz"; parameters[8].Text = "@deptid"; parameters[9].Text = "@functionname"; parameters[10].Text = "@p_deptid"; DataTable tb = InstanceForm.BDatabase.GetDataTable("sp_yk_selectDj", parameters, 30); FunBase.AddRowtNo(tb); tb.TableName = "Tb"; this.myDataGrid1.DataSource = tb; FunBase.myGridSelect(this.myDataGrid1, this.myDataGrid1.TableStyles[0].GridColumnStyles); } catch (System.Exception err) { MessageBox.Show(err.ToString()); } }
private void buttj_Click(object sender, EventArgs e) { try { Cursor = PubStaticFun.WaitCursor(); ParameterEx[] parameters = new ParameterEx[9]; parameters[0].Text = "@TJFS"; parameters[0].Value = rbJkrq.Checked ? 0 : 1; parameters[1].Text = "@rq1"; parameters[1].Value = dtp1.Value.ToString(); parameters[2].Text = "@rq2"; parameters[2].Value = dtp2.Value.ToString(); parameters[3].Text = "@jky"; parameters[3].Value = Convert.ToInt32(Convertor.IsNull(cmbuser.SelectedValue, "0")); parameters[4].Text = "@KS"; parameters[4].Value = Convert.ToInt32(Convertor.IsNull(cmbDept.SelectedValue, "0")); int zffs = Convert.ToInt32(cmbZffs.SelectedValue); parameters[5].Text = "@ZFFS"; parameters[5].Value = zffs; //Modify By Kevin 2014-03-11 //Begin parameters[6].Text = "@SBILLNO"; parameters[6].Value = txtSBillNo.Text.Trim(); parameters[7].Text = "@EBILLNO"; parameters[7].Value = txtEBillNo.Text.Trim(); //End //Modify By Tany 2011-12-06 增加机构编码过滤 parameters[8].Text = "@JGBM"; parameters[8].Value = FrmMdiMain.Jgbm; DataTable tb = InstanceForm.BDatabase.GetDataTable("SP_ZY_TJ_YJJTJ", parameters, 120); AddRowtNo(tb); if (tb.Rows.Count > 0) { tb.Rows[tb.Rows.Count - 1]["序号"] = "合计"; } this.dataGridView1.DataSource = tb; } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { Cursor = Cursors.Default; } }
private void dataGridView2_MouseDoubleClick(object sender, MouseEventArgs e) { this.Cursor = PubStaticFun.WaitCursor(); try { string inpatient_id = ((DataTable)this.dataGridView2.DataSource).Rows[this.dataGridView2.CurrentCell.RowIndex]["inpatient_id"].ToString(); string baby_id = ((DataTable)this.dataGridView2.DataSource).Rows[this.dataGridView2.CurrentCell.RowIndex]["baby_id"].ToString(); //获得费用 string ss = "select cast( row_number() over(order by a.xmid ) as varchar) xh,ITEM_NAME zfxmmc,sum(NUM) sl,min(COST_PRICE) dj, isnull(b.ZFBL,1) zfbl,isnull(b.ZFBL,1)*sum(SDVALUE) zfje " + ",'' jsqm,c.name bz1,(select config from jc_config where id=2) bz2,CUR_DEPT_NAME bz3,ryzd bz4,'' bz5,'' bz6,'' bz7 " + " from ZY_FEE_SPECI a left join JC_YB_BL b on a.XMID=b.XMID and a.XMLY=b.XMLY " + " left join vi_zy_vinpatient_all c on a.inpatient_id=c.inpatient_id and a.baby_id=c.baby_id " + " where a.CHARGE_BIT=1 and a.DELETE_BIT=0 and DISCHARGE_BIT=0 and SDVALUE!=0 and isnull(b.ZFBL,1)<>0 " + " and a.inpatient_id='" + inpatient_id + "'and a.baby_id=" + baby_id + " group by a.XMID ,a.XMLY,a.ITEM_NAME,b.ZFBL,c.name,c.CUR_DEPT_NAME,c.ryzd "; DataTable tbfee = FrmMdiMain.Database.GetDataTable(ss); ts_zyhs_fyxx.DataSet1.tabZfxmqdDataTable tbzfxm = new DataSet1.tabZfxmqdDataTable(); //for(int i=0;i<tbfee.Rows.Count;) ParameterEx[] pa = new ParameterEx[4]; pa[0].Text = "hzxm"; pa[0].Value = ((DataTable)this.dataGridView2.DataSource).Rows[this.dataGridView2.CurrentCell.RowIndex]["name"].ToString(); pa[1].Text = "yymc"; pa[1].Value = TrasenFrame.Classes.Constant.HospitalName; pa[2].Text = "ksmc"; pa[2].Value = ((DataTable)this.dataGridView2.DataSource).Rows[this.dataGridView2.CurrentCell.RowIndex]["CUR_DEPT_NAME"].ToString(); pa[3].Text = "ryzd"; pa[3].Value = ((DataTable)this.dataGridView2.DataSource).Rows[this.dataGridView2.CurrentCell.RowIndex]["ryzd"].ToString(); ReportDocument rptdoc = new ReportDocument(); string ss1 = Constant.CustomDirectory; try { rptdoc.Load(Constant.CustomDirectory + "\\Report\\zyhs_医保自费项目同意签字单.rpt"); } catch { rptdoc.Load(Constant.ApplicationDirectory + "\\Report\\zyhs_医保自费项目同意签字单.rpt"); } //for (int i = 0; i < pa.Length; i++) //{ // rptdoc.SetParameterValue(pa[i].Text, pa[i].Value.ToString()); //} rptdoc.SetDataSource(tbfee); // rptdoc.PrintOptions.PrinterName = prtdoc.PrinterSettings.PrinterName; // DataTable tb=ts_zyhs_fyxx.tabZfxm this.crystalReportViewer1.ReportSource = rptdoc; } catch (Exception ex) { MessageBox.Show(ex.Message); } this.Cursor = Cursors.Default; }
public static DataTable Add_sum_pdcxmx_kcmx(long deptid, RelationalDatabase db) { ParameterEx[] parameters = new ParameterEx[1]; parameters[0].Text = "@deptid"; parameters[0].Value = deptid; DataTable tbmx = db.GetDataTable("sp_yf_pd_sum_pdcsmx_kcmx", parameters, 60); return(tbmx); }
private void toolbtnDel_Click(object sender, EventArgs e) { if (MessageBox.Show("您确定要删除这条记录?", "退出提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == DialogResult.OK) { InstanceForm.BDatabase.BeginTransaction(); try { ParameterEx[] parameters3 = new ParameterEx[7]; parameters3[0].Text = "@ID"; parameters3[0].Value = _id; parameters3[1].Text = "@KSID"; parameters3[1].Value = txtDept.Tag.ToString(); parameters3[2].Text = "@FLID"; parameters3[2].Value = txtType.Tag.ToString(); parameters3[3].Text = "@PXXH"; parameters3[3].Value = txtPXXH.Text.Trim(); parameters3[4].Text = "@ZJID_QC"; parameters3[4].Value = 0; parameters3[5].Text = "@i"; parameters3[5].Value = 3; parameters3[6].Text = "@newid"; parameters3[6].ParaDirection = ParameterDirection.Output; parameters3[6].DataType = System.Data.DbType.Int32; parameters3[6].ParaSize = 100; InstanceForm.BDatabase.DoCommand("SP_JC_MZPB_KSFLSZ", parameters3, 60); //三院数据处理_____保存日志 string bz = ""; bz = "删除门诊排班科室分类设置:" + txtDept.Text.ToString().Trim(); Guid log_djid = Guid.Empty; ts_HospData_Share.ts_update_log ts = new ts_HospData_Share.ts_update_log(); ts.Save_log(ts_HospData_Share.czlx.jc_基础数据单表修改, bz, "JC_MZ_YSPB_KSFLMX", "ID", _id.ToString(), InstanceForm._menuTag.Jgbm, 0, "", out log_djid, InstanceForm.BDatabase); InstanceForm.BDatabase.CommitTransaction(); ClearTxt(); Bangding(); //三院数据处理___执行同步操作 string errtext = ""; ts_HospData_Share.ts_update_type ty = new ts_HospData_Share.ts_update_type((int)ts_HospData_Share.czlx.jc_基础数据单表修改, InstanceForm.BDatabase); if (ty.Bzx == 1 && log_djid != Guid.Empty) //只有当立即执行标志为1时才执行 { ts.Pexec_log(log_djid, InstanceForm.BDatabase, out errtext); if (errtext != "") { MessageBox.Show(errtext, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } catch (System.Exception err) { InstanceForm.BDatabase.RollbackTransaction(); MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void butexcel_Click(object sender, EventArgs e) { #region 统计 try { if (tbsfy == null) { return; } if (tbsfy.Rows.Count == 0) { return; } for (int i = 0; i <= tbsfy.Rows.Count - 1; i++) { ParameterEx[] parameters = new ParameterEx[6]; parameters[0].Text = "@rq1"; parameters[0].Value = dtp1.Value.ToString(); parameters[1].Text = "@rq2"; parameters[1].Value = dtp2.Value.ToString(); parameters[2].Text = "@sky"; parameters[2].Value = Convert.ToInt32(tbsfy.Rows[i]["sfy"]); parameters[3].Text = "@jkid"; parameters[3].Value = Guid.Empty; parameters[4].Text = "@err_text"; parameters[4].ParaDirection = ParameterDirection.Output; parameters[4].ParaSize = 100; parameters[5].Text = "@endrq"; parameters[5].ParaDirection = ParameterDirection.Output; parameters[5].ParaSize = 100; DataSet dset = new DataSet(); TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_JK_TJ", parameters, dset, "sfmx", 30); string err_text = Convertor.IsNull(parameters[4].Value, ""); string endrq = Convertor.IsNull(parameters[5].Value, ""); Fun.AddRowtNo(dset.Tables[0]); Fun.AddRowtNo(dset.Tables[1]); Fun.AddRowtNo(dset.Tables[2]); Fun.AddRowtNo(dset.Tables[4]); Nrow = Convert.ToInt64(Convertor.IsNull(dset.Tables[3].Rows[0][0], "0")); } } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } #endregion }
private void btnSelect_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; try { this.Cursor = PubStaticFun.WaitCursor(); btnSelect.Enabled = false; int tjlx = 0; if (rdozy.Checked == true) { tjlx = 2; } if (rdomz.Checked == true) { tjlx = 1; } ParameterEx[] parameters = new ParameterEx[6]; parameters[0].Value = dtp1.Value.ToShortDateString() + ""; parameters[1].Value = dtp2.Value.ToShortDateString() + ""; parameters[2].Value = Convertor.IsNull(txtks.Tag, "0"); parameters[3].Value = Convertor.IsNull(txtys.Tag, "0"); parameters[4].Value = tjlx; parameters[0].Text = "@rq1"; parameters[1].Text = "@rq2"; parameters[2].Text = "@ksdm"; parameters[3].Text = "@ysdm"; parameters[4].Text = "@tjlx"; parameters[5].Text = "@bz"; parameters[5].ParaDirection = ParameterDirection.Output; parameters[5].ParaSize = 100; DataSet dset = new DataSet(); InstanceForm.BDatabase.AdapterFillDataSet("SP_YP_KSSZB_TJ", parameters, dset, "kss", 30); dset.Tables[0].TableName = "Tb"; this.dataGridView1.DataSource = dset.Tables[0]; Fun.AddRowtNo(dset.Tables[0]); btnSelect.Enabled = true; } catch (System.Exception err) { btnSelect.Enabled = true; MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Warning); } finally { this.Cursor = Cursors.Arrow; } }
private void butprint_Click(object sender, EventArgs e) { try { DataTable tbmx = (DataTable)dataGridView1.DataSource; ts_mz_report.DataSet1 Dset = new ts_mz_report.DataSet1(); DataRow myrow = Dset.收费项目.NewRow(); for (int i = 0; i <= tbmx.Columns.Count - 1; i++) { int x = i + 1; string nm = "T" + x.ToString(); myrow[nm] = tbmx.Columns[i].ColumnName.Trim(); } Dset.收费项目.Rows.Add(myrow); for (int nrow = 0; nrow <= tbmx.Rows.Count - 1; nrow++) { DataRow myrow1 = Dset.收费项目金额.NewRow(); for (int i = 0; i <= tbmx.Columns.Count - 1; i++) { int x = i + 1; string nm = "JE" + x.ToString(); myrow1[nm] = tbmx.Rows[nrow][tbmx.Columns[i].ColumnName].ToString(); } Dset.收费项目金额.Rows.Add(myrow1); } ParameterEx[] parameters = new ParameterEx[2]; parameters[0].Text = "开始日期"; parameters[0].Value = dtpBjksj.Value.ToString("yyyy-MM-dd"); parameters[1].Text = "结束日期"; parameters[1].Value = dtpEjksj.Value.ToString("yyyy-MM-dd"); TrasenFrame.Forms.FrmReportView f = null; f = new TrasenFrame.Forms.FrmReportView(Dset, Constant.ApplicationDirectory + "\\Report\\住院医保欠费情况报表.rpt", parameters); if (f.LoadReportSuccess) { f.Show(); } else { f.Dispose(); } } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void buttj_Click(object sender, EventArgs e) { ParameterEx[] parameters1 = new ParameterEx[4]; parameters1[0].Text = "@开始时间"; parameters1[0].Value = dtpjsrq1.Value.ToString(); parameters1[1].Text = "@结束时间"; parameters1[1].Value = dtpjsrq2.Value.ToString(); parameters1[2].Text = "@收费员"; parameters1[2].Value = Convert.ToInt32(Convertor.IsNull(comboBox1.SelectedValue, "-1")) == 0 ? -1 : Convert.ToInt32(Convertor.IsNull(comboBox1.SelectedValue, "-1")); parameters1[3].Text = "@显示明细"; parameters1[3].Value = this.checkBoxX1.Checked?1:0; DataSet dset = new DataSet(); TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_ZDY_MZ_ZLKYJCX_ex", parameters1, dset, "tj", 60); Fun.AddRowtNo(dset.Tables[0]); //for (int i = 0; i < dset.Tables[0].Columns.Count; i++) //{ // dset.Tables[0].Columns[i].DataType = typeof(System.String); //} ParameterEx[] parameters2 = new ParameterEx[3]; parameters2[0].Text = "@RQ1"; parameters2[0].Value = dtpjsrq1.Value.ToString(); parameters2[1].Text = "@RQ2"; parameters2[1].Value = dtpjsrq2.Value.ToString(); parameters2[2].Text = "@sky"; parameters2[2].Value = Convert.ToInt32(Convertor.IsNull(comboBox1.SelectedValue, "-1")) == 0 ? -1 : Convert.ToInt32(Convertor.IsNull(comboBox1.SelectedValue, "-1")); DataTable yjxxtb = TrasenFrame.Forms.FrmMdiMain.Database.GetDataTable("SP_ZDY_MZ_YJJCX_ry", parameters2, 60); DataRow r = dset.Tables[0].NewRow(); if (!this.checkBoxX1.Checked && yjxxtb.Rows.Count > 0) { r["类型"] = "预收款:"; r["收费员"] = yjxxtb.Rows[0]["预交金存入金额"].ToString(); r["押金"] = "诊疗卡押金:"; r["收押金卡张数"] = yjxxtb.Rows[0]["诊疗卡押金"].ToString(); r["未收押金卡张数"] = "预交金消费金额:"; r["总发卡张数"] = yjxxtb.Rows[0]["预交金消费金额"].ToString(); dset.Tables[0].Rows.Add(r); r = dset.Tables[0].NewRow(); r["类型"] = "预交金结存金额:"; r["收费员"] = yjxxtb.Rows[0]["预交金结存金额"].ToString(); r["押金"] = "现金:"; r["收押金卡张数"] = yjxxtb.Rows[0]["现金"].ToString(); r["未收押金卡张数"] = "银行转入:"; r["总发卡张数"] = yjxxtb.Rows[0]["银行转入"].ToString(); dset.Tables[0].Rows.Add(r); } this.dataGridViewX1.DataSource = dset.Tables[0]; }
private void butprint_pos_Click(object sender, EventArgs e) { if (dataGridView1.DataSource == null) { return; } try { DataTable dttk = (DataTable)dataGridView1.DataSource; ts_mz_report.DataSet1 dset = new ts_mz_report.DataSet1(); DataRow dr; for (int i = 0; i <= dttk.Rows.Count - 1; i++) { dr = dset.银医退卡明细.NewRow(); int x = i + 1; dr["序号"] = Convert.ToString(dttk.Rows[i]["序号"]); dr["卡号"] = Convert.ToString(dttk.Rows[i]["卡号"]); dr["卡类型"] = Convert.ToString(dttk.Rows[i]["卡类型"]); dr["病人姓名"] = Convert.ToString(dttk.Rows[i]["病人姓名"]); dr["身份证号"] = Convert.ToString(dttk.Rows[i]["身份证号"]); dr["退卡金额"] = Convert.ToString(Convertor.IsNull(dttk.Rows[i]["退卡金额"], "0")); dr["日期"] = Convert.ToString(dttk.Rows[i]["日期"]); dr["操作员"] = Convert.ToString(dttk.Rows[i]["操作员"]); dset.银医退卡明细.Rows.Add(dr); } ParameterEx[] parameters = new ParameterEx[4]; parameters[0].Text = "医院名称"; parameters[0].Value = TrasenFrame.Classes.Constant.HospitalName; parameters[1].Text = "填报日期"; parameters[1].Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToShortDateString(); parameters[2].Text = "备注"; parameters[2].Value = "退卡(预交)日期:" + startTjrq.Value.ToString() + " 到 " + endTjrq.Value.ToString(); parameters[3].Text = "统计人"; parameters[3].Value = InstanceForm.BCurrentUser.Name; bool bprint = chkprint.Checked == true ? false : true; TrasenFrame.Forms.FrmReportView f = new TrasenFrame.Forms.FrmReportView(dset, Constant.ApplicationDirectory + "\\Report\\MZ_银医退卡退预交金明细统计.rpt", parameters, bprint); if (f.LoadReportSuccess) { f.Show(); } else { f.Dispose(); } } catch (System.Exception ex) { MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
///// <summary> ///// 获取日期条件 add by zp 2013-07-18 ///// </summary> ///// <returns></returns> //private string GetDateWhere() //{ // string whre_date = " and ("; // try // { // string sql = @"select DATEADD(DD,-1*" + this.cfg13.Config + ",getdate())"; // DateTime _date = Convert.ToDateTime(InstanceForm.BDatabase.GetDataResult(sql)); // DateTimePicker dtp = null; // for (int i=0;i<this.list_datewhere.Count;i++) // { // if (list_datewhere[i] is DateTimePicker) // { // dtp = (DateTimePicker)list_datewhere[i]; // #region 注释代码 // //if (i == 0) // //{ // // if (_date > dtp.Value) //如果当前日期减去参数设置天数大于传入的日期 则默认以启用视图模式 // // { // // isview = true; // // } // //} // //else //通过 isview判断日期是否符合指定时间段内 // //{ // // if (!isview) //必须是传入的日期小于 _date // // { // // if (_date > dtp.Value) //如果当前日期减去参数设置天数大于传入的日期 则默认以启用视图模式 // // { // // MessageBox.Show(@"所传输的多个日期段必须都在" + _date.ToString() + "日期内!或都在" + _date.ToString() + "日期外!", "提示"); // // return ""; // // } // // } // // else // // { // // if (_date < dtp.Value) // // { // // MessageBox.Show(@"所传输的多个日期段必须都在" + _date.ToString() + "日期内!或都在" + _date.ToString() + "日期外!", "提示"); // // return ""; // // } // // } // //} // #endregion // string name = dtp.Name; // int index = int.Parse(name.Substring(3, 1)); // if (index % 2 > 0) //单数 开始日期 // { // if (i > 1) // { // whre_date +=" or (a.sfrq>=convert(varchar,'" + dtp.Value + "',120)"; // } // else // { // whre_date += " a.sfrq>=convert(varchar,'" + dtp.Value + "',120)"; // } // } // else // { // if (i > 1) // { // whre_date +=" and a.sfrq<=convert(varchar,'" + dtp.Value + "',120))"; // } // else // { // whre_date +=" and a.sfrq<=convert(varchar,'" + dtp.Value + "',120)"; // } // } // } // } // whre_date += ")"; // } // catch (Exception ea) // { // MessageBox.Show("出现异常!原因:" + ea.Message, "提示"); // } // return whre_date; //} /// <summary> /// 统计数据 /// </summary> private void SelectData() { try { string where_date = TjMeans.GetDateWhere("a.sfrq", this.list_datewhere); int _isview=0; if (this.isview) _isview = 1; ParameterEx[] parameters = new ParameterEx[8]; parameters[0].Text = "@isview"; parameters[0].Value = _isview; parameters[1].Text = "@TYPE"; parameters[1].Value = rdJg.Checked == true ? 0 : 1; int _jsfs = 0; if (rbYb.Checked) { _jsfs = 1; } else if (rbZf.Checked) { _jsfs = 2; } else { _jsfs = 0; } parameters[2].Text = "@jsfs"; parameters[2].Value = _jsfs; parameters[3].Text = "@jgbm"; parameters[3].Value = Convert.ToInt32(Convertor.IsNull(cmbjgbm.SelectedValue, "0")); parameters[4].Text = "@tjlx"; parameters[4].Value = _menuTag.Function_Name == "Fun_ts_mz_tjbb_jjrsrtjbydate" ? 0 : 1; ; parameters[5].Text = "@include_kdks"; parameters[5].Value = chkKdks.Checked ? 1 : 0; parameters[6].Text = "@sfdeptid"; parameters[6].Value = this.Cmb_SfDept.SelectedValue.ToString().Trim() == "-1" ? "" : this.Cmb_SfDept.SelectedValue.ToString().Trim(); parameters[7].Text = "@datewhere"; parameters[7].Value = where_date; DataSet dset = new DataSet(); TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_SK_kssrtjByDate", parameters, dset, "sfmx", 30); Fun.AddRowtNo(dset.Tables[0]); this.dataGridView1.DataSource = dset.Tables[0]; } catch (Exception ea) { MessageBox.Show("出现异常!原因:" + ea.Message, "提示"); } }
//收费项目 public static DataTable SelectItem(int ZXKS, long jgbm, RelationalDatabase _DataBase) { ParameterEx[] parameters = new ParameterEx[2]; parameters[0].Text = "@ZXKS"; parameters[0].Value = ZXKS; parameters[1].Text = "@jgbm"; parameters[1].Value = jgbm; return(_DataBase.GetDataTable("SP_YJ_ZJXMMX", parameters, 60)); }
public ParameterEx[] GetReportParameters() { List <ParameterEx> list = new List <ParameterEx>(); ParameterEx p; p = new ParameterEx(); p.Text = ReportParameterDefine.库房类型; p.Value = cboDeptType.Text; list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.库房名称; p.Value = cboDept.Text.Trim(); list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.价格统计方式; p.Value = radioButton1.Checked ? "按进价" : "按零售价"; list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.统计年份; p.Value = Convert.ToInt32(cboYear.Text); list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.统计月份; p.Value = checkBox1.Checked ? Convert.ToInt32(cboMonth.Text) : 0; list.Add(p); int cjid = Convert.ToInt32(Convertor.IsNull(this.labelTextBox1.SelectedValue, "0")); YpClass.Ypcj cj = new YpClass.Ypcj(cjid, InstanceForm.BDatabase); p = new ParameterEx(); p.Text = ReportParameterDefine.药品名称; p.Value = string.Format("{0}({1})", cj.S_YPPM, cj.S_YPSPM); list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.药品规格; p.Value = cj.S_YPGG; list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.药品单位; p.Value = cj.S_YPDW; list.Add(p); p = new ParameterEx(); p.Text = ReportParameterDefine.药品货号; p.Value = cj.CJID; list.Add(p); return(list.ToArray()); }
private void printbutt_Click(object sender, EventArgs e) { Cursor.Current = PubStaticFun.WaitCursor(); DataTable myTb = (DataTable)this.dataGridView1.DataSource; if (myTb == null || myTb != null && myTb.Rows.Count < 1) { MessageBox.Show(this, "没有数据,不能打印", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } rds.Tables["MZFPDY"].Clear(); DataRow dr; int flag = 0; string sfyname = ""; for (int j = 0; j < myTb.Rows.Count; j++) { flag++; dr = rds.Tables["MZFPDY"].NewRow(); dr["门诊号"] = myTb.Rows[j]["BLH"].ToString(); dr["病人姓名"] = myTb.Rows[j]["BRXM"].ToString(); dr["收费日期"] = myTb.Rows[j]["SFRQ"].ToString(); dr["打印时间"] = Convert.ToDateTime(myTb.Rows[j]["fpdysj"]).ToString(); dr["发票号"] = myTb.Rows[j]["FPH"].ToString(); dr["总金额"] = Convert.ToDouble(myTb.Rows[j]["ZJE"].ToString()); dr["科室"] = myTb.Rows[j]["Deptname"].ToString(); dr["医生"] = myTb.Rows[j]["EmpName"].ToString(); dr["收费员"] = myTb.Rows[j]["sfy"].ToString(); sfyname = myTb.Rows[j]["sfy"].ToString(); rds.Tables["MZFPDY"].Rows.Add(dr); } Cursor.Current = Cursors.Default; FrmReportView frmReport = null; ParameterEx[] _parameters = new ParameterEx[5]; _parameters[0].Text = "tTitle"; _parameters[0].Value = new SystemCfg(2).Config; _parameters[1].Text = "tUser"; _parameters[1].Value = "打印者:" + sfyname; _parameters[2].Text = "tDate"; _parameters[2].Value = DateManager.ServerDateTimeByDBType(BDatabase); _parameters[3].Text = "kssj"; _parameters[3].Value = this.dydtpks.Value; _parameters[4].Text = "jssj"; _parameters[4].Value = this.dydtpjs.Value; if (flag > 0) { frmReport = new FrmReportView(rds, Constant.ApplicationDirectory + "\\report\\MZ_门诊补打发票.rpt", _parameters); frmReport.Show(); } }
private void ReadGhxx() { try { ParameterEx[] parameters = new ParameterEx[13]; parameters[0].Text = "@djy"; parameters[0].Value = InstanceForm.BCurrentUser.EmployeeId; parameters[1].Text = "@rq1"; parameters[1].Value = DateTime.Now.ToShortDateString() + " 00:00:00"; parameters[2].Text = "@rq2"; parameters[2].Value = DateTime.Now.ToShortDateString() + " 23:59:59"; parameters[3].Text = "@GHLB"; parameters[3].Value = 0; parameters[4].Text = "@BRLX"; parameters[4].Value = 0; parameters[5].Text = "@GHKS"; parameters[5].Value = 0; parameters[6].Text = "@GHJB"; parameters[6].Value = 0; parameters[7].Text = "@GHYS"; parameters[7].Value = 0; parameters[8].Text = "@KLX"; parameters[8].Value = 0; parameters[9].Text = "@kh"; parameters[9].Value = ""; parameters[10].Text = "@brxm"; parameters[10].Value = ""; parameters[11].Text = "@blh"; parameters[11].Value = ""; parameters[12].Text = "@px"; parameters[12].Value = " DESC "; DataTable tb = InstanceForm.BDatabase.GetDataTable("SP_MZSF_CX_GHXX", parameters, 30); Fun.AddRowtNo(tb); this.dataGridView1.DataSource = tb; } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// 获取菜单信息 /// </summary> /// <param name="MenuId"></param> private void GetMenuInfo(int MenuId) { ParameterEx[] paras = new ParameterEx[1]; paras[0].Text = "@MenuId"; paras[0].Value = this.m_currentMenuId; IDbCommand cmd = db.GetCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "up_GetMenuInfo"; db.SetParameters(cmd, paras); DataRow dr = db.GetDataRow(cmd); if (dr != null) { this.txtMenuName.Text = dr["Name"].ToString().Trim(); this.txtDllName.Text = dr["Dll_Name"].ToString().Trim(); this.txtFunctionName.Text = dr["Function_Name"].ToString().Trim(); this.txtFunctionTag.Text = dr["Function_Tag"].ToString().Trim(); this.cmbJgbm.SelectedValue = Convert.ToInt32(dr["jgbm"]);//Add By Tany 2010-01-14 this.chkShowToolbar.Checked = Convert.ToInt32(dr["showtoolbar"]) == 1 ? true : false; this.chkShowToolbar.Visible = this.txtFunctionName.Text.Trim() == "" ? false : true; //是否可以用公用密码 jianqg 2012-10-6 emr-his框架整合 增加 //jianqg emr-his 整合暂时注释 this.chk_CanUserPublicPwd.Checked = Convert.ToInt32(dr["CanUsePublicPwd"]) == 1 ? true : false; this.chk_CanUserPublicPwd.Visible = this.txtFunctionName.Text.Trim() == "" ? false : true; txtDllName.Enabled = txtFunctionName.Enabled = txtFunctionTag.Enabled = this.txtFunctionName.Text.Trim() == "" ? false : true; if (Convert.IsDBNull(dr["icon"])) { return; } try { object objIco = dr["icon"]; if (objIco != null) { byte[] byteIco = (byte[])objIco; System.IO.MemoryStream ms = new System.IO.MemoryStream(byteIco); Image img = Image.FromStream(ms); picIco.Image = img; chkIco.Checked = true; } } catch (Exception err) { MessageBox.Show(err.Message); } } }
/// <summary> /// 分诊操作 Modify by zp 2013-10-30 /// </summary> /// <param name="jgbm">机构编码</param> /// <param name="ghxxid">挂号信息id</param> /// <param name="fzks">分诊科室</param> /// <param name="NewFzid"></param> /// <param name="err_code"></param> /// <param name="err_text"></param> /// <param name="_DataBase"></param> public static void AddHz(long jgbm, Guid ghxxid, int fzks, FzStatus status, out Guid NewFzid, out int err_code, out string err_text, string btime, string etime, string sjnc, int zqid, RelationalDatabase _DataBase) { try { ParameterEx[] parameters = new ParameterEx[11]; parameters[0].Text = "@jgbm"; parameters[0].Value = jgbm; parameters[1].Text = "@GHXXID"; parameters[1].Value = ghxxid; parameters[2].Text = "@fzks"; parameters[2].Value = fzks; parameters[3].Text = "@JLZT"; parameters[3].Value = (int)status; parameters[3].DataType = System.Data.DbType.Int32; parameters[4].Text = "@newfzid"; parameters[4].ParaDirection = ParameterDirection.Output; parameters[4].DataType = System.Data.DbType.Guid; parameters[4].ParaSize = 100; parameters[5].Text = "@err_code"; parameters[5].ParaDirection = ParameterDirection.Output; parameters[5].DataType = System.Data.DbType.Int32; parameters[5].ParaSize = 100; parameters[6].Text = "@err_text"; parameters[6].ParaDirection = ParameterDirection.Output; parameters[6].ParaSize = 100; parameters[7].Text = "@KSSJ"; parameters[7].Value = btime; parameters[8].Text = "@JSSJ"; parameters[8].Value = etime; parameters[9].Text = "@SJNC"; parameters[9].Value = sjnc; parameters[10].Text = "@ZQID"; parameters[10].Value = zqid; _DataBase.DoCommand("SP_mzhs_hsfz", parameters, 30); NewFzid = new Guid(Convertor.IsNull(parameters[4].Value.ToString(), Guid.Empty.ToString())); err_code = Convert.ToInt32(parameters[5].Value); err_text = Convert.ToString(parameters[6].Value); } catch (System.Exception err) { throw new System.Exception(err.ToString()); } }
/// <summary> /// 医生用药控制 /// </summary> /// <param name="ysid"></param> /// <param name="hjid"></param> /// <param name="mz"></param> public static void YsYYKZ(int ysid, Guid hjid, bool mz, int xmly, Guid jzid, RelationalDatabase _DataBase) { try { ParameterEx[] parameters = new ParameterEx[7]; parameters[0].Text = "@ysid"; parameters[0].Value = ysid; parameters[1].Text = "@hjid"; parameters[1].Value = hjid; parameters[2].Text = "@mz"; parameters[2].Value = mz; parameters[3].Text = "@err_code"; parameters[3].ParaDirection = ParameterDirection.Output; parameters[3].DataType = System.Data.DbType.Int32; parameters[3].ParaSize = 100; parameters[4].Text = "@err_text"; parameters[4].ParaDirection = ParameterDirection.Output; parameters[4].ParaSize = 100; parameters[5].Text = "@xmly"; parameters[5].Value = xmly; parameters[6].Text = "@JZID"; parameters[6].Value = jzid; DataTable tb = _DataBase.GetDataTable("SP_MZYS_YSYYKZ", parameters, 30); int err_code = Convert.ToInt32(parameters[3].Value); string err_text = Convert.ToString(parameters[4].Value); if (err_code != 0) { throw new Exception(err_text); } if (tb != null) { for (int i = 0; i <= tb.Rows.Count - 1; i++) { err_text = err_text + tb.Rows[i]["bz"] + "\n"; } if (tb.Rows.Count > 0) { throw new Exception(err_text); } } } catch (System.Exception err) { throw new System.Exception(err.Message); } }
private void btnprintmxbfy_Click(object sender, EventArgs e) { if (dataGridView2.DataSource == null) { return; } try { DataTable tbmx = (DataTable)dataGridView2.DataSource; ts_mz_report.DataSet1 Dset = new ts_mz_report.DataSet1(); DataRow myrow = Dset.收费项目.NewRow(); for (int i = 0; i <= tbmx.Columns.Count - 1; i++) { int x = i + 1; string nm = "T" + x.ToString(); myrow[nm] = tbmx.Columns[i].ColumnName.Trim(); } Dset.收费项目.Rows.Add(myrow); for (int nrow = 0; nrow <= tbmx.Rows.Count - 1; nrow++) { DataRow myrow1 = Dset.收费项目金额.NewRow(); for (int i = 0; i <= tbmx.Columns.Count - 1; i++) { int x = i + 1; string nm = "JE" + x.ToString(); myrow1[nm] = tbmx.Rows[nrow][tbmx.Columns[i].ColumnName].ToString(); } Dset.收费项目金额.Rows.Add(myrow1); } ParameterEx[] parameters = new ParameterEx[1]; parameters[0].Text = "医院名称"; parameters[0].Value = TrasenFrame.Classes.Constant.HospitalName; TrasenFrame.Forms.FrmReportView f; f = new TrasenFrame.Forms.FrmReportView(Dset, Constant.ApplicationDirectory + "\\Report\\MZ_医保结算统计(明细不分页).rpt", parameters); if (f.LoadReportSuccess) { f.Show(); } else { f.Dispose(); } } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void butprint_Click(object sender, System.EventArgs e) { try { string where1 = ""; if (rdo1.Checked == true) { where1 = "按日期统计 日期:" + dtp1.Value.ToShortDateString(); where1 = where1 + " 到:" + dtp2.Value.ToShortDateString(); } else { where1 = "按会计月份统计 日期:" + this.statusBar1.Panels[2].Text; } DataTable tb = (DataTable)this.myDataGrid1.DataSource; ts_Yk_ReportView.Dataset2 Dset = new ts_Yk_ReportView.Dataset2(); DataRow myrow; for (int i = 0; i <= tb.Rows.Count - 1; i++) { myrow = Dset.处方统计.NewRow(); myrow["xmmc"] = Convert.ToString(tb.Rows[i]["项目名称"]); myrow["cfzs"] = Convert.ToInt64(tb.Rows[i]["处方张数"]); myrow["cfje"] = Convert.ToDecimal(tb.Rows[i]["药品金额"]); myrow["tyzs"] = Convert.ToInt64(tb.Rows[i]["退药张数"]); myrow["tyje"] = Convert.ToDecimal(tb.Rows[i]["退药金额"]); myrow["sumcfzs"] = Convert.ToInt64(tb.Rows[i]["合计张数"]); myrow["sumcfje"] = Convert.ToDecimal(tb.Rows[i]["合计金额"]); Dset.处方统计.Rows.Add(myrow); } ParameterEx[] parameters = new ParameterEx[3]; parameters[0].Text = "where1"; parameters[0].Value = where1.Trim(); parameters[1].Text = "where2"; parameters[1].Value = ""; parameters[2].Text = "title"; parameters[2].Value = TrasenFrame.Classes.Constant.HospitalName + "(" + InstanceForm.BCurrentDept.DeptName + ")" + "药品销售收入(处方)报表"; TrasenFrame.Forms.FrmReportView f = new TrasenFrame.Forms.FrmReportView(Dset.处方统计, Constant.ApplicationDirectory + "\\Report\\YF_处方统计.rpt", parameters); if (f.LoadReportSuccess) { f.Show(); } else { f.Dispose(); } } catch (System.Exception err) { MessageBox.Show(err.Message); } }
public ParameterEx[] GetStoreProcedureParameters() { List <ParameterEx> list = new List <ParameterEx>(); ParameterEx p; p = new ParameterEx(); p.Text = "@yk"; p.Value = cboDeptType.SelectedIndex; list.Add(p); p = new ParameterEx(); p.Text = "@jhjetj"; p.Value = radioButton1.Checked ? 1 : 0; list.Add(p); p = new ParameterEx(); p.Text = "@year"; p.Value = Convert.ToInt32(cboYear.Text); list.Add(p); p = new ParameterEx(); p.Text = "@month"; p.Value = checkBox1.Checked ? Convert.ToInt32(cboMonth.Text) : 0; list.Add(p); //Add By Tany 2016-03-01 p = new ParameterEx(); p.Text = "@endyear"; p.Value = Convert.ToInt32(cmbEndYear.Text); list.Add(p); p = new ParameterEx(); p.Text = "@endmonth"; p.Value = checkBox2.Checked ? Convert.ToInt32(cmbEndMonth.Text) : 0; list.Add(p); p = new ParameterEx(); p.Text = "@yq"; p.Value = Convert.ToInt32(cmbYq.SelectedValue); list.Add(p); p = new ParameterEx(); p.Text = "@ERR_CODE"; p.Value = 0; p.ParaDirection = ParameterDirection.Output; list.Add(p); p = new ParameterEx(); p.Text = "@ERR_TEXT"; p.ParaSize = 200; p.ParaDirection = ParameterDirection.Output; list.Add(p); return(list.ToArray()); }
private void buttj_Click(object sender, EventArgs e) { try { if (cmbKdDept.Text.Contains("手术") == true) { } else { MessageBox.Show("开单科室必须为手术室!", "提示"); return; } Cursor = PubStaticFun.WaitCursor(); ParameterEx[] parameters = new ParameterEx[9]; parameters[0].Text = "@TYPE"; parameters[0].Value = 0; parameters[1].Text = "@TJ_TYPE"; parameters[1].Value = 0; parameters[2].Text = "@RQ1"; parameters[2].Value = dtp1.Value.ToString(); parameters[3].Text = "@RQ2"; parameters[3].Value = dtp2.Value.ToString(); parameters[4].Text = "@DEPT_BR"; parameters[4].Value = Convert.ToInt32(Convertor.IsNull(cmbBrDept.SelectedValue, "0")); parameters[5].Text = "@DEPT_ID"; parameters[5].Value = Convert.ToInt32(Convertor.IsNull(cmbKdDept.SelectedValue, "0")); parameters[6].Text = "@DEPT_SS"; parameters[6].Value = Convert.ToInt32(Convertor.IsNull(cmbSqDept.SelectedValue, "0")); parameters[7].Text = "@ISBRMX"; parameters[7].Value = chkBrmx.Checked ? 1 : 0; parameters[8].Text = "@JGBM"; parameters[8].Value = FrmMdiMain.Jgbm; DataTable tb = InstanceForm.BDatabase.GetDataTable("SP_ZY_TJ_KSSRTJ_SSSQKS", parameters, 120); AddRowtNo(tb); if (tb.Columns.Contains("序号") && tb.Rows.Count > 0) { tb.Rows[tb.Rows.Count - 1]["序号"] = "合计"; } this.dataGridView1.DataSource = tb; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { Cursor = Cursors.Default; } }
/// <summary> /// 出库单转换为目的科室的入库待审核单据 /// </summary> /// <param name="ywlx">业务类型</param> /// <param name="sqks">目的科室</param> /// <param name="deptid">当前科室</param> /// <param name="ckdh">出库单号</param> /// <param name="sqdh">申请单据号</param> /// <param name="djid">产生的yk_dj的ID</param> /// <param name="err_code">错误号</param> /// <param name="err_text">错误文本</param> public static void Add_Ck_RkDjmx(Guid Ydjid, string ywlx, long sqks, long deptid, long ckdh, long sqdh, out Guid djid, out int err_code, out string err_text, long toJgbm, RelationalDatabase _DataBase) { ParameterEx[] parameters = new ParameterEx[10]; parameters[0].Text = "@djh"; parameters[0].Value = ckdh; parameters[1].Text = "@deptid"; parameters[1].Value = deptid; parameters[2].Text = "@sqdh"; parameters[2].Value = sqdh; parameters[3].Text = "@sqks"; parameters[3].Value = sqks; parameters[4].Text = "@ywlx"; parameters[4].Value = ywlx; parameters[5].Text = "@djid"; parameters[5].ParaDirection = ParameterDirection.Output; parameters[5].DataType = System.Data.DbType.Guid; parameters[5].ParaSize = 100; parameters[6].Text = "@err_code"; parameters[6].ParaDirection = ParameterDirection.Output; parameters[6].DataType = System.Data.DbType.Int32; parameters[6].ParaSize = 100; parameters[7].Text = "@err_text"; parameters[7].ParaDirection = ParameterDirection.Output; parameters[7].ParaSize = 100; parameters[8].Text = "@tojgbm"; parameters[8].Value = toJgbm; parameters[9].Text = "@ydjid"; parameters[9].Value = Ydjid; DataTable tb; if (YpConfig.是否药库(deptid, _DataBase) == true) { tb = _DataBase.GetDataTable("sp_Yk_Rksq_Insert_Djmx", parameters, 30); } else { tb = _DataBase.GetDataTable("sp_Yf_Rksq_Insert_Djmx", parameters, 30); } djid = new Guid(Convertor.IsNull(parameters[5].Value.ToString(), Guid.Empty.ToString())); err_code = Convert.ToInt32(parameters[6].Value); err_text = Convert.ToString(parameters[7].Value); }
private void GetData() { try { ParameterEx[] parameters = new ParameterEx[4]; parameters[0].Text = "@rq1"; parameters[0].Value = dtpBjksj.Value.ToString(); parameters[1].Text = "@rq2"; parameters[1].Value = dtpEjksj.Value.ToString(); parameters[2].Text = "@DeptID"; parameters[2].Value = "0"; parameters[3].Text = "@ksType"; if (this._item == 0) { parameters[3].Value = "0"; } else { parameters[3].Value = cmbGroup.SelectedIndex == 2 ? 0 : (cmbGroup.SelectedIndex + 1); } DataSet dset = new DataSet(); if (this._item == 0) { TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("sp_Report_MZ_Bussiness", parameters, dset, "sfmx", 60); } else { TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("sp_Report_MZ_Bussiness_mx", parameters, dset, "sfmx", 60); } Fun.AddRowtNo(dset.Tables[0]); this.dataGridView1.DataSource = dset.Tables[0]; for (int i = 0; i < this.dataGridView1.Columns.Count; i++) { this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable; if (this.dataGridView1.Columns[i].Name.ToLower() == "ksdm") { this.dataGridView1.Columns[i].Visible = false; } } } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void toolbtnDel_Click(object sender, EventArgs e) { if (MessageBox.Show("您确定要删除这条记录?", "退出提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == DialogResult.OK) { InstanceForm.BDatabase.BeginTransaction(); try { ParameterEx[] parameters3 = new ParameterEx[6]; parameters3[0].Text = "@id"; parameters3[0].Value = _id; parameters3[1].Text = "@USE_NAME"; parameters3[1].Value = Convertor.IsNull(txtUse.Text.Trim(), ""); parameters3[2].Text = "@NUM"; parameters3[2].Value = Convert.ToInt32(this.txtNum.Text.Trim()); parameters3[3].Text = "@HSITEM_ID"; parameters3[3].Value = Convertor.IsNull(txtHsitem.Tag, ""); parameters3[4].Text = "@i"; parameters3[4].Value = 3; parameters3[5].Text = "@newid"; parameters3[5].ParaDirection = ParameterDirection.Output; parameters3[5].DataType = System.Data.DbType.Int32; parameters3[5].ParaSize = 100; InstanceForm.BDatabase.DoCommand("SP_JC_USEAGE_FEE_MZ", parameters3, 60); //三院数据处理_____保存日志 string bz = ""; bz = "删除门诊用法附加费用:" + txtUse.Text.ToString().Trim(); Guid log_djid = Guid.Empty; ts_HospData_Share.ts_update_log ts = new ts_HospData_Share.ts_update_log(); ts.Save_log(ts_HospData_Share.czlx.jc_基础数据单表修改, bz, "jc_useage_fee_mz", "id", _id.ToString(), InstanceForm._menuTag.Jgbm, 0, "", out log_djid, InstanceForm.BDatabase); InstanceForm.BDatabase.CommitTransaction(); ClearTxt(); Bind(); //三院数据处理___执行同步操作 string errtext = ""; ts_HospData_Share.ts_update_type ty = new ts_HospData_Share.ts_update_type((int)ts_HospData_Share.czlx.jc_基础数据单表修改, InstanceForm.BDatabase); if (ty.Bzx == 1 && log_djid != Guid.Empty) //只有当立即执行标志为1时才执行 { ts.Pexec_log(log_djid, InstanceForm.BDatabase, out errtext); if (errtext != "") { MessageBox.Show(errtext, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } catch (System.Exception err) { InstanceForm.BDatabase.RollbackTransaction(); MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void GetData() { try { int i = 0; ParameterEx[] parameters = new ParameterEx[5]; parameters[i].Text = "@rq1"; parameters[i].Value = dtpBjksj.Value.ToString(); ++i; parameters[i].Text = "@rq2"; parameters[i].Value = dtpEjksj.Value.ToString(); ++i; parameters[i].Text = "@sourceType"; parameters[i].Value = cmbSource.SelectedIndex; ++i; parameters[i].Text = "@itemArr"; parameters[i].Value = "'46','57','53','22','42','63','09','21','28','36','64','44'"; ++i; parameters[i].Text = "@deptArr"; parameters[i].Value = "23"; DataSet dset = new DataSet(); TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("sp_QueryBuessinessOfOperation", parameters, dset, "sfmx", 60); Fun.AddRowtNo(dset.Tables[0]); DataTable dt = dset.Tables[0]; this.dataGridView1.Columns.Clear(); this.dataGridView1.DataSource = dt; for (i = 0; i < this.dataGridView1.Columns.Count; i++) { this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable; if (this.dataGridView1.Columns[i].Name.ToLower() == "ksdm" || this.dataGridView1.Columns[i].Name.ToLower() == "sort") { this.dataGridView1.Columns[i].Visible = false; } } } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void buttj_Click(object sender, EventArgs e) { try { ParameterEx[] parameters = new ParameterEx[7]; parameters[0].Text = "@rq1"; parameters[0].Value = dtp1.Value.ToString(); parameters[1].Text = "@rq2"; parameters[1].Value = dtp2.Value.ToString(); parameters[2].Text = "@type"; parameters[2].Value = rdJg.Checked == true ? 0 : 1; int _jsfs = 0; if (rbYb.Checked) { _jsfs = 1; } else if (rbZf.Checked) { _jsfs = 2; } else { _jsfs = 0; } parameters[3].Text = "@jsfs"; parameters[3].Value = _jsfs; parameters[4].Text = "@jgbm"; parameters[4].Value = Convert.ToInt32(Convertor.IsNull(cmbjgbm.SelectedValue, "0")); parameters[5].Text = "@tjlx"; parameters[5].Value = _menuTag.Function_Name == "Fun_ts_mz_tjbb_kssrtj" ? 0 : 1;; parameters[6].Text = "@include_kdks"; parameters[6].Value = chkKdks.Checked ? 1 : 0; DataSet dset = new DataSet(); TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_SK_kssrtj_ypfl", parameters, dset, "sfmx", 30); Fun.AddRowtNo(dset.Tables[0]); this.dataGridView1.DataSource = dset.Tables[0]; } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> ///jianqg 2012-10月 emr-his框架整合 增加 参数userId /// </summary> /// <param name="loginCode"></param> /// <param name="userId"></param> private void GetUserInfo(string loginCode, string userId) { try { IDbCommand cmd = this.Database.GetCommand(); //jianqg 2012-10月 emr-his框架整合 启用过程up_GetUserInfo,可以用UserCode,UserID,原来使用up_GetUserInfobyCode,只用UserCode cmd.CommandText = "up_GetUserInfo";// "up_GetUserInfobyCode"; cmd.CommandType = CommandType.StoredProcedure; ParameterEx[] paras = new ParameterEx[2]; paras[0].Text = "@UserCode"; loginCode = Convertor.IsNull(loginCode, ""); paras[0].Value = loginCode.ToUpper(); paras[1].Text = "@UserID"; userId = Convertor.IsNumeric(userId) ? userId : "0"; paras[1].Value = userId; this.Database.SetParameters(cmd, paras); DataRow dataRow = this.Database.GetDataRow(cmd); if (dataRow != null) { _userID = Convert.ToInt32(Convertor.IsNull(dataRow["userid"], "-1")); _loginCode = Convertor.IsNull(dataRow["code"], ""); _password = Crypto.Instance().Decrypto(Convertor.IsNull(dataRow["password"], "")); _locked = Convert.ToInt16(Convertor.IsNull(dataRow["locked_bit"], "0")) > 0 ? true : false; _isAdministrator = Convert.ToInt16(Convertor.IsNull(dataRow["administrator_bit"], "0")) > 0 ? true : false; //jianqg 2012-10月 emr-his框架整合 增加 _IsHouseman = dataRow["H_id"].ToString().Length > 0 ? true : false; _PublicPwd = Crypto.Instance().Decrypto(Convertor.IsNull(dataRow["public_pwd"], "")); base.InitEmployee(Convert.ToInt32(Convertor.IsNull(dataRow["employee_id"], "-1"))); } else { throw new Exception("用户编码为" + loginCode.ToString() + "的用户不存在"); } //获取对应的CA证书 //try //{ // string sql = string.Format( "select Certificate from Pub_User_CA_Certificate where Employee_Id={0}" , EmployeeId ); // object obj = this.Database.GetDataResult( sql ); // _certificateCA = Convertor.IsNull( obj , "" ); //} //catch //{ // _certificateCA = ""; //} } catch (Exception err) { throw new Exception("User\\" + err.Message); } }
private void SelectedFp() { ParameterEx[] parameters = new ParameterEx[15]; parameters[0].Text = "@rq1"; parameters[0].Value = dtpFrom.Value.ToString("yyyy-MM-dd HH:mm:ss"); parameters[1].Text = "@rq2"; parameters[1].Value = dtpTo.Value.ToString("yyyy-MM-dd HH:mm:ss"); parameters[2].Text = "@fph"; parameters[2].Value = ""; parameters[3].Text = "@blh"; parameters[3].Value = ""; parameters[4].Text = "@brxm"; parameters[4].Value = ""; parameters[5].Text = "@sfy"; parameters[5].Value = ""; parameters[6].Text = "@yblx"; parameters[6].Value = ""; parameters[7].Text = "@bak"; parameters[7].Value = 0; parameters[8].Text = "@lx"; parameters[8].Value = 1; parameters[9].Text = "@kh"; parameters[9].Value = kh; parameters[10].Text = "@fph1"; parameters[10].Value = ""; parameters[11].Text = "@fph2"; parameters[11].Value = ""; parameters[12].Text = "@zffs"; parameters[12].Value = ""; parameters[13].Text = "@fpid"; parameters[13].Value = ""; parameters[14].Text = "@klx"; parameters[14].Value = 0; DataTable tb = InstanceForm.BDatabase.GetDataTable("SP_MZSF_CX_FPCX", parameters, 30); dgvFP.AutoGenerateColumns = false; dgvFP.DataSource = tb; }