public override bool execute( ) { if (base.execute() == false) { return(false); } Registry("execute exec_repasseLoja "); /// USER [ execute ] loj = new T_Loja(this); if (!loj.select_rows_loja(input_st_codLoja)) { return(false); } if (!loj.fetch()) { return(false); } T_RepasseLoja rl = new T_RepasseLoja(this); rl.set_dt_efetiva(GetDataBaseTime()); rl.set_fk_loja(loj.get_identity()); rl.set_st_ident(input_st_ident); rl.set_tg_opcao(input_tg_opcao); rl.set_vr_valor(input_vr_valor); if (!rl.create_T_RepasseLoja()) { return(false); } output_id_confRepasse = rl.get_identity(); LINK_RepasseParcela lrp = new LINK_RepasseParcela(this); T_Parcelas parc = new T_Parcelas(this); for (int t = 0; t < input_array_generic_lstPar.Count; ++t) { DadosRepasse dr = new DadosRepasse(input_array_generic_lstPar[t] as DataPortable); if (dr.get_tg_confirmado() == Context.FALSE) { continue; } parc.ExclusiveAccess(); if (!parc.selectIdentity(dr.get_id_parcela())) { return(false); } // esta parcela foi repassada parc.set_tg_pago(Context.TRUE); if (!parc.synchronize_T_Parcelas()) { return(false); } parc.ReleaseExclusive(); lrp.set_fk_parcela(parc.get_identity()); lrp.set_fk_repasseLoja(rl.get_identity()); if (!lrp.create_LINK_RepasseParcela()) { return(false); } } PublishNote("Repasse feito com sucesso"); /// USER [ execute ] END Registry("execute done exec_repasseLoja "); return(true); }