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