コード例 #1
0
        public MaterialBatchPage(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch,
                                 bool backButtonVisible, bool nextButtonVisible, bool finishButtonVisible,
                                 bool useMasterAccessionNo, string masterAccessionNo, YellowstonePathology.UI.Navigation.PageNavigator pageNavigator)
        {
            this.m_PageNavigator = pageNavigator;

            this.m_MaterialTrackingBatch = materialTrackingBatch;

            this.m_UserMasterAccessionNo = useMasterAccessionNo;
            this.m_MasterAccessionNo     = masterAccessionNo;

            if (this.m_UserMasterAccessionNo == true)
            {
                this.m_MaterialTrackingLogViewCollection = YellowstonePathology.Business.Gateway.SlideAccessionGateway.GetMaterialTrackingLogViewCollectionByBatchIdMasterAccessionNo(this.m_MaterialTrackingBatch.MaterialTrackingBatchId, masterAccessionNo);
            }
            else
            {
                this.m_MaterialTrackingLogViewCollection = YellowstonePathology.Business.Gateway.SlideAccessionGateway.GetMaterialTrackingLogViewCollectionByBatchId(this.m_MaterialTrackingBatch.MaterialTrackingBatchId);
            }

            this.m_BackButtonVisible   = backButtonVisible;
            this.m_NextButtonVisible   = nextButtonVisible;
            this.m_FinishButtonVisible = finishButtonVisible;

            this.m_LocationList = Business.Gateway.AccessionOrderGateway.GetAllLocations();

            InitializeComponent();
            DataContext = this;

            Loaded   += new RoutedEventHandler(MaterialBatchPage_Loaded);
            Unloaded += new RoutedEventHandler(MaterialBatchPage_Unloaded);
        }
コード例 #2
0
        public MaterialBatchPage(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch,
			YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogCollection materialTrackingLogCollection,
            bool backButtonVisible, bool nextButtonVisible, bool finishButtonVisible, 
			bool useMasterAccessionNo, string masterAccessionNo, YellowstonePathology.UI.Navigation.PageNavigator pageNavigator)
        {
            this.m_FacilityCollection = YellowstonePathology.Business.Facility.Model.FacilityCollection.GetAllFacilities();
            this.m_LocationCollection = YellowstonePathology.Business.Facility.Model.LocationCollection.GetAllLocations();

            this.m_PageNavigator = pageNavigator;

            this.m_MaterialTrackingBatch = materialTrackingBatch;
            this.m_MaterialTrackingLogCollection = materialTrackingLogCollection;

            this.m_UserMasterAccessionNo = useMasterAccessionNo;
            this.m_MasterAccessionNo = masterAccessionNo;

            if (this.m_UserMasterAccessionNo == true)
            {
                this.m_MaterialTrackingLogViewCollection = YellowstonePathology.Business.Gateway.SlideAccessionGateway.GetMaterialTrackingLogViewCollectionByBatchIdMasterAccessionNo(this.m_MaterialTrackingBatch.MaterialTrackingBatchId, masterAccessionNo);
            }
            else
            {
                this.m_MaterialTrackingLogViewCollection = YellowstonePathology.Business.Gateway.SlideAccessionGateway.GetMaterialTrackingLogViewCollectionByBatchId(this.m_MaterialTrackingBatch.MaterialTrackingBatchId);
            }

            this.m_BackButtonVisible = backButtonVisible;
            this.m_NextButtonVisible = nextButtonVisible;
            this.m_FinishButtonVisible = finishButtonVisible;

            InitializeComponent();
            DataContext = this;

            Loaded += new RoutedEventHandler(MaterialBatchPage_Loaded);
            Unloaded += new RoutedEventHandler(MaterialBatchPage_Unloaded);
        }
コード例 #3
0
        public MaterialTrackingBatchSummary(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch,
			YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection materialTrackingLogViewCollection)
        {
            this.m_MaterialTrackingBatch = materialTrackingBatch;
            this.m_MaterialTrackingLogViewCollection = materialTrackingLogViewCollection;

            YellowstonePathology.Document.Xps.PlainHeader header = new YellowstonePathology.Document.Xps.PlainHeader("Yellowstone Pathology Institute - Material Distribution Report");
            YellowstonePathology.Document.Xps.NoFooter footer = new YellowstonePathology.Document.Xps.NoFooter();

            this.m_ReportDocument = new YellowstonePathology.Document.Xps.ReportDocument(header, footer);

            int totalMaterialCount = 0;

            MaterialTrackingSummaryCollection materialTrackingSummaryCollection = new MaterialTrackingSummaryCollection();

            List<string> materialTypeList = this.m_MaterialTrackingLogViewCollection.GetDistinctMaterialTypes();
            List<string> masterAccessionNoList = this.m_MaterialTrackingLogViewCollection.GetMasterAccessionNoList();

            foreach (string masterAccessionNo in masterAccessionNoList)
            {
                MaterialTrackingSummary materialTrackingSummary = new MaterialTrackingSummary(masterAccessionNo, false);

                foreach (string materialType in materialTypeList)
                {
                    int materialCount = this.m_MaterialTrackingLogViewCollection.GetMaterialCount(masterAccessionNo, materialType);
                    MaterialTrackingSummaryColumn materialTrackingSummaryColumn = new MaterialTrackingSummaryColumn(materialType, materialCount);
                    materialTrackingSummary.ColumnList.Add(materialTrackingSummaryColumn);
                    totalMaterialCount += materialCount;
                }
                materialTrackingSummaryCollection.Add(materialTrackingSummary);
            }

            this.WriteHeadingsGrid(materialTypeList);
            foreach (MaterialTrackingSummary materialTrackingSummary in materialTrackingSummaryCollection)
            {
                this.WriteReportLine(materialTrackingSummary);
            }

            if (materialTrackingSummaryCollection.Count > 0)
            {
                materialTrackingSummaryCollection.SetTotals();
                this.WriteTotalLine(materialTrackingSummaryCollection[materialTrackingSummaryCollection.Count - 1]);
            }
        }
コード例 #4
0
        public MaterialTrackingBatchSummary(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch,
                                            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection materialTrackingLogViewCollection)
        {
            this.m_MaterialTrackingBatch             = materialTrackingBatch;
            this.m_MaterialTrackingLogViewCollection = materialTrackingLogViewCollection;

            YellowstonePathology.Document.Xps.PlainHeader header = new YellowstonePathology.Document.Xps.PlainHeader("Yellowstone Pathology Institute - Material Distribution Report");
            YellowstonePathology.Document.Xps.NoFooter    footer = new YellowstonePathology.Document.Xps.NoFooter();

            this.m_ReportDocument = new YellowstonePathology.Document.Xps.ReportDocument(header, footer);

            int totalMaterialCount = 0;

            MaterialTrackingSummaryCollection materialTrackingSummaryCollection = new MaterialTrackingSummaryCollection();

            List <string> materialTypeList      = this.m_MaterialTrackingLogViewCollection.GetDistinctMaterialTypes();
            List <string> masterAccessionNoList = this.m_MaterialTrackingLogViewCollection.GetMasterAccessionNoList();

            foreach (string masterAccessionNo in masterAccessionNoList)
            {
                MaterialTrackingSummary materialTrackingSummary = new MaterialTrackingSummary(masterAccessionNo, false);

                foreach (string materialType in materialTypeList)
                {
                    int materialCount = this.m_MaterialTrackingLogViewCollection.GetMaterialCount(masterAccessionNo, materialType);
                    MaterialTrackingSummaryColumn materialTrackingSummaryColumn = new MaterialTrackingSummaryColumn(materialType, materialCount);
                    materialTrackingSummary.ColumnList.Add(materialTrackingSummaryColumn);
                    totalMaterialCount += materialCount;
                }
                materialTrackingSummaryCollection.Add(materialTrackingSummary);
            }

            this.WriteHeadingsGrid(materialTypeList);
            foreach (MaterialTrackingSummary materialTrackingSummary in materialTrackingSummaryCollection)
            {
                this.WriteReportLine(materialTrackingSummary);
            }

            if (materialTrackingSummaryCollection.Count > 0)
            {
                materialTrackingSummaryCollection.SetTotals();
                this.WriteTotalLine(materialTrackingSummaryCollection[materialTrackingSummaryCollection.Count - 1]);
            }
        }
コード例 #5
0
        public static YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection GetMaterialTrackingLogViewCollectionByBatchIdMasterAccessionNo(string materialTrackingBatchId, string masterAccessionNo)
        {
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection result = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection();
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "Select * from ViewMaterialTrackingLog where MaterialTrackingBatchId = @MaterialTrackingBatchId and MasterAccessionNo = @MasterAccessionNo";
            cmd.CommandType = System.Data.CommandType.Text;
            cmd.Parameters.Add("@MaterialTrackingBatchId", System.Data.SqlDbType.VarChar).Value = materialTrackingBatchId;
            cmd.Parameters.Add("@MasterAccessionNo", System.Data.SqlDbType.VarChar).Value = masterAccessionNo;

            using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView materialTrackingLogView = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(materialTrackingLogView, dr);
                        propertyWriter.WriteProperties();
                        result.Add(materialTrackingLogView);
                    }
                }
            }

            return result;
        }
コード例 #6
0
        public static YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection GetMaterialTrackingLogViewCollectionByBatchIdMasterAccessionNo(string materialTrackingBatchId, string masterAccessionNo)
        {
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection result = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection();
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "Select * from ViewMaterialTrackingLog where MaterialTrackingBatchId = @MaterialTrackingBatchId and MasterAccessionNo = @MasterAccessionNo";
            cmd.CommandType = System.Data.CommandType.Text;
            cmd.Parameters.Add("@MaterialTrackingBatchId", System.Data.SqlDbType.VarChar).Value = materialTrackingBatchId;
            cmd.Parameters.Add("@MasterAccessionNo", System.Data.SqlDbType.VarChar).Value       = masterAccessionNo;

            using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView materialTrackingLogView = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter        propertyWriter          = new Persistence.SqlDataReaderPropertyWriter(materialTrackingLogView, dr);
                        propertyWriter.WriteProperties();
                        result.Add(materialTrackingLogView);
                    }
                }
            }

            return(result);
        }
コード例 #7
0
 public MaterialTrackingBatchEventArgs(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch,
                                       YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection materialTrackingLogViewCollection)
 {
     this.m_MaterialTrackingBatch             = materialTrackingBatch;
     this.m_MaterialTrackingLogViewCollection = materialTrackingLogViewCollection;
 }
コード例 #8
0
        public static YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection GetMaterialTrackingLogViewCollectionByBatchId(string materialTrackingBatchId)
        {
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection result = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection();
            string sql = "SELECT " +
                         "mtb.MaterialTrackingBatchId AS MaterialTrackingBatchId, " +
                         "mtl.MaterialTrackingLogId AS MaterialTrackingLogId, " +
                         "ao.MasterAccessionNo AS MasterAccessionNo, " +
                         "ao.ClientAccessionNo AS ClientAccessionNo, " +
                         "ao.PLastName AS PLastName, " +
                         "ao.PFirstName AS PFirstName, " +
                         "mtl.MaterialType AS MaterialType, " +
                         " mtl.MaterialId AS MaterialId, " +
                         "mtl.LogDate AS LogDate, " +
                         "(CASE " +
                         "WHEN " +
                         "(mtl.MaterialType = 'Slide') " +
                         "THEN " +
                         "(SELECT " +
                         "tblSlideOrder.Label " +
                         "FROM " +
                         "tblSlideOrder " +
                         "WHERE " +
                         "(tblSlideOrder.SlideOrderId = mtl.MaterialId)) " +
                         "ELSE 'None' " +
                         "END) AS `MaterialLabel`, " +
                         "mtl.LoggedBy AS `LoggedBy` " +
                         "FROM " +
                         "tblMaterialTrackingBatch mtb " +
                         "JOIN tblMaterialTrackingLog mtl ON mtb.MaterialTrackingBatchId = mtl.MaterialTrackingBatchId " +
                         "Left JOIN tblAccessionOrder ao ON mtl.MasterAccessionNo = ao.MasterAccessionNo " +
                         "where mtb.MaterialTrackingBatchId = @MaterialTrackingBatchId order by mtl.LogDate desc";

            MySqlCommand cmd = new MySqlCommand();

            cmd.CommandText = sql;
            cmd.CommandType = System.Data.CommandType.Text;
            cmd.Parameters.AddWithValue("@MaterialTrackingBatchId", materialTrackingBatchId);

            using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (MySqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView materialTrackingLogView = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter        propertyWriter          = new Persistence.SqlDataReaderPropertyWriter(materialTrackingLogView, dr);
                        propertyWriter.WriteProperties();
                        result.Add(materialTrackingLogView);
                    }
                }
            }

            return(result);
        }