Пример #1
0
/// USER [ custom_functions ]
/// USER [ custom_functions ] END

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

            transaction.MemoryClean();

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

            transaction.ut_abort = 0;

            CNetHeader header = new CNetHeader();

            #endregion

/// USER [ setup_test_1 ]

            string tmp_id = "";

            T_Futebol fut = new T_Futebol(my_transaction);

            fut.setup(true, ref tmp_id, "logotipo", "gr?mio");
            fut.setup(false, ref tmp_id, "logotipo", "inter");
            fut.setup(false, ref tmp_id, "logotipo", "caxias");
            fut.setup(false, ref tmp_id, "logotipo", "juventude");

            T_Profissoes pro = new T_Profissoes(my_transaction);

            pro.setup(true, ref tmp_id, "101", "analista de sistemas");
            pro.setup(false, ref tmp_id, "102", "programador");
            pro.setup(false, ref tmp_id, "103", "testador");
            pro.setup(false, ref tmp_id, "104", "projetista");

            T_ComoSoube cms = new T_ComoSoube(my_transaction);

            cms.setup(true, ref tmp_id, "revista");
            cms.setup(false, ref tmp_id, "jornal");
            cms.setup(false, ref tmp_id, "TV");
            cms.setup(false, ref tmp_id, "internet");

/// USER [ setup_test_1 ] END

            #region - MAPPING TRANSACTION -

            call_fetch_cadastros(ref header);

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

            try
            {
                #endregion

/// USER [ execute_1 ]

                if (!my_transaction.execute())
                {
                    return(false);
                }

/// 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_csv_futebol       = "";
            string st_csv_profissoes    = "";
            string st_csv_comoSoube     = "";
            string st_csv_futebol_id    = "";
            string st_csv_profissoes_id = "";
            string st_csv_comoSoube_id  = "";

            recv_fetch_cadastros(ref st_csv_futebol, ref st_csv_profissoes, ref st_csv_comoSoube, ref st_csv_futebol_id, ref st_csv_profissoes_id, ref st_csv_comoSoube_id);

            transaction.sendObjections(ref my_objections);

            #endregion

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

            return(true);
        }
Пример #2
0
        public override bool execute( )
        {
            if (base.execute() == false)
            {
                return(false);
            }

            Registry("execute fetch_cadastros ");

            /// USER [ execute ]

            StringBuilder build_fut    = new StringBuilder();
            StringBuilder build_fut_id = new StringBuilder();
            T_Futebol     fut          = new T_Futebol(this);

            if (fut.selectAll())
            {
                int max = fut.RowCount() - 1, cnt = 0;

                while (fut.fetch())
                {
                    ut_coverMark(1);

                    build_fut.Append(fut.get_st_nome());
                    build_fut_id.Append(fut.get_identity());

                    if (cnt++ < max)
                    {
                        build_fut.Append("|");
                        build_fut_id.Append("|");
                    }
                }

                output_st_csv_futebol    = build_fut.ToString();
                output_st_csv_futebol_id = build_fut_id.ToString();
            }

            StringBuilder build_pro    = new StringBuilder();
            StringBuilder build_pro_id = new StringBuilder();
            T_Profissoes  pro          = new T_Profissoes(this);

            if (pro.selectAll())
            {
                int max = pro.RowCount() - 1, cnt = 0;

                while (pro.fetch())
                {
                    ut_coverMark(2);

                    build_pro.Append(pro.get_st_codigo() + " - " + pro.get_st_profissao());
                    build_pro_id.Append(pro.get_identity());

                    if (cnt++ < max)
                    {
                        build_pro.Append("|");
                        build_pro_id.Append("|");
                    }
                }

                output_st_csv_profissoes    = build_pro.ToString();
                output_st_csv_profissoes_id = build_pro_id.ToString();
            }

            StringBuilder build_cms    = new StringBuilder();
            StringBuilder build_cms_id = new StringBuilder();
            T_ComoSoube   cms          = new T_ComoSoube(this);

            if (cms.selectAll())
            {
                int max = cms.RowCount() - 1, cnt = 0;

                while (cms.fetch())
                {
                    ut_coverMark(3);

                    build_cms.Append(cms.get_st_descricao());
                    build_cms_id.Append(cms.get_identity());

                    if (cnt++ < max)
                    {
                        build_cms.Append("|");
                        build_cms_id.Append("|");
                    }
                }

                output_st_csv_comoSoube    = build_cms.ToString();
                output_st_csv_comoSoube_id = build_cms_id.ToString();
            }

            /// USER [ execute ] END

            Registry("execute done fetch_cadastros ");

            return(true);
        }
Пример #3
0
 public void copy(ref T_Futebol cpy)
 {
     st_logotipo = cpy.st_logotipo;
     st_nome     = cpy.st_nome;
 }