public fechas ObtenerIntervaloDeFechas(string desde, string hasta) { Func_Utiles fu = new Func_Utiles(); if (desde == " /" && hasta == " /") { IntervaloDeFechas.Desde = Convert.ToDateTime("01/01/2000");// new DateTime(01/01/2000); IntervaloDeFechas.Hasta = Convert.ToDateTime(fu.GetDia31DelMes(fu.generar_ceros(DateTime.Now.Month.ToString(), 2)) + "/" + fu.generar_ceros(DateTime.Now.Month.ToString(), 2) + "/" + DateTime.Now.Year.ToString()).Date; } if (desde == " /" && hasta != " /") { IntervaloDeFechas.Desde = Convert.ToDateTime("01/01/2000");// new DateTime(01/01/2000); IntervaloDeFechas.Hasta = Convert.ToDateTime(fu.GetDia31DelMes(hasta.Substring(0, 2)) + "/" + hasta); } if (desde != " /" && hasta == " /") { IntervaloDeFechas.Desde = Convert.ToDateTime("01" + "/" + desde); IntervaloDeFechas.Hasta = Convert.ToDateTime("01/01/3000");// new DateTime(01/01/2000); } if (desde != " /" && hasta != " /") { //string fecha_2 = fu.GetDia31DelMes(hasta.Substring(0, 2)); IntervaloDeFechas.Desde = Convert.ToDateTime("01/" + desde); IntervaloDeFechas.Hasta = Convert.ToDateTime(fu.GetDia31DelMes(hasta.Substring(0, 2)) + "/" + hasta);// new DateTime(01/01/2000); } return(IntervaloDeFechas); }
public ClsBeneficiarioExepcion GetDatosBenef(double _codfliar) { using (lts_sindicatoDataContext context = new lts_sindicatoDataContext()) { Func_Utiles fu = new Func_Utiles(); Parentesco parent = new Parentesco(); var Benef = from a in context.socflia where a.SOCFLIA_CODFLIAR == _codfliar join b in context.maeflia on a.SOCFLIA_CODFLIAR equals b.MAEFLIA_CODFLIAR select new { nombre = b.MAEFLIA_APELLIDO.Trim() + " " + b.MAEFLIA_NOMBRE.Trim(), parent = parent.GetParentescoDescrip(a.SOCFLIA_PARENT).parent_descrip, dni = Convert.ToString(b.MAEFLIA_NRODOC), sexo = b.MAEFLIA_SEXO, edad = fu.calcular_edad(b.MAEFLIA_FECNAC), codigofliar = Convert.ToInt32(b.MAEFLIA_CODFLIAR) }; if (Benef.Count() > 0) { benefexep.nombre = Benef.First().nombre; benefexep.parentesco = Benef.First().parent; benefexep.dni = Benef.First().dni; benefexep.sexo = Benef.First().sexo.ToString(); benefexep.edad = Benef.First().edad; benefexep.codigofliar = Benef.First().codigofliar; } return(benefexep); } }
public List <Edades> get_edades(string codigo_postal) { Func_Utiles funciones_utiles = new Func_Utiles(); var edad_mochilas = (from a in db_sindicato.soccen join sf in db_sindicato.socflia on a.SOCCEN_CUIL equals sf.SOCFLIA_CUIL join flia in db_sindicato.maeflia on sf.SOCFLIA_CODFLIAR equals flia.MAEFLIA_CODFLIAR join maesocio in db_sindicato.maesoc on a.SOCCEN_CUIL equals maesocio.MAESOC_CUIL where a.SOCCEN_ESTADO == 1 && (codigo_postal == "0" ? maesocio.MAESOC_CODPOS != codigo_postal : maesocio.MAESOC_CODPOS == codigo_postal) select new { sexo = flia.MAEFLIA_SEXO, edad = funciones_utiles.calcular_edad(flia.MAEFLIA_FECNAC), }).ToList(); if (edad_mochilas.Count() > 0) { Edades edad_ = new Edades(); foreach (var item in edad_mochilas.ToList()) { edad_.Sexo = item.sexo.ToString(); edad_.Edad = item.edad; lst_edades.Add(edad_); } } return(lst_edades); } //Obtengo un listado con las edades de un codigo postal
public List <ClsTitularBenef> Get_Titular_Benef(double cuil, int TipoDeEvento) { using (lts_sindicatoDataContext context = new lts_sindicatoDataContext()) { Func_Utiles fu = new Func_Utiles(); Parentesco parent = new Parentesco(); var Titu = (from a in context.soccen where a.SOCCEN_CUIL == cuil join b in context.maesoc on a.SOCCEN_CUIL equals b.MAESOC_CUIL select new { nombre = b.MAESOC_APELLIDO.Trim() + " " + b.MAESOC_NOMBRE.Trim(), parent = "Titular", dni = b.MAESOC_NRODOC, sexo = b.MAESOC_SEXO, edad = fu.calcular_edad(b.MAESOC_FECHANAC), codigofliar = 0 }).ToList(); var Benef = (from a in context.socflia where a.SOCFLIA_CUIL == cuil join b in context.maeflia on a.SOCFLIA_CODFLIAR equals b.MAEFLIA_CODFLIAR select new { nombre = b.MAEFLIA_APELLIDO.Trim() + " " + b.MAEFLIA_NOMBRE.Trim(), parent = parent.GetParentescoDescrip(a.SOCFLIA_PARENT).parent_descrip, dni = Convert.ToString(b.MAEFLIA_NRODOC), sexo = b.MAEFLIA_SEXO, edad = fu.calcular_edad(b.MAEFLIA_FECNAC), codigofliar = Convert.ToInt32(b.MAEFLIA_CODFLIAR) }).ToList(); //var Titu_Benef = Titu.Union(Benef); var Titu_Benef = TipoDeEvento != 3 ? Titu.Union(Benef) : Titu; if (Titu_Benef.Count() > 0) { foreach (var item in Titu_Benef) { ClsTitularBenef tb = new ClsTitularBenef(); tb.nombre = item.nombre; tb.Parentesco = item.parent; tb.Cuil = item.dni; tb.Sexo = item.sexo; tb.Edad = item.edad; tb.CodigoFliar = item.codigofliar; Lst_Titular_benef.Add(tb); } } return(Lst_Titular_benef); } }
public decimal ObtenerImporteDeInteres(DateTime FechaActa, decimal TotalDeuda, decimal interes_) { Func_Utiles fu = new Func_Utiles(); DateTime FechaDesde = FechaActa; string dia = fu.GetDia31DelMes(fu.generar_ceros(FechaDesde.Month.ToString(), 2)); FechaDesde = Convert.ToDateTime(dia + "/" + fu.generar_ceros(FechaDesde.Month.ToString(), 2) + "/" + FechaDesde.Year.ToString()); double dias = Convert.ToInt32((DateTime.Today.Date - FechaDesde.Date).TotalDays); decimal meses = Convert.ToDecimal(dias / 30); decimal interes = Convert.ToDecimal(meses * interes_); decimal ImporteDelInteres = Convert.ToDecimal((TotalDeuda * (interes / 100))); return(ImporteDelInteres > 0 ? ImporteDelInteres : 0); }
public List <empresas_con_deuda> get_empresas() { var empresa_deuda = from a in db_sindicato.maeemp //join l in db_sindicato.localidad on a.MAEEMP_CODLOC equals l.MAELOC_CODLOC //where a.MAEEMP_CODLOC == 2216 select new { cuit = a.MEEMP_CUIT_STR, empresa = a.MAEEMP_RAZSOC, domicilio = a.MAEEMP_CALLE.Trim() + " " + a.MAEEMP_NRO, loc = "SGO", telefono = a.MAEEMP_TEL, estudio = a.MAEEMP_ESTUDIO_CONTACTO // l.MAELOC_NOMBRE, }; if (empresa_deuda.Count() > 0) { foreach (var empresa in empresa_deuda.ToList()) { Func_Utiles func_utiles = new Func_Utiles(); empresas_con_deuda emp_deu = new empresas_con_deuda(); DateTime ultimo_periodo = obtener_periodo(empresa.cuit); if (ultimo_periodo.Date == Convert.ToDateTime("01/01/1900").Date) { DateTime cinco_atras = DateTime.Now.AddYears(-5); ultimo_periodo = Convert.ToDateTime("01/" + func_utiles.generar_ceros(cinco_atras.Month.ToString(), 2) + "/" + cinco_atras.Year.ToString()); } //if (ultimo_periodo.Date != Convert.ToDateTime("01/01/1900").Date) //{ emp_deu.cuit = empresa.cuit; emp_deu.empresa = empresa.empresa.Trim(); emp_deu.domicilio = empresa.domicilio.Trim(); emp_deu.localidad = empresa.loc.Trim(); emp_deu.telefono = empresa.telefono; emp_deu.estudio = empresa.estudio; emp_deu.deuda = obtener_deudas(ultimo_periodo, empresa.cuit); lista_emp_deuda.Add(emp_deu); emp_deu.ultimo_periodo = ultimo_periodo; //} } } return(lista_emp_deuda); }
public ClsBeneficiarioExepcion GetDatosExepcion(double _expecionID) { using (lts_sindicatoDataContext context = new lts_sindicatoDataContext()) { Func_Utiles fu = new Func_Utiles(); Parentesco parent = new Parentesco(); var Benef = from a in context.eventos_exep where a.event_exep_id == _expecionID select new { nombre = a.event_exep_apellido.Trim() + " " + a.event_exep_nombre.Trim(), parent = parent.GetParentescoDescrip(a.event_exep_parent).parent_descrip, dni = Convert.ToString(a.event_exep_dni), sexo = a.event_exep_sexo, edad = fu.calcular_edad(Convert.ToDateTime(a.event_exep_fechanac)), codigofliar = 0 }; //var Benef = from a in context.socflia // where a.SOCFLIA_CUIL == // join b in context.maeflia on a.SOCFLIA_CODFLIAR equals b.MAEFLIA_CODFLIAR //select new //{ // nombre = b.MAEFLIA_APELLIDO.Trim() + " " + b.MAEFLIA_NOMBRE.Trim(), // parent = parent.GetParentescoDescrip(a.SOCFLIA_PARENT).parent_descrip, // dni = Convert.ToString(b.MAEFLIA_NRODOC), // sexo = b.MAEFLIA_SEXO, // edad = fu.calcular_edad(b.MAEFLIA_FECNAC), // codigofliar = Convert.ToInt32(b.MAEFLIA_CODFLIAR) //}; if (Benef.Count() > 0) { benefexep.nombre = Benef.First().nombre; benefexep.parentesco = Benef.First().parent; benefexep.dni = Benef.First().dni; benefexep.sexo = Benef.First().sexo.ToString(); benefexep.edad = Benef.First().edad; benefexep.codigofliar = Benef.First().codigofliar; } return(benefexep); } }
public List <prueba> pr(string codigo_postal) { // var it = from a in db_sindicato.maesoc select a;//where a.MAESOC_NRODOC == "26954776" select a; // //db_sindicato.maeflia.Where(x => x.MAEFLIA_NRODOC == 26954776).Select(x => x.MAEFLIA_NRODOC).ToList(); // foreach (var item in it.ToList()) // { // prueba p = new prueba(); // Func_Utiles func = new Func_Utiles(); // p.edad = func.calcular_edad(item.MAESOC_FECHANAC); // p.sexo = item.MAESOC_SEXO.ToString(); // pru.Add(p); // } // return pru; Func_Utiles funciones_utiles = new Func_Utiles(); var edad_mochilas = (from a in db_sindicato.soccen join sf in db_sindicato.socflia on a.SOCCEN_CUIL equals sf.SOCFLIA_CUIL join flia in db_sindicato.maeflia on sf.SOCFLIA_CODFLIAR equals flia.MAEFLIA_CODFLIAR join maesocio in db_sindicato.maesoc on a.SOCCEN_CUIL equals maesocio.MAESOC_CUIL where a.SOCCEN_ESTADO == 1 && (codigo_postal == "0" ? maesocio.MAESOC_CODPOS != codigo_postal : maesocio.MAESOC_CODPOS == codigo_postal) select new { sexo = flia.MAEFLIA_SEXO, edad = funciones_utiles.calcular_edad(flia.MAEFLIA_FECNAC), }).ToList(); if (edad_mochilas.Count() > 0) { prueba edad_ = new prueba(); foreach (var item in edad_mochilas.ToList()) { edad_.sexo = item.sexo.ToString(); edad_.edad = item.edad; pru.Add(edad_); } } return(pru); }