コード例 #1
0
 internal static T GetSpecialImageInformationBySOPINstancUID <T>(ImageInformation intype, string SOPInstanceUID) where T : struct
 {
     if (intype == ImageInformation.SOPInstanceUID)
     {
         if (typeof(T) == typeof(String))
         {
             return((T)Convert.ChangeType(SOPInstanceUID, typeof(T)));
         }
         throw new NotSupportedException();
     }
     else
     {
         if (typeof(T) == typeof(int))
         {
             int ans = int.Parse(Sqlhelper.Exesql($"SELECT {intype.ToString("G")} FROM Image WHERE SOPInstanceUID = \'{SOPInstanceUID}\'").Rows[0][0].ToString());
             return((T)Convert.ChangeType(ans, typeof(T)));
         }
         throw new NotSupportedException();
     }
 }