private void Preencher_Combo() { try { Utilitario.Preencher_ComboBox_Enumerado_Exibindo_Extenso(ref this.cboMotivoRecusa, "Motivo_Recusa_Pagamento", string.Empty, true, string.Empty, "Enum_Extenso"); Utilitario.Preencher_ComboBox_Enumerado_Exibindo_Extenso(ref this.cboStatus, "Status_Solicitacao_Pagamento", string.Empty, false, string.Empty, "Enum_Extenso"); if (this.intOrigemID == Solicitacao_Pagamento_Objeto_Origem.SAC.DefaultInteger()) { this.cboFormaPagamento.DisplayMember = "Enum_Extenso"; this.cboFormaPagamento.ValueMember = "Enum_ID"; this.cboFormaPagamento.DropDownStyle = ComboBoxStyle.DropDownList; this.cboFormaPagamento.DataSource = SAC_CTBUS.Obter_Ecommerce_Forma_Solicitacao_Pagamento((Ecommerce_Pedido_Forma_Pagamento_Tipo)this.Solicitacao_Pagamento["Cliente_Forma_Pagamento_Tipo_ID"].DefaultInteger()); } if (this.intOrigemID == Solicitacao_Pagamento_Objeto_Origem.Romaneio_Credito.DefaultInteger()) { Utilitario.Preencher_ComboBox_DataObject(ref this.cboFormaPagamento, new Solicitacao_PagamentoBUS().Obter_DataObject_Forma_Pagamento().Where(x => x.Forma_Pagamento_DS == "DepĆ³sito em Conta").ToList <Solicitacao_Pagamento_Forma_PagtoDO>(), "Forma_Pagamento_DS", "Forma_Pagamento_ID", ""); } } catch (Exception) { throw; } }
public bool Alterar(DataRow dtrAlterar, ref TransactionManager objTransaction) { try { Solicitacao_PagamentoDATA datSolicitacaoPagamento = new Solicitacao_PagamentoDATA(); Erro objErro = new Erro(); DBUtil objUtil = new DBUtil(); dtrAlterar["Usuario_Ultima_Alteracao_ID"] = Root.Funcionalidades.UsuarioDO_Ativo.ID; dtrAlterar["Solicitacao_Pagamento_Usuario_Ultima_Alteracao"] = Root.Funcionalidades.UsuarioDO_Ativo.Nome_Completo; dtrAlterar["Solicitacao_Pagamento_Data_Ultima_Alteracao"] = objUtil.Obter_Data_do_Servidor(true, ref objTransaction); if (dtrAlterar["Enum_Origem_ID"].DefaultInteger() == Solicitacao_Pagamento_Objeto_Origem.SAC.DefaultInteger()) { if (Validar_Solicitacao_Pagamento_Finalizada(dtrAlterar["Enum_Status_ID"].DefaultInteger()) == false) { dtrAlterar["Solicitacao_Pagamento_Data_Pagamento"] = Utilitario.Obter_DateTime_Valor_Minimo_DB(); } else { Solicitacao_PagamentoBUS.Enviar_Email_Cliente(dtrAlterar); } if (dtrAlterar["Enum_Status_ID"].DefaultInteger() == Status_Solicitacao_Pagamento.Efetuado.DefaultInteger()) { SAC_CTBUS busSACCT = new SAC_CTBUS(); // Caso nao tenha sido gerado o pagamento, eu o faco // Conferenncia com divergencia gera pagamento posteriores por exemplo, pois nao tem laudo if (dtrAlterar["Romaneio_CT_ID"].DefaultInteger() == 0) { // Removido, o pagamento sera feito na aprovacao do laudo DataTable dttRomaneioCredito = busSACCT.Gerar_Romaneio_Credito_Liberado(dtrAlterar["Objeto_Origem_ID"].DefaultInteger(), ref objTransaction); dtrAlterar["Solicitacao_Pagamento_Data_Pagamento"] = objUtil.Obter_Data_do_Servidor(true, ref objTransaction); dtrAlterar["Solicitacao_Pagamento_Comprovante_Estorno"] = dttRomaneioCredito.Rows[0]["Romaneio_CT_ID"].DefaultString(); } busSACCT.Efetuar_Pagamento_Bancario(dtrAlterar, ref objTransaction); } if (dtrAlterar["Enum_Status_ID"].DefaultInteger() == Status_Solicitacao_Pagamento.Negado.DefaultInteger()) { SAC_CTBUS busSACCT = new SAC_CTBUS(); busSACCT.Tratar_DataSet(dtrAlterar["Objeto_Origem_ID"].DefaultInteger(), ref objTransaction); } } if (dtrAlterar["Enum_Origem_ID"].DefaultInteger() == Solicitacao_Pagamento_Objeto_Origem.Romaneio_Credito.DefaultInteger()) { if (Validar_Solicitacao_Pagamento_Finalizada(dtrAlterar["Enum_Status_ID"].DefaultInteger())) { dtrAlterar["Solicitacao_Pagamento_Data_Pagamento"] = objUtil.Obter_Data_do_Servidor(true, ref objTransaction); Solicitacao_DepositoBUS solicitacaoDepositoBUS = new Solicitacao_DepositoBUS(); DataRow dtrDeposito = solicitacaoDepositoBUS.Consulta_Interface_Deposito(dtrAlterar["Solicitacao_Pagamento_ID"].DefaultInteger(), ref objTransaction); if (dtrAlterar["Enum_Status_ID"].DefaultInteger() == Status_Solicitacao_Pagamento.Efetuado.ToInteger()) { dtrDeposito["Pago"] = true; } Solicitacao_DepositoDO dtoDeposito = solicitacaoDepositoBUS.Preencher_Deposito(dtrDeposito); solicitacaoDepositoBUS.Alterar(dtoDeposito, objErro, ref objTransaction); } } datSolicitacaoPagamento.Alterar(dtrAlterar, objErro, ref objTransaction); if (objErro.TemErro()) { throw new McException(objErro); } else if (dtrAlterar["Enum_Origem_ID"].DefaultInteger() == Solicitacao_Pagamento_Objeto_Origem.Romaneio_Credito.DefaultInteger()) { Solicitacao_PagamentoBUS.Enviar_Email_Cliente(dtrAlterar); } return(true); } catch (Exception) { throw; } }