public YellowstonePathology.YpiConnect.Contract.Identity.WebServiceAccountCollection GetWebServiceAccountCollectionByFacilityId(string facilityId)
        {
            YellowstonePathology.YpiConnect.Contract.Identity.WebServiceAccountCollection webServiceAccountCollection = new Contract.Identity.WebServiceAccountCollection();
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "ws_GetWebServiceAccountCollectionByFacilityId_New";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@FacilityId", SqlDbType.VarChar).Value = facilityId;

            using (SqlConnection cn = new SqlConnection(YpiConnect.Service.Properties.Settings.Default.ServerSqlConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        int accountCount = (int)dr["AccountCount"];
                        for(int cnt = 0; cnt < accountCount; cnt++)
                        {
                            dr.NextResult();
                            YellowstonePathology.YpiConnect.Contract.Identity.WebServiceAccount webServiceAccount = this.BuildWebServiceAccount(dr);
                            webServiceAccountCollection.Add(webServiceAccount);
                        }
                    }
                }
            }
            return webServiceAccountCollection;
        }
Ejemplo n.º 2
0
        public YellowstonePathology.YpiConnect.Contract.Identity.WebServiceAccountCollection GetWebServiceAccountCollectionByFacilityId(string facilityId)
        {
            YellowstonePathology.YpiConnect.Contract.Identity.WebServiceAccountCollection webServiceAccountCollection = new Contract.Identity.WebServiceAccountCollection();
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "ws_GetWebServiceAccountCollectionByFacilityId_New";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@FacilityId", SqlDbType.VarChar).Value = facilityId;

            using (SqlConnection cn = new SqlConnection(YpiConnect.Service.Properties.Settings.Default.ServerSqlConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        int accountCount = (int)dr["AccountCount"];
                        for (int cnt = 0; cnt < accountCount; cnt++)
                        {
                            dr.NextResult();
                            YellowstonePathology.YpiConnect.Contract.Identity.WebServiceAccount webServiceAccount = this.BuildWebServiceAccount(dr);
                            webServiceAccountCollection.Add(webServiceAccount);
                        }
                    }
                }
            }
            return(webServiceAccountCollection);
        }