public ActionResult Excluir(Models.Integrantes objIntegrante) { BD.IGERENCEEntities objBD = new BD.IGERENCEEntities(); BD.AGCF_FONTES objIntegranteBD = (from BD.AGCF_FONTES i in objBD.AGCF_FONTES where i.IDFONTES == objIntegrante.Identificador select i).FirstOrDefault(); if (objIntegranteBD != null) { objBD.AGCF_FONTES.Remove(objIntegranteBD); } objBD.SaveChanges(); string IdentificadorUsuario = GetLogOnSessionModel().Identificador; string CodigoTipoFonteDebito = Enumeradores.TipoFonte.DEBITO.RecuperarValor(); string CodigoTipoFonteCredito = Enumeradores.TipoFonte.CREDITO.RecuperarValor(); string CodigoTipoFonteInvestimento = Enumeradores.TipoFonte.INVESTIMENTO.RecuperarValor(); List <Models.Fonte> objFonte = (from BD.AGCF_FONTES i in objBD.AGCF_FONTES where i.IDUSUARIO == IdentificadorUsuario select new Models.Fonte() { Identificador = i.IDFONTES, Nome = i.DESNOME, DiaFechamento = i.NELDIAFECHAMENTO, TipoValor = i.CODTIPOFONTE, CartaoCredito = i.BOLCARTAOCREDITO != null && i.BOLCARTAOCREDITO == true ? true : false }).ToList(); return(View("Listar", objFonte)); }
public ActionResult Criar(Models.Fonte objIntegrante) { BD.IGERENCEEntities objBD = new BD.IGERENCEEntities(); string IdentificadorUsuario = GetLogOnSessionModel().Identificador; BD.AGCF_FONTES objFontesBD = new BD.AGCF_FONTES() { DESNOME = objIntegrante.Nome, IDUSUARIO = IdentificadorUsuario, IDFONTES = Guid.NewGuid().ToString(), CODTIPOFONTE = objIntegrante.TipoValor, NELDIAFECHAMENTO = objIntegrante.DiaFechamento, BOLCARTAOCREDITO = objIntegrante.CartaoCredito, CODFONTE = objIntegrante.Codigo }; objBD.AGCF_FONTES.Add(objFontesBD); objBD.SaveChanges(); string CodigoTipoFonteDebito = Enumeradores.TipoFonte.DEBITO.RecuperarValor(); string CodigoTipoFonteCredito = Enumeradores.TipoFonte.CREDITO.RecuperarValor(); string CodigoTipoFonteInvestimento = Enumeradores.TipoFonte.INVESTIMENTO.RecuperarValor(); List <Models.Fonte> objFontes = (from BD.AGCF_FONTES i in objBD.AGCF_FONTES where i.IDUSUARIO == IdentificadorUsuario select new Models.Fonte() { Identificador = i.IDFONTES, Nome = i.DESNOME, DiaFechamento = i.NELDIAFECHAMENTO, TipoValor = i.CODTIPOFONTE, Codigo = i.CODFONTE, CartaoCredito = i.BOLCARTAOCREDITO != null && i.BOLCARTAOCREDITO == true ? true : false }).ToList(); return(View("Listar", objFontes)); }