Пример #1
0
        public static void Print_PayRecord(string fa001)
        {
            int i_order = RegAction.GetPayTimes(fa001);

            StringBuilder   sb_1       = new StringBuilder(200);
            OracleCommand   oc_command = new OracleCommand("select * from rc04 where rc010 = :fa001", SqlHelper.conn);
            OracleParameter op_fa001   = new OracleParameter("fa001", OracleDbType.Varchar2, 10);

            op_fa001.Direction = ParameterDirection.Input;
            op_fa001.Value     = fa001;
            oc_command.Parameters.Add(op_fa001);
            OracleDataReader reader = oc_command.ExecuteReader();

            if (reader.HasRows && reader.Read())
            {
                int i_times = i_order % App_Const.PAYPAGECOUNT;

                if (i_times == 1 && i_order > 1)
                {
                    XtraMessageBox.Show("需要更换新证!请先将新证放入打印机打印基础信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Print_RegCardBase(reader["RC001"].ToString());
                }

                if (i_times == 0)
                {
                    i_times = App_Const.PAYPAGECOUNT;
                }

                sb_1.Append(string.Format("{0:yyyyMMdd}", reader["RC200"]) + PADSTR);   //经办日期
                sb_1.Append(string.Format("{0:yyyy-MM-dd}", reader["RC020"]) + PADSTR); //缴费开始
                sb_1.Append(string.Format("{0:yyyy-MM-dd}", reader["RC022"]) + PADSTR); //缴费终止

                string s_handler      = reader["RC100"].ToString();                     //经办人
                string s_handler_code = SqlHelper.ExecuteScalar("select uc002 from uc01 where uc001='" + s_handler + "'").ToString();

                sb_1.Append(s_handler_code + PADSTR);                            //经办人代码
                sb_1.Append("第" + i_order.ToString() + "次" + PADSTR);

                Send_PrintData printData = new Send_PrintData();
                printData.command = "payrecord";
                printData.data    = sb_1.ToString();
                printData.extra1  = i_times.ToString();

                Frm_main.socket.sendMsg(Tool.ConvertObjectToJson(printData));
            }
            reader.Dispose();
            oc_command.Dispose();
        }
Пример #2
0
        /// <summary>
        /// 打印寄存证(基础)
        /// </summary>
        /// <param name="rc001"></param>
        public static void Print_RegCardBase(string rc001)
        {
            StringBuilder   sb_1       = new StringBuilder(200);
            OracleCommand   oc_command = new OracleCommand("select * from rc01 where rc001 = :rc001", SqlHelper.conn);
            OracleParameter op_rc001   = new OracleParameter("rc001", OracleDbType.Varchar2, 10);

            op_rc001.Direction = ParameterDirection.Input;
            op_rc001.Value     = rc001;
            oc_command.Parameters.Add(op_rc001);
            OracleDataReader reader = oc_command.ExecuteReader();

            if (reader.HasRows && reader.Read())
            {
                sb_1.Append(reader["RC003"].ToString() + PADSTR);                  //逝者姓名
                sb_1.Append(reader["RC109"].ToString() + PADSTR);                  //寄存证号

                if (reader["RC002"] == null || reader["RC002"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //性别
                }
                else
                {
                    sb_1.Append(reader["RC002"].ToString() + PADSTR);
                }

                if (reader["RC004"] == null || reader["RC004"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //年龄
                }
                else
                {
                    sb_1.Append(reader["RC004"].ToString() + PADSTR);
                }
                //寄存位置
                string s_position = RegAction.GetRegPosition(reader["RC001"].ToString());
                if (string.IsNullOrEmpty(s_position))
                {
                    sb_1.Append("" + PADSTR);
                }
                else
                {
                    sb_1.Append(s_position + PADSTR);
                }

                if (reader["RC050"] == null || reader["RC050"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //联系人
                }
                else
                {
                    sb_1.Append(reader["RC050"].ToString() + PADSTR);
                }

                if (reader["RC051"] == null || reader["RC051"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //联系电话
                }
                else
                {
                    sb_1.Append(reader["RC051"].ToString() + PADSTR);
                }

                if (reader["RC200"] == null || reader["RC200"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //经办日期
                }
                else
                {
                    sb_1.Append(string.Format("{0:yyyy年MM月dd日}", reader["RC200"]) + PADSTR);
                }

                if (reader["RC055"] == null || reader["RC055"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //联系地址
                }
                else
                {
                    sb_1.Append(reader["RC055"].ToString() + PADSTR);
                }

                if (reader["RC140"] == null || reader["RC140"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //寄存日期
                }
                else
                {
                    sb_1.Append(string.Format("{0:yyyy-MM-dd}", reader["RC140"]) + PADSTR);
                }


                DateTime d_end = Convert.ToDateTime(SqlHelper.ExecuteScalar("select min(rc022) from rc04 where status = '1' and rc001 = '" + rc001 + "'"));
                if (d_end == null)
                {
                    sb_1.Append("" + PADSTR);                                          //截至日期
                }
                else
                {
                    sb_1.Append(string.Format("{0:yyyy-MM-dd}", d_end) + PADSTR);
                }

                decimal price = RegAction.GetRegPrice(rc001);
                sb_1.Append(price.ToString() + PADSTR);

                Send_PrintData printData = new Send_PrintData();
                printData.command = "RegCardBase";
                printData.data    = sb_1.ToString();
                Frm_main.socket.sendMsg(Tool.ConvertObjectToJson(printData));
            }
            reader.Dispose();
            oc_command.Dispose();
        }
Пример #3
0
        /// <summary>
        /// 打印骨灰安放卡
        /// </summary>
        /// <param name="rc001"></param>
        public static void Print_RegSettle(string rc001)
        {
            StringBuilder   sb_1       = new StringBuilder(200);
            OracleCommand   oc_command = new OracleCommand("select * from rc01 where rc001 = :rc001", SqlHelper.conn);
            OracleParameter op_rc001   = new OracleParameter("rc001", OracleDbType.Varchar2, 10);

            op_rc001.Direction = ParameterDirection.Input;
            op_rc001.Value     = rc001;
            oc_command.Parameters.Add(op_rc001);
            OracleDataReader reader = oc_command.ExecuteReader();

            if (reader.HasRows && reader.Read())
            {
                sb_1.Append(reader["RC003"].ToString() + PADSTR);                  //逝者姓名
                sb_1.Append(reader["RC109"].ToString() + PADSTR);                  //寄存证号

                if (reader["RC002"] == null || reader["RC002"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //性别
                }
                else
                {
                    sb_1.Append(reader["RC002"].ToString() + PADSTR);
                }

                if (reader["RC004"] == null || reader["RC004"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //年龄
                }
                else
                {
                    sb_1.Append(reader["RC004"].ToString() + PADSTR);
                }

                //寄存位置
                string s_position = RegAction.GetRegPosition(reader["RC001"].ToString());
                if (string.IsNullOrEmpty(s_position))
                {
                    sb_1.Append("" + PADSTR);
                }
                else
                {
                    sb_1.Append(s_position + PADSTR);
                }

                if (reader["RC050"] == null || reader["RC050"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //联系人
                }
                else
                {
                    sb_1.Append(reader["RC050"].ToString() + PADSTR);
                }


                if (reader["RC051"] == null || reader["RC051"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //联系电话
                }
                else
                {
                    sb_1.Append(reader["RC051"].ToString() + PADSTR);
                }


                if (reader["RC052"] == null || reader["RC052"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //与逝者关系
                }
                else
                {
                    sb_1.Append(reader["RC052"].ToString() + PADSTR);
                }

                if (reader["RC200"] == null || reader["RC200"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //经办日期
                }
                else
                {
                    sb_1.Append(string.Format("{0:yyyy年MM月dd日}", reader["RC200"]) + PADSTR);
                }

                if (reader["RC055"] == null || reader["RC055"] is DBNull)
                {
                    sb_1.Append("" + PADSTR);                                          //联系地址
                }
                else
                {
                    sb_1.Append(reader["RC055"].ToString() + PADSTR);
                }


                Send_PrintData printData = new Send_PrintData();
                printData.command = "RegSettleCard";
                printData.data    = sb_1.ToString();
                Frm_main.socket.sendMsg(Tool.ConvertObjectToJson(printData));
            }
            reader.Dispose();
            oc_command.Dispose();
        }
Пример #4
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();
        }