Ejemplo n.º 1
0
        public object GetRichiesteByEpis(string episidid)
        {
            string connectionString = ConfigurationManager.ConnectionStrings["HltCC"].ConnectionString;

            RichiesteRISDTO[] rich = null;

            string query = "SELECT * FROM hlt_ricradiologica WHERE idepisodio = @episidid and esami is not null and esami <> ''";
            Dictionary <string, string> pars = new Dictionary <string, string>();

            pars["episidid"] = episidid;

            log.Info(string.Format("Query: {0}", query));
            log.Info(string.Format("Params: {0}", string.Join(";", pars.Select(x => x.Key + "=" + x.Value).ToArray())));

            DataTable data = DBSQLLayer.ExecuteQueryWithParams(connectionString, query, pars);

            log.Info(string.Format("Query Executed! Retrieved {0} records!", data.Rows.Count));

            if (data != null)
            {
                rich = new RichiesteRISDTO[data.Rows.Count];

                for (int i = 0; i < data.Rows.Count; i++)
                {
                    DataRow row = data.Rows[i];
                    rich[i] = RichMapper(row);

                    log.Info("Record mapped to RichiesteRISDTO");
                }
            }
            return(rich);
        }
Ejemplo n.º 2
0
        public object GetEpisodioById(string episidid)
        {
            string      connectionString = ConfigurationManager.ConnectionStrings["HltDesktop"].ConnectionString;
            EpisodioDTO epis             = null;

            string query = "SELECT * FROM Episodi WHERE seriale = @seriale";
            Dictionary <string, string> pars = new Dictionary <string, string>();

            pars["seriale"] = episidid;

            log.Info(string.Format("Query: {0}", query));
            log.Info(string.Format("Params: {0}", string.Join(";", pars.Select(x => x.Key + "=" + x.Value).ToArray())));

            DataTable data = DBSQLLayer.ExecuteQueryWithParams(connectionString, query, pars);

            log.Info(string.Format("Query Executed! Retrieved {0} records!", data.Rows.Count));

            if (data != null && data.Rows.Count == 1)
            {
                DataRow row = data.Rows[0];

                epis = EpisMapper(row);

                log.Info("Record mapped to EpisodioDTO");
            }
            return(epis);
        }
Ejemplo n.º 3
0
        public object GetRichiestaById(string richidid)
        {
            string          connectionString = ConfigurationManager.ConnectionStrings["HltCC"].ConnectionString;
            RichiesteRISDTO esam             = null;

            string query = "SELECT * FROM hlt_ricradiologica WHERE objectid = @objectid and esami is not null and esami <> ''";
            Dictionary <string, string> pars = new Dictionary <string, string>();

            pars["objectid"] = richidid;

            log.Info(string.Format("Query: {0}", query));
            log.Info(string.Format("Params: {0}", string.Join(";", pars.Select(x => x.Key + "=" + x.Value).ToArray())));

            DataTable data = DBSQLLayer.ExecuteQueryWithParams(connectionString, query, pars);

            log.Info(string.Format("Query Executed! Retrieved {0} records!", data.Rows.Count));

            if (data != null && data.Rows.Count == 1)
            {
                DataRow row = data.Rows[0];
                esam = RichMapper(row);

                log.Info("Record mapped to RichiesteRISDTO");
            }
            return(esam);
        }
Ejemplo n.º 4
0
        public object GetEsamiByRich(string richidid)
        {
            string connectionString = ConfigurationManager.ConnectionStrings["HltCC"].ConnectionString;

            EsameDTO[] esam = null;

            string query = "SELECT esami, nomeesami FROM hlt_ricradiologica WHERE objectid = @objectid";
            Dictionary <string, string> pars = new Dictionary <string, string>();

            pars["objectid"] = richidid;

            log.Info(string.Format("Query: {0}", query));
            log.Info(string.Format("Params: {0}", string.Join(";", pars.Select(x => x.Key + "=" + x.Value).ToArray())));

            DataTable data = DBSQLLayer.ExecuteQueryWithParams(connectionString, query, pars);

            log.Info(string.Format("Query Executed! Retrieved {0} records!", data.Rows.Count));

            if (data != null && data.Rows.Count == 1)
            {
                DataRow row = data.Rows[0];

                string idesami_   = row["esami"] != DBNull.Value ? (string)row["esami"] : null;
                string nomeesami_ = row["nomeesami"] != DBNull.Value ? (string)row["nomeesami"] : null;

                string[] idesami = idesami_ != null?idesami_.Split(',').ToArray <string>() : null;

                string[] nomeesami = nomeesami_ != null?nomeesami_.Split(',').ToArray <string>() : null;

                log.Info(string.Format("Exams Extracted! Retrieved {0} items!", idesami.Length));

                if (idesami.Length > 0)
                {
                    esam = new EsameDTO[idesami.Length];
                    for (int i = 0; i < idesami.Length; i++)
                    {
                        EsameDTO tmp = new EsameDTO();
                        tmp.esamidid = idesami[i].Trim().ToString();
                        tmp.esamdesc = nomeesami[i].Trim().ToString();
                        esam[i]      = tmp;

                        log.Info(string.Format("Exam [id:{0}] mapped to EsameDTO", tmp.esamidid));
                    }
                }
            }
            return(esam);
        }