Esempio n. 1
0
 public void copy(ref LOG_Chamado cpy)
 {
     fk_chamado  = cpy.fk_chamado;
     fk_operador = cpy.fk_operador;
     st_solucao  = cpy.st_solucao;
     dt_solucao  = cpy.dt_solucao;
 }
Esempio n. 2
0
        public override bool execute( )
        {
            if (base.execute() == false)
            {
                return(false);
            }

            Registry("execute ins_chamado ");

            /// USER [ execute ]

            T_Chamado cham = new T_Chamado(this);

            cham.set_dt_abertura(GetDataBaseTime());
            cham.set_fk_loja(loj.get_identity());
            cham.set_fk_operador(user.get_identity());
            cham.set_fk_oper_criador(user.get_identity());
            cham.set_tg_fechado(Context.FALSE);
            cham.set_nu_prioridade(input_cont_dc.get_nu_prioridade());
            cham.set_nu_categoria(input_cont_dc.get_nu_categ());
            cham.set_st_motivo(input_cont_dc.get_st_motivo());
            cham.set_tg_tecnico(input_cont_dc.get_tg_tecnico());

            if (!cham.create_T_Chamado())
            {
                return(false);
            }

            LOG_Chamado l_c = new LOG_Chamado(this);

            l_c.set_fk_chamado(cham.get_identity());
            l_c.set_fk_operador(user.get_identity());
            l_c.set_dt_solucao(cham.get_dt_abertura());
            l_c.set_st_solucao("## Criação do chamado");

            if (!l_c.create_LOG_Chamado())
            {
                return(false);
            }

            PublishNote("Chamado criado com sucesso!");

            /// USER [ execute ] END

            Registry("execute done ins_chamado ");

            return(true);
        }
Esempio n. 3
0
        public override bool execute( )
        {
            if (base.execute() == false)
            {
                return(false);
            }

            Registry("execute exec_alteraChamado ");

            /// USER [ execute ]

            T_Chamado   cham      = new T_Chamado(this);
            T_Usuario   usrConvey = new T_Usuario(this);
            LOG_Chamado l_c       = new LOG_Chamado(this);

            if (input_tg_fechado == Context.TRUE)
            {
                cham.ExclusiveAccess();
            }

            if (!cham.selectIdentity(input_id_chamado))
            {
                return(false);
            }

            if (cham.get_tg_fechado() == Context.TRUE)
            {
                PublishError("Chamado fechado não pode ser alterado");
                return(false);
            }

            if (!usrConvey.select_rows_login(input_st_operador, "000000"))
            {
                PublishError("Usuário inexistente");
                return(false);
            }

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

            l_c.set_fk_chamado(cham.get_identity());
            l_c.set_fk_operador(user.get_identity());
            l_c.set_st_solucao(input_st_new_desc);
            l_c.set_dt_solucao(GetDataBaseTime());

            if (!l_c.create_LOG_Chamado())
            {
                return(false);
            }

            cham.set_tg_fechado(input_tg_fechado);
            cham.set_fk_operador(usrConvey.get_identity());

            if (input_tg_fechado == Context.TRUE)
            {
                cham.set_dt_fechamento(GetDataBaseTime());
            }

            if (!cham.synchronize_T_Chamado())
            {
                return(false);
            }

            if (input_tg_fechado == Context.TRUE)
            {
                l_c.set_st_solucao("## Chamado fechado");

                if (!l_c.create_LOG_Chamado())
                {
                    return(false);
                }
            }

            PublishNote("Chamado alterado com sucesso");

            /// USER [ execute ] END

            Registry("execute done exec_alteraChamado ");

            return(true);
        }
Esempio n. 4
0
        public override bool execute( )
        {
            if (base.execute() == false)
            {
                return(false);
            }

            Registry("execute fetch_chamadoHist ");

            /// USER [ execute ]

            T_Chamado   cham      = new T_Chamado(this);
            T_Loja      loj       = new T_Loja(this);
            T_Usuario   usrConvey = new T_Usuario(this);
            LOG_Chamado l_c       = new LOG_Chamado(this);

            if (!cham.selectIdentity(input_id_chamado))
            {
                return(false);
            }

            if (!loj.selectIdentity(cham.get_fk_loja()))
            {
                return(false);
            }

            if (!usrConvey.selectIdentity(cham.get_fk_operador()))
            {
                return(false);
            }

            output_cont_dc.set_st_cod_loja(loj.get_st_loja());
            output_cont_dc.set_st_nome_loja(loj.get_st_nome());
            output_cont_dc.set_st_motivo(cham.get_st_motivo());
            output_cont_dc.set_st_oper(usrConvey.get_st_nome());
            output_cont_dc.set_nu_categ(cham.get_nu_categoria());
            output_cont_dc.set_tg_fechado(cham.get_tg_fechado());
            output_cont_dc.set_dt_ab(cham.get_dt_abertura());
            output_cont_dc.set_dt_fech(cham.get_dt_fechamento());

            if (l_c.select_fk_chamado(cham.get_identity()))
            {
                l_c.SetReversedFetch();

                while (l_c.fetch())
                {
                    if (!usrConvey.selectIdentity(l_c.get_fk_operador()))
                    {
                        return(false);
                    }

                    DadosAlteracaoChamado dac = new DadosAlteracaoChamado();

                    dac.set_dt_alt(l_c.get_dt_solucao());
                    dac.set_st_oper_alt(usrConvey.get_st_nome());
                    dac.set_st_desc_alt(l_c.get_st_solucao());

                    output_array_generic_lst.Add(dac);
                }
            }

            /// USER [ execute ] END

            Registry("execute done fetch_chamadoHist ");

            return(true);
        }