Example #1
0
        /// <summary>
        /// 补打火化证明(带身份证)
        /// </summary>
        /// <param name="ac001"></param>
        public static void Print_HHZM_BD2(string ac001, DateTime birth)
        {
            StringBuilder   sb_1       = new StringBuilder(200);
            OracleCommand   oc_command = new OracleCommand("select * from V_PRINT_HHZM where ac001 = :ac001", SqlHelper.conn);
            OracleParameter op_ac001   = new OracleParameter("ac001", OracleDbType.Varchar2, 10);

            op_ac001.Direction = ParameterDirection.Input;
            op_ac001.Value     = ac001;
            oc_command.Parameters.Add(op_ac001);

            OracleDataReader reader = oc_command.ExecuteReader();

            if (reader.HasRows && reader.Read())
            {
                sb_1.Append(reader["AC003"].ToString() + PADSTR);                  //逝者姓名
                sb_1.Append(reader["AC002"].ToString() + PADSTR);                  //逝者性别

                //所属区县
                if (reader["AC007"] == null || reader["AC007"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);
                }
                else
                {
                    sb_1.Append(MiscAction.Mapper_DD(reader["AC007"].ToString()) + PADSTR);
                }

                sb_1.Append(reader["AC014"].ToString() + PADSTR);                     //身份证号
                sb_1.Append(reader["FIRETIME"].ToString() + PADSTR);                  //火化日期

                //死亡原因
                if (reader["AC005"] == null || reader["AC005"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);
                }
                else
                {
                    sb_1.Append(reader["AC005"].ToString() + PADSTR);
                }

                //经办日期
                sb_1.Append(string.Format("{0:yyyy年MM月dd日}", MiscAction.GetServerTime()) + PADSTR);
                sb_1.Append(string.Format("{0:yyyy年MM月dd日}", birth) + PADSTR);

                Send_PrintData printData = new Send_PrintData();
                printData.command = "hhzm_bd2";
                printData.data    = sb_1.ToString();
                Frm_main.socket.sendMsg(Tool.ConvertObjectToJson(printData));
            }
            else
            {
                XtraMessageBox.Show("未找到数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            reader.Dispose();
            oc_command.Dispose();
        }
Example #2
0
        /// <summary>
        /// 打印收款凭证(寄存收费)
        /// </summary>
        /// <param name="fa001"></param>
        public static void Print_Skpz1(string fa001)
        {
            //结算数据
            OracleCommand   oc_jsd   = new OracleCommand("select * from v_fa01 where fa001= :fa001", SqlHelper.conn);
            OracleParameter op_fa001 = new OracleParameter("fa001", OracleDbType.Varchar2, 10);

            op_fa001.Direction = ParameterDirection.Input;
            op_fa001.Value     = fa001;

            OracleParameter op_sa010 = new OracleParameter("sa010", OracleDbType.Varchar2, 10);

            op_sa010.Direction = ParameterDirection.Input;
            op_sa010.Value     = fa001;

            oc_jsd.Parameters.Add(op_fa001);
            //结算明细数据
            OracleCommand oc_detail = new OracleCommand("select * from v_sa01 where sa010= :sa010", SqlHelper.conn);

            oc_detail.Parameters.Add(op_sa010);

            OracleDataReader reader  = oc_jsd.ExecuteReader();
            OracleDataReader reader2 = oc_detail.ExecuteReader();

            string s_skr    = string.Empty;
            string s_skrq   = string.Empty;
            string s_cuname = string.Empty;
            string s_memo   = string.Empty;
            int    i_count  = 0;

            if (reader.HasRows && reader.Read())
            {
                StringBuilder sb_1 = new StringBuilder(100);
                while (reader2.Read())
                {
                    sb_1.Append(reader2["SA002"].ToString() + PADSTR);                                                 // 服务商品类别
                    sb_1.Append(reader2["SA003"].ToString() + PADSTR);                                                 // 服务或商品名
                    sb_1.Append(reader2["PRICE"].ToString() + PADSTR);                                                 // 单价
                    sb_1.Append(reader2["NUMS"].ToString() + PADSTR);                                                  // 数量
                    sb_1.Append(reader2["SA007"].ToString() + PADSTR);                                                 // 销售金额
                    sb_1.Append(PADSTR2);
                    i_count++;
                }

                s_skr    = MiscAction.Mapper_Operator(reader["FA100"].ToString());
                s_skrq   = string.Format("{0:yyyyMMdd}", reader["FA200"]);
                s_cuname = reader["FA003"].ToString();

                Send_PrintData printData = new Send_PrintData();
                printData.command = "print_skpz1";
                printData.data    = sb_1.ToString();

                printData.extra1 = s_cuname;
                printData.extra2 = s_skr;
                printData.extra3 = s_skrq;
                printData.extra4 = RegAction.GetRegFinMemo(fa001);

                //i_pages = (int)Math.Ceiling(i_count / (App_Const.BILL_COUNT * 1.0));
                //XtraMessageBox.Show("现在开始打印【结算单】,共需要" + i_pages.ToString() + "张!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Frm_main.socket.sendMsg(Tool.ConvertObjectToJson(printData));
            }
            else
            {
                MessageBox.Show("未找到结算数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            reader.Dispose();
            reader2.Dispose();
            oc_jsd.Dispose();
        }