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

            Registry("authenticate exec_alteraTerminal ");

            /// USER [ authenticate ]

            term = new T_Terminal(this);

            term.ExclusiveAccess();

            // ## Busca terminal pelo nome informado

            if (!term.select_rows_terminal(input_st_terminal))
            {
                PublishError("Terminal " + input_st_terminal + " não encontrado");
                return(false);
            }

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

            /// USER [ authenticate ] END

            Registry("authenticate done exec_alteraTerminal ");

            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);
        }