Exemplo n.º 1
0
        public string GetText(HandbookGroup hg)
        {
            StringBuilder sb = new StringBuilder();

            if (hg != null)
            {
                foreach (Handbook hb in hg.GetAllHandbooks())
                {
                    string val = this[hb.id];
                    if (val.Trim().Length > 0)
                    {
                        if (sb.Length > 0)
                        {
                            sb.Append("; ");
                        }
                        sb.AppendFormat("{0}: {1}", hb.name, val);
                    }
                }
                if (sb.Length > 0)
                {
                    sb.Append(".");
                }
            }
            return(sb.ToString());
        }
        public object Clone()
        {
            HandbookGroup handbookGroup = (HandbookGroup)this.MemberwiseClone();

            handbookGroup.handbooks    = CollectionUtils.Clone(handbooks);
            handbookGroup.handbookRefs = CollectionUtils.Clone(handbookRefs);
            return(handbookGroup);
        }
Exemplo n.º 3
0
        public bool AddHandbook(HandbookGroupId gid, Handbook hb)
        {
            HandbookGroup hg = GetHandbookGroup(gid);

            if (hg != null)
            {
                return(hg.AddHandbook(hb));
            }
            return(false);
        }
Exemplo n.º 4
0
 public void Init(HandbookGroup hg, HandbooksInfo hi)
 {
     foreach (Handbook hb in hg.GetAllHandbooks())
     {
         string val = hi[hb.id];
         if (val.Length > 0)
         {
             this[hb.id] = val;
         }
     }
 }
Exemplo n.º 5
0
        public string GetAnalysesReport(GmConnection conn, Config config)
        {
            StringBuilder sb  = new StringBuilder(1000);
            GmCommand     cmd = conn.CreateCommand("select Analyses.*, AnalysisTypes.Name, HandbookGroupId from Analyses left join AnalysisTypes on AnalysisTypes.Id=AnalysisTypeId where PatientId=@PatientId");

            cmd.AddInt("PatientId", id);
            using (DbDataReader dr = cmd.ExecuteReader())
            {
                while (dr.Read())
                {
                    if (sb.Length > 0)
                    {
                        sb.AppendLine();
                    }
                    Analysis      analisis = new Analysis(dr);
                    string        name     = (string)dr["Name"];
                    string        hgId     = (string)dr["HandbookGroupId"];
                    HandbookGroup hg       = config.GetHandbookGroup(hgId);
                    sb.AppendFormat("{0} от {1}: {2}", name, analisis.executionDate.ToShortDateString(), analisis.analysisData.GetText(hg));
                }
            }
            return(sb.ToString());
        }