コード例 #1
0
        public override bool Run(string client_msg, ref Transaction trans, ref bool IsTerm, ref string buffer_response)
        {
            if (client_msg.Length < 69)
            {
                return(false);
            }

            POS_Entrada pe = new POS_Entrada();

            pe.set_st_terminal(client_msg.Substring(6, 8));
            pe.set_vr_valor(client_msg.Substring(57, 12));

            if (pe.get_st_terminal().StartsWith("1"))
            {
                pe.set_st_nsuOrigemSITEF(client_msg.Substring(200, 6));

                exec_pos_desfazVendaEmpresarialSITEF tr = new exec_pos_desfazVendaEmpresarialSITEF(trans);

                tr.input_cont_pe = pe;
                tr.RunOnline();
                buffer_response = util.Get_POS_Buffer(tr.output_cont_pr, tr.output_st_msg);
                IsTerm          = true;
                return(true);
            }
            else
            {
                exec_pos_desfazVendaEmpresarial tr = new exec_pos_desfazVendaEmpresarial(trans);
                tr.input_cont_pe = pe;
                tr.RunOnline();

                buffer_response = util.Get_POS_Buffer(tr.output_cont_pr, tr.output_st_msg);
                IsTerm          = true;
                return(true);
            }
        }
コード例 #2
0
        public override bool Run(string client_msg, ref Transaction trans, ref bool IsTerm, ref string buffer_response)
        {
            if (client_msg.Length < 61)
            {
                return(false);
            }

            string trilha = client_msg.Substring(14, 27);

            POS_Entrada pe = new POS_Entrada();

            pe.set_st_terminal(client_msg.Substring(6, 8));

            pe.set_st_empresa(trilha.Substring(6, 6));
            pe.set_st_matricula(trilha.Substring(12, 6));
            pe.set_st_titularidade(trilha.Substring(18, 2));

            exec_pos_confirmaVendaEmpresarial tr = new exec_pos_confirmaVendaEmpresarial(trans);

            tr.input_cont_pe = pe;
            tr.input_st_nsu  = client_msg.Substring(41, 6);

            tr.RunOnline();

            IsTerm = true;

            buffer_response = util.Get_POS_Buffer(tr.output_cont_pr, tr.output_st_msg);

            return(true);
        }
コード例 #3
0
        public void call_exec_pos_vendaEmpresarial(ref POS_Entrada pe)
        {
            m_Comm.Clear();

            DataPortable send_dp_cont_0 = new DataPortable();

            send_dp_cont_0.MapTagContainer(COMM_IN_EXEC_POS_VENDAEMPRESARIAL.pe, pe as DataPortable);

            m_Comm.AddEntryPortable(ref send_dp_cont_0);
        }
コード例 #4
0
        public override bool Run(string client_msg, ref Transaction trans, ref bool IsTerm, ref string buffer_response)
        {
            if (client_msg.Length < 71)
            {
                return(false);
            }

            POS_Entrada pe = new POS_Entrada();

            pe.set_st_terminal(client_msg.Substring(6, 8));

            string trilha = client_msg.Substring(14, 27);

            pe.set_st_empresa(trilha.Substring(6, 6));
            pe.set_st_matricula(trilha.Substring(12, 6));
            pe.set_st_titularidade(trilha.Substring(18, 2));

            pe.set_st_senha(client_msg.Substring(41, 16));
            pe.set_vr_valor(client_msg.Substring(57, 12));
            pe.set_nu_parcelas(client_msg.Substring(69, 2));
            pe.set_st_valores(client_msg.Substring(71));

            if (client_msg.Length > 200)
            {
                pe.set_st_terminalSITEF(client_msg.Substring(200, 8));  // veio do sitef
                pe.set_st_nsuOrigemSITEF(client_msg.Substring(208, 6)); // veio do sitef
            }

            // ajustado
            if (pe.get_st_terminal().StartsWith("1"))
            {
                exec_pos_vendaEmpresarialSITEF tr = new exec_pos_vendaEmpresarialSITEF(trans);

                tr.input_cont_pe = pe;
                tr.RunOnline();

                IsTerm = tr.IsFail;

                buffer_response = util.Get_POS_Buffer(tr.output_cont_pr, tr.output_st_msg);

                return(true);
            }
            else
            {
                exec_pos_vendaEmpresarial tr = new exec_pos_vendaEmpresarial(trans);

                tr.input_cont_pe = pe;
                tr.RunOnline();

                IsTerm          = tr.IsFail;
                buffer_response = util.Get_POS_Buffer(tr.output_cont_pr, tr.output_st_msg);

                return(true);
            }
        }
コード例 #5
0
        public void call_exec_pos_confirmaVendaEmpresarial(string st_nsu, ref POS_Entrada pe)
        {
            m_Comm.Clear();

            DataPortable send_dp = new DataPortable();

            send_dp.MapTagValue(COMM_IN_EXEC_POS_CONFIRMAVENDAEMPRESARIAL.st_nsu, st_nsu);

            m_Comm.AddEntryPortable(ref send_dp);

            DataPortable send_dp_cont_0 = new DataPortable();

            send_dp_cont_0.MapTagContainer(COMM_IN_EXEC_POS_CONFIRMAVENDAEMPRESARIAL.pe, pe as DataPortable);

            m_Comm.AddEntryPortable(ref send_dp_cont_0);
        }
コード例 #6
0
        public override bool Run(string client_msg, ref Transaction trans, ref bool IsTerm, ref string buffer_response)
        {
            if (client_msg.Length < 71)
            {
                return(false);
            }

            POS_Entrada pe = new POS_Entrada();

            pe.set_st_terminal(client_msg.Substring(6, 8));

            string trilha = client_msg.Substring(14, 27);

            pe.set_st_empresa(trilha.Substring(6, 6));
            pe.set_st_matricula(trilha.Substring(12, 6));
            pe.set_st_titularidade(trilha.Substring(18, 2));

            pe.set_st_senha(client_msg.Substring(41, 16));
            pe.set_vr_valor(client_msg.Substring(57, 12));
            pe.set_nu_parcelas(client_msg.Substring(69, 2));
            pe.set_st_valores(client_msg.Substring(71));

            pe.set_st_senha(pe.get_st_senha().Substring(12, 4));

            exec_pos_vendaEmpresarial tr = new exec_pos_vendaEmpresarial(trans);

            tr.input_cont_pe = pe;
            tr.IsDigitado    = true;

            tr.RunOnline();

            if (tr.IsFail)
            {
                IsTerm = true;
            }
            else
            {
                IsTerm = false;
            }

            buffer_response = util.Get_POS_Buffer(tr.output_cont_pr, tr.output_st_msg);

            return(true);
        }
コード例 #7
0
        public override bool Run(string client_msg, ref Transaction trans, ref bool IsTerm, ref string buffer_response)
        {
            if (client_msg.Length < 60)
            {
                return(false);
            }

            string trilha = client_msg.Substring(14, 27);

            POS_Entrada pe = new POS_Entrada();

            pe.set_st_terminal(client_msg.Substring(6, 8));
            pe.set_st_senha(client_msg.Substring(14, 16));
            pe.set_st_empresa(trilha.Substring(6, 6));
            pe.set_st_matricula(trilha.Substring(12, 6));
            pe.set_st_titularidade(trilha.Substring(18, 2));

            string nsuRCB   = client_msg.Substring(41, 6);
            string nsuBanco = client_msg.Substring(47, 14);

            if (client_msg.Length > 200)
            {
                pe.set_st_terminalSITEF(client_msg.Substring(200)); // veio do sitef
            }
            exec_pos_cancelaVendaEmpresarial tr = new exec_pos_cancelaVendaEmpresarial(trans);

            tr.input_st_nsu_cancel = nsuRCB;
            tr.input_cont_pe       = pe;

            tr.RunOnline();

            buffer_response = util.Get_POS_BufferCancela(tr.output_cont_pr,
                                                         nsuRCB,
                                                         nsuBanco,
                                                         tr.valor,
                                                         tr.dt_orig,
                                                         tr.output_st_msg);

            IsTerm = true;

            return(true);
        }
コード例 #8
0
        public void call_exec_pos_cancelaVendaEmpresarial(string st_nsu_cancel, string dt_hoje, string id_user, ref POS_Entrada pe)
        {
            m_Comm.Clear();

            DataPortable send_dp = new DataPortable();

            send_dp.MapTagValue(COMM_IN_EXEC_POS_CANCELAVENDAEMPRESARIAL.st_nsu_cancel, st_nsu_cancel);
            send_dp.MapTagValue(COMM_IN_EXEC_POS_CANCELAVENDAEMPRESARIAL.dt_hoje, dt_hoje);
            send_dp.MapTagValue(COMM_IN_EXEC_POS_CANCELAVENDAEMPRESARIAL.id_user, id_user);

            m_Comm.AddEntryPortable(ref send_dp);

            DataPortable send_dp_cont_0 = new DataPortable();

            send_dp_cont_0.MapTagContainer(COMM_IN_EXEC_POS_CANCELAVENDAEMPRESARIAL.pe, pe as DataPortable);

            m_Comm.AddEntryPortable(ref send_dp_cont_0);
        }
コード例 #9
0
/// USER [ custom_functions ]
/// USER [ custom_functions ] END

        public bool Item1()
        {
            #region - INPUT VARS -

            transaction.MemoryClean();

            tst_unit.LogTest("exec_pos_cancelaVendaEmpresarial Item1", ref m_Log);

            transaction.ut_abort = 0;

            string st_nsu_cancel = "";
            string dt_hoje       = "";
            string id_user       = "";

            POS_Entrada pe = new POS_Entrada();

            #endregion

/// USER [ setup_test_1 ]
/// USER [ setup_test_1 ] END

            #region - MAPPING TRANSACTION -

            call_exec_pos_cancelaVendaEmpresarial(st_nsu_cancel, dt_hoje, id_user, ref pe);

            if (transaction.setup() == false)
            {
                return(false);
            }

            try
            {
                #endregion

/// USER [ execute_1 ]
/// USER [ execute_1 ] END

                #region - OUTPUT VARS -
            }
            catch (System.Exception se)
            {
                if (se.Message != "ABORT")
                {
                    MessageBox.Show(se.ToString());
                }
            }

            if (transaction.finish() == false)
            {
                return(false);
            }

            string       st_msg = "";
            POS_Resposta pr     = new POS_Resposta();

            recv_exec_pos_cancelaVendaEmpresarial(ref st_msg, ref pr);

            transaction.sendObjections(ref my_objections);

            #endregion

/// USER [ validate_1 ]
/// USER [ validate_1 ] END

            pr.Clear();

            return(true);
        }
コード例 #10
0
        public override bool execute( )
        {
            if (base.execute() == false)
            {
                return(false);
            }

            Registry("execute exec_venda_pend_lojista ");

            /// USER [ execute ]

            T_Cartao cart = new T_Cartao(this);

            if (!cart.select_rows_tudo(input_st_cartao.Substring(0, 6),
                                       input_st_cartao.Substring(6, 6),
                                       input_st_cartao.Substring(12, 2)))
            {
                PublishError("Cartão inválido");
                return(false);
            }

            if (!cart.fetch())
            {
                return(false);
            }

            POS_Entrada pe = new POS_Entrada();

            pe.set_st_senha(cart.get_st_senha());
            pe.set_st_empresa(input_st_cartao.Substring(0, 6));
            pe.set_st_matricula(input_st_cartao.Substring(6, 6));
            pe.set_st_titularidade(input_st_cartao.Substring(12, 2));
            pe.set_vr_valor(input_vr_valor.PadLeft(12, '0'));
            pe.set_st_terminal(input_cont_header.get_nu_terminal());
            pe.set_nu_parcelas("1");
            pe.set_st_valores(input_vr_valor.PadLeft(12, '0'));

            exec_pos_vendaEmpresarial epv = new exec_pos_vendaEmpresarial(this);

            epv.input_cont_pe = pe;

            if (!epv.RunOnline())
            {
                PublishError(epv.output_st_msg);
                return(false);
            }

            exec_pos_confirmaVendaEmpresarial epcve = new exec_pos_confirmaVendaEmpresarial(this);

            epcve.input_cont_pe = pe;
            epcve.input_st_nsu  = epv.output_cont_pr.get_st_nsuRcb();

            if (!epcve.RunOnline())
            {
                PublishError(epcve.output_st_msg);
                return(false);
            }

            PublishNote("Venda offline confirmada");

            /// USER [ execute ] END

            Registry("execute done exec_venda_pend_lojista ");

            return(true);
        }