public override bool execute( ) { if (base.execute() == false) { return(false); } Registry("execute exec_cancelaChequeGift "); /// USER [ execute ] T_ChequesGift chq = new T_ChequesGift(this); chq.ExclusiveAccess(); if (!chq.select_rows_ident(input_st_ident)) { PublishError("Cheque não disponível"); return(false); } if (!chq.fetch()) { return(false); } if (chq.get_tg_compensado() != Context.FALSE && // aguardando chq.get_tg_compensado() != Context.TRUE) // compensado { PublishError("Cheque previamente cancelado"); return(false); } else if (chq.get_tg_compensado() == Context.TRUE) // compensado { PublishError("Não é possível cancelar cheque compensado"); return(false); } chq.set_tg_compensado("2"); if (!chq.synchronize_T_ChequesGift()) { return(false); } PublishNote("Cheque " + input_st_ident + " cancelado"); /// USER [ execute ] END Registry("execute done exec_cancelaChequeGift "); return(true); }
public override bool execute( ) { if (base.execute() == false) { return(false); } Registry("execute fetch_chequeGift "); /// USER [ execute ] T_ChequesGift chq = new T_ChequesGift(this); if (!chq.select_rows_ident(input_st_ident)) { PublishError("Cheque não disponível"); return(false); } if (!chq.fetch()) { return(false); } T_Cartao cart = new T_Cartao(this); if (!cart.selectIdentity(chq.get_fk_cartao())) { return(false); } T_Proprietario prot = new T_Proprietario(this); if (!prot.selectIdentity(cart.get_fk_dadosProprietario())) { return(false); } output_st_dados += "Nome: " + prot.get_st_nome() + "@"; output_st_dados += "CPF: " + prot.get_st_cpf() + "@"; output_st_dados += "Valor do cheque: R$ " + new money().formatToMoney(chq.get_vr_valor()) + "@@"; output_st_dados += "Situação: "; if (chq.get_tg_compensado() == Context.FALSE) { output_st_dados += "Aguardando confirmação de depósito"; } else if (chq.get_tg_compensado() == Context.TRUE) { output_st_dados += "Depósito confirmado"; } else // 2 { output_st_dados += "Cheque cancelado"; } /// USER [ execute ] END Registry("execute done fetch_chequeGift "); return(true); }