/// <summary> /// 打印寄存 续存记录 /// </summary> /// <param name="settleId"></param> public static void PrtRegisterPayRecord(string settleId, int whandle) { string sql = @"select max(rc200) rc200, min(rc020) rc020, max(rc022) rc022, sum(nums) nums, sum(rc030) rc030, min(rc100) rc100, rc001, rc010 from rc04 where rc010 = :rc010 group by rc001,rc010"; OracleCommand oc_command = new OracleCommand(sql, SqlAssist.conn); OracleParameter op_rc010 = new OracleParameter("rc010", OracleDbType.Varchar2, 10); op_rc010.Direction = ParameterDirection.Input; op_rc010.Value = settleId; oc_command.Parameters.Add(op_rc010); OracleDataReader reader = oc_command.ExecuteReader(); StringBuilder sb_1 = new StringBuilder(100); if (reader.HasRows && reader.Read()) { string s_jbrq = string.Format("{0:yyyy-MM-dd}", reader["RC200"]); string s_begin = string.Format("{0:yyyy-MM-dd}", reader["RC020"]); string s_end = string.Format("{0:yyyy-MM-dd}", reader["RC022"]); string s_rc001 = reader["RC001"].ToString(); sb_1.Append(s_jbrq + "\t"); // 经办日期 sb_1.Append(s_begin + "\t"); // 寄存开始日期 sb_1.Append(s_end + "\t"); // 寄存终止日期 sb_1.Append(RegisterAction.isIncludeLamp(settleId)? "送灯\t" : reader["NUMS"].ToString() + "\t"); // 缴费年限 sb_1.Append(reader["RC030"].ToString() + "\t"); // 缴费金额 sb_1.Append(MiscAction.Mapper_operator(reader["RC100"].ToString()) + "\t"); //经办人 short i_order = Convert.ToSByte(SqlAssist.ExecuteScalar("select count(*) from v_rc04 where rc001 ='" + s_rc001 + "' and rc010 < '" + settleId + "'")); try { int commandNum = GenNewCommandNum(); SendPrtCommand(Envior.prtConnId, whandle, commandNum, "Register_Payrecord", sb_1.ToString(), (i_order + 1).ToString() ); } catch (Exception ee) { XtraMessageBox.Show(ee.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { XtraMessageBox.Show("未找到数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } reader.Dispose(); oc_command.Dispose(); }
/// <summary> /// 打印骨灰寄存证 (初次) 包括原始登记 /// </summary> /// <param name="rc001"></param> /// <param name="settleId"></param> public static void PrtRegisterCert(string rc001, string settleId, int whandle) { OracleCommand oc_base = new OracleCommand("select * from v_print_regcert where rc001= :rc001", SqlAssist.conn); OracleParameter op_rc001 = new OracleParameter("rc001", OracleDbType.Varchar2, 10); op_rc001.Direction = ParameterDirection.Input; op_rc001.Value = rc001; oc_base.Parameters.Add(op_rc001); OracleDataReader reader = oc_base.ExecuteReader(); OracleCommand oc_fin = new OracleCommand("select * from rc04 where rc010 = :rc010", SqlAssist.conn); OracleParameter op_rc010 = new OracleParameter("fa001", OracleDbType.Varchar2, 10); op_rc010.Direction = ParameterDirection.Input; op_rc010.Value = settleId; oc_fin.Parameters.Add(op_rc010); OracleDataReader reader2 = oc_fin.ExecuteReader(); try { if (reader.HasRows && reader.Read()) { StringBuilder sb_1 = new StringBuilder(100); sb_1.Append(reader["RC003"].ToString() + "\t"); // 逝者姓名 sb_1.Append(reader["RC109"].ToString() + "\t"); // 寄存证号 sb_1.Append(reader["POSITION"].ToString() + "\t"); // 寄存位置 sb_1.Append(reader["RC050"].ToString() + "\t"); // 联系人 sb_1.Append(reader["RC052"].ToString() + "\t"); // 与逝者关系 sb_1.Append(reader["LXFS"].ToString() + "\t"); // 电话、地址 sb_1.Append(reader["RC200"].ToString() + "\t"); // 经办日期 sb_1.Append(reader["UNITNAME"].ToString() + "\t"); // 单位名称 reader2.Read(); if (reader2.HasRows) { sb_1.Append(string.Format("{0:yyyy-MM-dd}", reader2["RC020"]) + "\t"); // 开始日期 sb_1.Append(string.Format("{0:yyyy-MM-dd}", reader2["RC022"]) + "\t"); // 终止日期 if (RegisterAction.isIncludeLamp(settleId)) { sb_1.Append("送灯" + "\t"); } else { sb_1.Append(reader2["NUMS"].ToString() + "\t"); // 年限 } sb_1.Append(reader2["RC030"].ToString() + "\t"); // 缴费金额 } else { sb_1.Append("" + "\t"); // 开始日期 sb_1.Append("" + "\t"); // 终止日期 sb_1.Append("" + "\t"); // 年限 sb_1.Append("" + "\t"); // 缴费金额 } sb_1.Append(reader["RC100"].ToString() + "\t"); // 经办人 sb_1.Append(reader["UNITTELE"].ToString() + "\t"); // 业务电话 XtraMessageBox.Show(sb_1.ToString()); //if (Envior.prtserv.of_prtregistercert(sb_1.ToString()) > 0) //{ // XtraMessageBox.Show("打印成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); //} int commandNum = GenNewCommandNum(); SendPrtCommand(Envior.prtConnId, whandle, commandNum, "Register_Cert_First", sb_1.ToString(), " " ); } else { XtraMessageBox.Show("未找到数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ee) { MessageBox.Show("打印错误!\r\n" + ee.ToString(), "", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { reader.Dispose(); reader2.Dispose(); oc_base.Dispose(); oc_fin.Dispose(); } }