private void BtnPorcentajeSociosDfNl_Click(object sender, RoutedEventArgs e) { int errores = 0; totalAccionesDenSocialModel model = new totalAccionesDenSocialModel(); List <int> socs2Socios = model.GetSociedadesDosSociosNLCD(); List <InfoNlyCd> informacion = model.GetSociosNlyDf(); int contador = 1; foreach (int mainId in socs2Socios) { TotalAccionesDensocial sociedad = new TotalAccionesDensocial(); List <Socio> socios = new List <Socio>(); foreach (InfoNlyCd info in (from n in informacion where n.MainId == mainId select n)) { sociedad.Folio = info.Folio; sociedad.DenSocial = String.Format("{0}{1}{2}", info.Oficina, info.Folio, info.IdGen); Socio socio = new Socio(); sociedad.TotalAcciones += info.NumAcciones; socio.Accion = info.NumAcciones; sociedad.TotalValor += info.Total; socio.Total = info.Total; socios.Add(socio); } Int64 socio1Acciones = socios[0].Accion; Int64 socio2Acciones = socios[1].Accion; if (socio1Acciones > socio2Acciones) { sociedad.PorcentajeAcciones = ObtenerPorcentaje(sociedad.TotalAcciones, socio1Acciones); } else if (socio2Acciones > socio1Acciones) { sociedad.PorcentajeAcciones = ObtenerPorcentaje(sociedad.TotalAcciones, socio2Acciones); } else { sociedad.PorcentajeAcciones = 50; } Int64 socio1Total = socios[0].Total; Int64 socio2Total = socios[1].Total; if (socio1Total > socio2Total) { sociedad.Porcentajevalor = ObtenerPorcentaje(sociedad.TotalValor, socio1Total); } else if (socio2Total > socio1Total) { sociedad.Porcentajevalor = ObtenerPorcentaje(sociedad.TotalValor, socio2Total); } else { sociedad.Porcentajevalor = 50; } if (!model.SetSocForAnalisisNLCD(sociedad)) { errores++; } Console.WriteLine(contador.ToString()); contador++; } Console.WriteLine("Errores: " + errores); Console.ReadLine(); }
private void BtnPorcentajesSocios_Click(object sender, RoutedEventArgs e) { totalAccionesDenSocialModel model = new totalAccionesDenSocialModel(); model.GetSociedadesDosSocios(); }