Beispiel #1
0
        public int Update(UltrasoundReport ultrasoundReport)
        {
            UpdateCommand.Parameters["@ID"].Value                       = ultrasoundReport.ID;
            UpdateCommand.Parameters["@PatientID"].Value                = ultrasoundReport.PatientID;
            UpdateCommand.Parameters["@PatientName"].Value              = ultrasoundReport.PatientName;
            UpdateCommand.Parameters["@DOB"].Value                      = ultrasoundReport.DOB;
            UpdateCommand.Parameters["@Sex"].Value                      = ultrasoundReport.Sex;
            UpdateCommand.Parameters["@ImagePath"].Value                = ultrasoundReport.ImagePath;
            UpdateCommand.Parameters["@LiverSize"].Value                = ultrasoundReport.LiverSize;
            UpdateCommand.Parameters["@LiverMargin"].Value              = ultrasoundReport.LiverMargin;
            UpdateCommand.Parameters["@LiverSOL"].Value                 = ultrasoundReport.LiverSOL;
            UpdateCommand.Parameters["@LiverEchogenicity"].Value        = ultrasoundReport.LiverEchogenicity;
            UpdateCommand.Parameters["@LiverCaudatelobe"].Value         = ultrasoundReport.LiverCaudatelobe;
            UpdateCommand.Parameters["@GallBLadderWallThickness"].Value = ultrasoundReport.GallBLadderWallThickness;
            UpdateCommand.Parameters["@GallBLadderContent"].Value       = ultrasoundReport.GallBLadderContent;
            UpdateCommand.Parameters["@HepaticDucts"].Value             = ultrasoundReport.HepaticDucts;
            UpdateCommand.Parameters["@CBD"].Value                      = ultrasoundReport.CBD;
            UpdateCommand.Parameters["@Pancreas"].Value                 = ultrasoundReport.Pancreas;
            UpdateCommand.Parameters["@Spleen"].Value                   = ultrasoundReport.Spleen;
            UpdateCommand.Parameters["@RightKidney"].Value              = ultrasoundReport.RightKidney;
            UpdateCommand.Parameters["@LeftKidney"].Value               = ultrasoundReport.LeftKidney;
            UpdateCommand.Parameters["@Bladder"].Value                  = ultrasoundReport.Bladder;
            UpdateCommand.Parameters["@Uterus"].Value                   = ultrasoundReport.Uterus;
            UpdateCommand.Parameters["@Ovary"].Value                    = ultrasoundReport.Ovary;
            UpdateCommand.Parameters["@Others"].Value                   = ultrasoundReport.Others;
            UpdateCommand.Parameters["@Impression"].Value               = ultrasoundReport.Impression;
            UpdateCommand.Parameters["@UltrasoundReportDate"].Value     = ultrasoundReport.UltrasoundReportDate;
            UpdateCommand.Parameters["@ConsultantRadiologist"].Value    = ultrasoundReport.ConsultantRadiologist;
            UpdateCommand.Parameters["@Status"].Value                   = ultrasoundReport.Status;

            int returnValue = -1;

            try
            {
                UpdateCommand.Connection.Open();
                returnValue = UpdateCommand.ExecuteNonQuery();
            }
            catch (SqlException ex)
            {
                Logger.Write(ex);
            }
            finally
            {
                UpdateCommand.Connection.Close();
            }
            return(returnValue);
        }
Beispiel #2
0
        private UltrasoundReport DataTableToEntity(DataTable dt)
        {
            UltrasoundReport ultrasoundReport = new UltrasoundReport();

            if (Null.IsNotNull(dt) == true && dt.Rows.Count > 0)
            {
                if (Null.IsNotNull(dt.Rows[0]))
                {
                    DataRow dr = dt.Rows[0];
                    if (Null.IsNotNull(dr["ID"]))
                    {
                        ultrasoundReport.ID = Convert.ToInt32(dr["ID"]);
                    }
                    else
                    {
                        ultrasoundReport.ID = 0;
                    }
                    if (Null.IsNotNull(dr["PatientID"]))
                    {
                        ultrasoundReport.PatientID = Convert.ToInt32(dr["PatientID"]);
                    }
                    else
                    {
                        ultrasoundReport.PatientID = 0;
                    }
                    if (Null.IsNotNull(dr["PatientName"]))
                    {
                        ultrasoundReport.PatientName = Convert.ToString(dr["PatientName"]);
                    }
                    else
                    {
                        ultrasoundReport.PatientName = string.Empty;
                    }
                    if (Null.IsNotNull(dr["DOB"]))
                    {
                        ultrasoundReport.DOB = Convert.ToDateTime(dr["DOB"]);
                    }
                    else
                    {
                        ultrasoundReport.DOB = DateTime.Now;
                    }
                    if (Null.IsNotNull(dr["Sex"]))
                    {
                        ultrasoundReport.Sex = Convert.ToString(dr["Sex"]);
                    }
                    else
                    {
                        ultrasoundReport.Sex = string.Empty;
                    }
                    if (Null.IsNotNull(dr["ImagePath"]))
                    {
                        ultrasoundReport.ImagePath = Convert.ToString(dr["ImagePath"]);
                    }
                    else
                    {
                        ultrasoundReport.ImagePath = string.Empty;
                    }
                    if (Null.IsNotNull(dr["LiverSize"]))
                    {
                        ultrasoundReport.LiverSize = Convert.ToString(dr["LiverSize"]);
                    }
                    else
                    {
                        ultrasoundReport.LiverSize = string.Empty;
                    }
                    if (Null.IsNotNull(dr["LiverMargin"]))
                    {
                        ultrasoundReport.LiverMargin = Convert.ToString(dr["LiverMargin"]);
                    }
                    else
                    {
                        ultrasoundReport.LiverMargin = string.Empty;
                    }
                    if (Null.IsNotNull(dr["LiverSOL"]))
                    {
                        ultrasoundReport.LiverSOL = Convert.ToString(dr["LiverSOL"]);
                    }
                    else
                    {
                        ultrasoundReport.LiverSOL = string.Empty;
                    }
                    if (Null.IsNotNull(dr["LiverEchogenicity"]))
                    {
                        ultrasoundReport.LiverEchogenicity = Convert.ToString(dr["LiverEchogenicity"]);
                    }
                    else
                    {
                        ultrasoundReport.LiverEchogenicity = string.Empty;
                    }
                    if (Null.IsNotNull(dr["LiverCaudatelobe"]))
                    {
                        ultrasoundReport.LiverCaudatelobe = Convert.ToString(dr["LiverCaudatelobe"]);
                    }
                    else
                    {
                        ultrasoundReport.LiverCaudatelobe = string.Empty;
                    }
                    if (Null.IsNotNull(dr["GallBLadderWallThickness"]))
                    {
                        ultrasoundReport.GallBLadderWallThickness = Convert.ToString(dr["GallBLadderWallThickness"]);
                    }
                    else
                    {
                        ultrasoundReport.GallBLadderWallThickness = string.Empty;
                    }
                    if (Null.IsNotNull(dr["GallBLadderContent"]))
                    {
                        ultrasoundReport.GallBLadderContent = Convert.ToString(dr["GallBLadderContent"]);
                    }
                    else
                    {
                        ultrasoundReport.GallBLadderContent = string.Empty;
                    }
                    if (Null.IsNotNull(dr["HepaticDucts"]))
                    {
                        ultrasoundReport.HepaticDucts = Convert.ToString(dr["HepaticDucts"]);
                    }
                    else
                    {
                        ultrasoundReport.HepaticDucts = string.Empty;
                    }
                    if (Null.IsNotNull(dr["CBD"]))
                    {
                        ultrasoundReport.CBD = Convert.ToString(dr["CBD"]);
                    }
                    else
                    {
                        ultrasoundReport.CBD = string.Empty;
                    }
                    if (Null.IsNotNull(dr["Pancreas"]))
                    {
                        ultrasoundReport.Pancreas = Convert.ToString(dr["Pancreas"]);
                    }
                    else
                    {
                        ultrasoundReport.Pancreas = string.Empty;
                    }
                    if (Null.IsNotNull(dr["Spleen"]))
                    {
                        ultrasoundReport.Spleen = Convert.ToString(dr["Spleen"]);
                    }
                    else
                    {
                        ultrasoundReport.Spleen = string.Empty;
                    }
                    if (Null.IsNotNull(dr["RightKidney"]))
                    {
                        ultrasoundReport.RightKidney = Convert.ToString(dr["RightKidney"]);
                    }
                    else
                    {
                        ultrasoundReport.RightKidney = string.Empty;
                    }
                    if (Null.IsNotNull(dr["LeftKidney"]))
                    {
                        ultrasoundReport.LeftKidney = Convert.ToString(dr["LeftKidney"]);
                    }
                    else
                    {
                        ultrasoundReport.LeftKidney = string.Empty;
                    }
                    if (Null.IsNotNull(dr["Bladder"]))
                    {
                        ultrasoundReport.Bladder = Convert.ToString(dr["Bladder"]);
                    }
                    else
                    {
                        ultrasoundReport.Bladder = string.Empty;
                    }
                    if (Null.IsNotNull(dr["Uterus"]))
                    {
                        ultrasoundReport.Uterus = Convert.ToString(dr["Uterus"]);
                    }
                    else
                    {
                        ultrasoundReport.Uterus = string.Empty;
                    }
                    if (Null.IsNotNull(dr["Ovary"]))
                    {
                        ultrasoundReport.Ovary = Convert.ToString(dr["Ovary"]);
                    }
                    else
                    {
                        ultrasoundReport.Ovary = string.Empty;
                    }
                    if (Null.IsNotNull(dr["Others"]))
                    {
                        ultrasoundReport.Others = Convert.ToString(dr["Others"]);
                    }
                    else
                    {
                        ultrasoundReport.Others = string.Empty;
                    }
                    if (Null.IsNotNull(dr["Impression"]))
                    {
                        ultrasoundReport.Impression = Convert.ToString(dr["Impression"]);
                    }
                    else
                    {
                        ultrasoundReport.Impression = string.Empty;
                    }
                    if (Null.IsNotNull(dr["UltrasoundReportDate"]))
                    {
                        ultrasoundReport.UltrasoundReportDate = Convert.ToDateTime(dr["UltrasoundReportDate"]);
                    }
                    else
                    {
                        ultrasoundReport.UltrasoundReportDate = DateTime.Now;
                    }
                    if (Null.IsNotNull(dr["ConsultantRadiologist"]))
                    {
                        ultrasoundReport.ConsultantRadiologist = Convert.ToString(dr["ConsultantRadiologist"]);
                    }
                    else
                    {
                        ultrasoundReport.ConsultantRadiologist = string.Empty;
                    }
                    if (Null.IsNotNull(dr["Status"]))
                    {
                        ultrasoundReport.Status = Convert.ToString(dr["Status"]);
                    }
                    else
                    {
                        ultrasoundReport.Status = string.Empty;
                    }
                }
            }
            return(ultrasoundReport);
        }