Пример #1
0
 public static System.Web.IHtmlString SubjektTypTrojice(this HtmlHelper self, Lib.Data.Firma firma, string htmlProOVM, string htmlProStatniFirmu, string htmlProSoukromou)
 {
     if (firma == null)
     {
         return(self.Raw(""));
     }
     if (firma.JsemOVM())
     {
         return(self.Raw(htmlProOVM));
     }
     else if (firma.JsemStatniFirma())
     {
         return(self.Raw(htmlProStatniFirmu));
     }
     else
     {
         return(self.Raw(htmlProSoukromou));
     }
 }
Пример #2
0
        private static Tuple <Dictionary <string, SubjectStatistic>, Dictionary <string, SubjectStatistic> > getStatisticForOsoba(string osobaNameId, Data.Relation.AktualnostType aktualnost)
        {
            var o = Data.Osoby.GetByNameId.Get(osobaNameId);

            if (o == null)
            {
                HlidacStatu.Util.Consts.Logger.Info("Unknown osobaId " + osobaNameId);
                return(new Tuple <Dictionary <string, SubjectStatistic>, Dictionary <string, SubjectStatistic> >(
                           new Dictionary <string, SubjectStatistic>(), new Dictionary <string, SubjectStatistic>()
                           ));
            }

            var perIcoStat = o.AktualniVazby(aktualnost)
                             .Where(v => !string.IsNullOrEmpty(v.To?.UniqId) &&
                                    v.To.Type == HlidacStatu.Lib.Data.Graph.Node.NodeType.Company)
                             .Select(v => v.To)
                             .Distinct(new HlidacStatu.Lib.Data.Graph.NodeComparer())
                             .Select(f => new { ico = f.Id, ss = new Analysis.SubjectStatistic(f.Id) });
            //.OrderByDescending(or => or.ss.BasicStatPerYear.Summary.CelkemCena)
            //.ThenByDescending(or => or.ss.BasicStatPerYear.Summary.Pocet)
            //.ToDictionary(k => k.ico, v => v.ss);

            Dictionary <string, SubjectStatistic> statni = new Dictionary <string, SubjectStatistic>();
            Dictionary <string, SubjectStatistic> soukr  = new Dictionary <string, SubjectStatistic>();

            foreach (var it in perIcoStat)
            {
                Lib.Data.Firma f = Lib.Data.Firmy.Get(it.ico);
                if (f.JsemStatniFirma())
                {
                    statni.Add(it.ico, it.ss);
                }
                else
                {
                    soukr.Add(it.ico, it.ss);
                }
            }


            return(new Tuple <Dictionary <string, SubjectStatistic>, Dictionary <string, SubjectStatistic> >
                       (statni, soukr));
        }