Beispiel #1
0
        public override bool execute( )
        {
            if (base.execute() == false)
            {
                return(false);
            }

            Registry("execute ins_terminal ");

            /// USER [ execute ]

            term.Reset();

            term.set_fk_loja(loj.get_identity());
            term.set_nu_terminal(my_term.ToString().PadLeft(8, '0'));
            term.set_st_localizacao(input_cont_dt.get_st_localizacao());

            if (!term.create_T_Terminal())
            {
                return(false);
            }

            PublishNote("Terminal criado com suceesso (" + my_term.ToString() + ")");

            /// USER [ execute ] END

            Registry("execute done ins_terminal ");

            return(true);
        }
Beispiel #2
0
        public override bool execute( )
        {
            if (base.execute() == false)
            {
                return(false);
            }

            Registry("execute del_Terminal ");

            /// USER [ execute ]

            input_st_terminal = input_st_terminal.PadLeft(8, '0');

            T_Terminal term_upd = new T_Terminal(this);

            while (term.fetch())
            {
                if (term.get_nu_terminal() == input_st_terminal)
                {
                    term_upd.ExclusiveAccess();

                    term_upd.selectIdentity(term.get_identity());

                    term_upd.set_fk_loja(Context.NONE);

                    if (!term_upd.synchronize_T_Terminal())
                    {
                        return(false);
                    }

                    term_upd.ReleaseExclusive();

                    PublishNote("Terminal " + input_st_terminal + " removido com sucesso");
                    return(true);
                }
            }

            /// USER [ execute ] END

            Registry("execute done del_Terminal ");

            return(true);
        }