public void Excluir(IdentificacaoDesdobramento entity) { try { _repository.Remove(entity); } catch { throw; } }
public DadoDesdobramentoCancelarGridViewModel CreateInstance(IdentificacaoDesdobramento identity, Desdobramento entity, IEnumerable <Reter> reters, IEnumerable <DesdobramentoTipo> desdobramentoTipos) { var reterList = reters as IList <Reter> ?? reters.ToList(); return(new DadoDesdobramentoCancelarGridViewModel { Desdobramento = entity.DesdobramentoTipoId == 1 ? desdobramentoTipos.Where(x => x.Id == identity.DesdobramentoTipoId).Select(x => x.Id + " - " + x.Descricao).FirstOrDefault() : identity.Sequencia.ToString("D2"), ReduzidoCredor = identity.NomeReduzidoCredor, ValorDistribuicao = identity.ValorDesdobrado == 0 ? default(string) : identity.ValorDesdobrado.ToString(), TipoBloqueio = identity.TipoBloqueio }); }
public int SalvarOuAlterar(IdentificacaoDesdobramento entity) { try { entity.Id = _repository.Save(entity); return(entity.Id); } catch (Exception ex) { throw ex; } }
public int Save(IdentificacaoDesdobramento entity) { return(DataHelper.Get <int>("PR_IDENTIFICACAO_DESDOBRAMENTO_SALVAR", new SqlParameter("@id_desdobramento", entity.Desdobramento), new SqlParameter("@id_identificacao_desdobramento", entity.Id), new SqlParameter("@id_tipo_desdobramento", entity.DesdobramentoTipoId), new SqlParameter("@id_reter", entity.ReterId), new SqlParameter("@ds_nome_reduzido_credor", entity.NomeReduzidoCredor), new SqlParameter("@vr_percentual_base_calculo", entity.ValorPercentual), new SqlParameter("@vr_desdobrado", entity.ValorDesdobrado), new SqlParameter("@vr_desdobrado_inicial", entity.ValorDesdobradoInicial), new SqlParameter("@vr_distribuicao", entity.ValorDistribuicao), new SqlParameter("@bl_tipo_bloqueio", entity.TipoBloqueio), new SqlParameter("@nr_sequencia", entity.Sequencia) )); }
public DadoDesdobramentoIdentificacaoViewModel CreateInstance(Model.Entity.PagamentoContaUnica.Desdobramento.Desdobramento desdobramento, IdentificacaoDesdobramento entity, IEnumerable <DesdobramentoTipo> tipoDesdobramentos, IEnumerable <Reter> reters) { var desdobramentoTipos = tipoDesdobramentos as IList <DesdobramentoTipo> ?? tipoDesdobramentos.ToList(); var reterList = reters as IList <Reter> ?? reters.ToList(); return(new DadoDesdobramentoIdentificacaoViewModel { Tipo = Convert.ToString(desdobramentoTipos.FirstOrDefault(x => x.Id == entity.DesdobramentoTipoId)?.Id), DesdobramentoTipo = desdobramentoTipos.Where(x => x.Id == entity.DesdobramentoTipoId).Select(x => x.Id + " - " + x.Descricao).FirstOrDefault(),//Convert.ToString(desdobramentoTipos.FirstOrDefault(x => x.Id == entity.DesdobramentoTipoId)?.Descricao), DesdobramentoTipoListItems = desdobramentoTipos.OrderBy(x => x.Id). Select(s => new SelectListItem { Text = $"{s.Id} - {s.Descricao}", Value = s.Id.ToString(), Selected = s.Id == entity.DesdobramentoTipoId }), ReterId = Convert.ToString(entity.ReterId), ReterDescicao = reterList.Where(x => x.Id == entity.ReterId).Select(x => x.Id + " - " + x.Descricao).FirstOrDefault(), ReterListItems = reterList.OrderBy(x => x.Id). Select(s => new SelectListItem { Text = $"{s.Id} - {s.Descricao}", Value = s.Id.ToString(), Selected = s.Id == entity.ReterId }), ReduzidoCredor = entity.NomeReduzidoCredor, Desdobramento = entity.Desdobramento.ToString(), ValorPercentual = entity.ValorPercentual == 0 ? default(string) : (entity.ValorPercentual).ToString(), BaseCalc = entity.ValorPercentual == 0 ? default(string) : (entity.ValorPercentual).ToString(), ValorDesdobrado = entity.ValorDesdobrado == 0 ? default(string) : entity.ValorDesdobrado.ToString(), ValorDistribuicao = entity.ValorDistribuicao == 0 ? default(string) : entity.ValorDistribuicao.ToString(), Sequencia = entity.Sequencia.ToString("D2"), TransmitidoProdesp = desdobramento.TransmitidoProdesp }); }
public IEnumerable <IdentificacaoDesdobramento> Listar(IdentificacaoDesdobramento entity) { return(_repository.Fetch(entity)); }
public int Remove(IdentificacaoDesdobramento entity) { return(DataHelper.Get <int>("PR_IDENTIFICACAO_DESDOBRAMENTO_EXCLUIR", new SqlParameter("@id_identificacao_desdobramento", entity.Id), new SqlParameter("@id_desdobramento", entity.Desdobramento))); }
public IEnumerable <IdentificacaoDesdobramento> Fetch(IdentificacaoDesdobramento entity) { return(DataHelper.List <IdentificacaoDesdobramento>("PR_IDENTIFICACAO_DESDOBRAMENTO_CONSULTAR", new SqlParameter("@id_identificacao_desdobramento", entity.Id), new SqlParameter("@id_desdobramento", entity.Desdobramento))); }