コード例 #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Series EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSeries(Series series)
 {
     base.AddObject("Series", series);
 }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: jktexas1/TEAM3OIE2S
        private Series InsertSeries(Series s)
        {
            if (s.originalSeriesStudyID == null)
            {
                s.originalSeriesStudyID = -1;
            }
            if (s.seriesDescription == null)
            {
                s.seriesDescription = "";
            }
            if (s.seriesDate == null || s.seriesDate.Year < 1900 || s.seriesDate.Year > 9999)
            {
                s.seriesDate = new DateTime(1900, 1, 1, 0, 0, 0);
            }
            if (s.totalNumberofSlices == null)
            {
                s.totalNumberofSlices = 0;
            }


            string query_string = "INSERT INTO Series(originalSeriesStudyID, seriesDescription, seriesDate, totalNumberofSlices, studyID) VALUES (@p1, @p2, @p3, @p4, @p5) SET @ID = SCOPE_IDENTITY();";
            SqlConnection db = new SqlConnection(@"Data Source="",1044;Initial Catalog="";User ID="";Password=""");
            SqlCommand Command = new SqlCommand(query_string, db);
            Command.Parameters.AddWithValue("@p1", s.originalSeriesStudyID);
            Command.Parameters.AddWithValue("@p2", s.seriesDescription);
            Command.Parameters.AddWithValue("@p3", s.seriesDate);
            Command.Parameters.AddWithValue("@p4", s.totalNumberofSlices);
            Command.Parameters.AddWithValue("@p5", s.studyID);
            Command.Parameters.Add("@ID", SqlDbType.Int, 4).Direction = ParameterDirection.Output;
            db.Open();
            Command.ExecuteNonQuery();
            AuditController.CreateAuditEntry(Session["userID"].ToString(), Session["username"].ToString(), "Series", null, "Insert");
            s.seriesID = Convert.ToInt32(Command.Parameters["@ID"].Value.ToString());
            db.Close();
            return s;
        }
コード例 #3
0
 /// <summary>
 /// Create a new Series object.
 /// </summary>
 /// <param name="seriesID">Initial value of the seriesID property.</param>
 public static Series CreateSeries(global::System.Int32 seriesID)
 {
     Series series = new Series();
     series.seriesID = seriesID;
     return series;
 }
コード例 #4
0
ファイル: HomeController.cs プロジェクト: jktexas1/TEAM3OIE2S
        private Series GetSeriesInfo(List<EvilDICOM.Core.Interfaces.IDICOMElement> elements, int start)
        {
            Series new_series = new Series();
            new_series.seriesDate = new DateTime(1, 1, 1, 0, 0, 0);
            new_series.totalNumberofSlices = 0;
            for (int i = start; i < elements.Count; i++)
            {
                var currElement = elements[i];
                var currTag = currElement.Tag;
                if (currTag.Equals(TagHelper.DIRECTORY_RECORD_TYPE))
                {
                    if (currElement.DData.ToString().Equals("IMAGE"))
                    {
                        new_series.totalNumberofSlices += 1;   
                    }
                    else
                    {
                        break;
                    }
                }
                else if (currTag.Equals(TagHelper.SERIES_DATE))
                {
                    DateTime seriesdate = DateTime.Parse(currElement.DData.ToString());

                    new_series.seriesDate = new_series.seriesDate.AddYears(seriesdate.Year-1);
                    new_series.seriesDate = new_series.seriesDate.AddMonths(seriesdate.Month - 1);
                    new_series.seriesDate = new_series.seriesDate.AddDays(seriesdate.Day - 1);
                }
                else if (currTag.Equals(TagHelper.SERIES_TIME))
                {
                    DateTime seriestime = DateTime.Parse(currElement.DData.ToString());

                    new_series.seriesDate = new_series.seriesDate.AddHours(seriestime.Hour);
                    new_series.seriesDate = new_series.seriesDate.AddMinutes(seriestime.Minute);
                    new_series.seriesDate = new_series.seriesDate.AddSeconds(seriestime.Second);
                }
                else if (currTag.Equals(TagHelper.SERIES_DESCRIPTION))
                {
                    new_series.seriesDescription = currElement.DData.ToString();
                }
                else if (currTag.Equals(TagHelper.SERIES_NUMBER))
                {
                    new_series.originalSeriesStudyID = Convert.ToInt32(currElement.DData.ToString());
                }
            }

            return new_series;
        }