Example #1
0
        public static YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch GetOpenBatchForFacilityLocation(string facilityId, string locationId)
        {
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch result = null;

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "select * from tblMaterialTrackingBatch where IsOpen = 1 and FromFacilityId = @FacilityId and FromLocationId = @LocationId";
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("@FacilityId", SqlDbType.VarChar).Value = facilityId;
            cmd.Parameters.Add("@LocationId", SqlDbType.VarChar).Value = locationId;

            using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        result = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                    }
                }
            }
            return(result);
        }
Example #2
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);
        }
        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);
        }
Example #4
0
        private void Build(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch)
        {
            using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                m_SQLCommand.Connection = cn;

                using (MySqlDataReader dr = m_SQLCommand.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(materialTrackingBatch, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                    }
                    dr.NextResult();

                    while (dr.Read())
                    {
                        YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog         = new MaterialTracking.Model.MaterialTrackingLog();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter    sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(materialTrackingLog, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                        materialTrackingBatch.MaterialTrackingLogCollection.Add(materialTrackingLog);
                    }
                }
            }
        }
Example #5
0
 private void ShowMaterialBatchPage(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch)
 {
     this.m_MaterialBatchPage       = new MaterialBatchPage(materialTrackingBatch, true, true, false, this.m_UseMasterAccessionNo, this.m_MasterAccessionNo, this.m_LoginPageWindow.PageNavigator);
     this.m_MaterialBatchPage.Back += new MaterialBatchPage.BackEventHandler(MaterialBatchPage_Back);
     this.m_MaterialBatchPage.Next += new MaterialBatchPage.NextEventHandler(MaterialBatchPage_Next);
     this.m_MaterialBatchPage.ShowTrackingDocument += new MaterialBatchPage.ShowTrackingDocumentEventHandler(MaterialBatchPage_ShowTrackingDocument);
     this.m_LoginPageWindow.PageNavigator.Navigate(this.m_MaterialBatchPage);
 }
Example #6
0
 private void ShowMaterialBatchPage(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch,
                                    YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogCollection materialTrackingLogCollection)
 {
     YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullMaterialTrackingBatch(materialTrackingBatch, m_LoginPageWindow);
     this.m_MaterialBatchPage       = new MaterialBatchPage(materialTrackingBatch, materialTrackingLogCollection, true, true, false, this.m_UseMasterAccessionNo, this.m_MasterAccessionNo, this.m_LoginPageWindow.PageNavigator);
     this.m_MaterialBatchPage.Back += new MaterialBatchPage.BackEventHandler(MaterialBatchPage_Back);
     this.m_MaterialBatchPage.Next += new MaterialBatchPage.NextEventHandler(MaterialBatchPage_Next);
     this.m_MaterialBatchPage.ShowTrackingDocument += new MaterialBatchPage.ShowTrackingDocumentEventHandler(MaterialBatchPage_ShowTrackingDocument);
     this.m_LoginPageWindow.PageNavigator.Navigate(this.m_MaterialBatchPage);
 }
Example #7
0
        public void PullMaterialTrackingBatch(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch, object writer)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "Select * from tblMaterialTrackingBatch where MaterialTrackingBatchId = @MaterialTrackingBatchId";
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("@MaterialTrackingBatchId", SqlDbType.VarChar).Value = materialTrackingBatch.MaterialTrackingBatchId;

            GenericDocumentBuilder builder = new GenericDocumentBuilder(cmd, typeof(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch));

            DocumentId documentId = new DocumentId(materialTrackingBatch, writer);
            Document   document   = this.m_Stack.Pull(documentId, builder);
        }
        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]);
            }
        }
        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]);
            }
        }
        private void HyperlinkViewSelectedBatch_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListBoxMaterialTrackingBatch.SelectedItem != null)
            {
                YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch         materialTrackingBatch         = (YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch) this.ListBoxMaterialTrackingBatch.SelectedItem;
                YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogCollection materialTrackingLogCollection = null;

                if (this.m_UseMasterAccessionNo == true)
                {
                    materialTrackingLogCollection = YellowstonePathology.Business.Gateway.SlideAccessionGateway.GetMaterialTrackingLogCollectionByBatchIdMasterAccessionNo(materialTrackingBatch.MaterialTrackingBatchId, this.m_MasterAccessionNo);
                }
                else
                {
                    materialTrackingLogCollection = YellowstonePathology.Business.Gateway.SlideAccessionGateway.GetMaterialTrackingLogCollectionByBatchId(materialTrackingBatch.MaterialTrackingBatchId);
                }
                this.ViewBatch(this, new CustomEventArgs.MaterialTrackingBatchEventArgs(materialTrackingBatch, materialTrackingLogCollection));
            }
            else
            {
                MessageBox.Show("Please select a batch to view.");
            }
        }
Example #11
0
 public MaterialTrackingBatchEventArgs(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch,
                                       YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogCollection materialTrackingLogCollection)
 {
     this.m_MaterialTrackingBatch         = materialTrackingBatch;
     this.m_MaterialTrackingLogCollection = materialTrackingLogCollection;
 }
        private void HyperlinkReceiveMaterialFromBillings_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();

            YellowstonePathology.Business.Facility.Model.Facility fromFacility = new YellowstonePathology.Business.Facility.Model.YellowstonePathologyInstituteBillings();
            YellowstonePathology.Business.Facility.Model.Location fromLocation = new YellowstonePathology.Business.Facility.Model.LocationDefinitions.NullLocation();

            YellowstonePathology.Business.Facility.Model.Facility toFacility = new YellowstonePathology.Business.Facility.Model.YellowstonePathologyInstituteCody();
            YellowstonePathology.Business.Facility.Model.Location toLocation = new Business.Facility.Model.LocationDefinitions.PamCleggOffice();

            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch(objectId, "Receive material from Billings", fromFacility, fromLocation, toFacility, toLocation, this.m_MasterAccessionNo);
            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingBatch, Window.GetWindow(this));

            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogCollection materialTrackingLogCollection = new Business.MaterialTracking.Model.MaterialTrackingLogCollection();
            this.ViewBatch(this, new YellowstonePathology.UI.CustomEventArgs.MaterialTrackingBatchEventArgs(materialTrackingBatch, materialTrackingLogCollection));
        }
Example #13
0
 public static YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch GetMaterialTrackingBatch()
 {
     YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch result = null;
     return(result);
 }
        private void ListBoxMaterialTrackingBatch_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            this.SaveSlideTrackingLog();
            this.m_AccessionSlideOrderViewCollection.Clear();
            this.m_SlideTrackingLogCollection.Clear();

            if (this.ListBoxMaterialTrackingBatch.SelectedItem != null)
            {
                YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch = (YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch) this.ListBoxMaterialTrackingBatch.SelectedItem;
                this.m_AccessionSlideOrderViewCollection = YellowstonePathology.Business.Gateway.SlideAccessionGateway.GetAccessionSlideOrderViewCollectionByBatchId(materialTrackingBatch.MaterialTrackingBatchId);
                this.SlideCount   = this.m_AccessionSlideOrderViewCollection.Count;
                this.m_LocationId = this.GetLocationId(materialTrackingBatch.Description);
                NotifyPropertyChanged("AccessionSlideOrderViewCollection");
            }
        }
        private void HyperlinkSendMaterialFromCodyToBillings_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();

            YellowstonePathology.Business.Facility.Model.Facility fromFacility = new YellowstonePathology.Business.Facility.Model.YellowstonePathologistCody();
            YellowstonePathology.Business.Facility.Model.Location fromLocation = new YellowstonePathology.Business.Facility.Model.LocationDefinitions.PamCleggOffice();

            YellowstonePathology.Business.Facility.Model.Facility toFacility = new YellowstonePathology.Business.Facility.Model.YellowstonePathologyInstituteBillings();
            YellowstonePathology.Business.Facility.Model.Location toLocation = new YellowstonePathology.Business.Facility.Model.LocationDefinitions.NullLocation();

            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch(objectId, "Send material to Billings", fromFacility, fromLocation, toFacility, toLocation, this.m_MasterAccessionNo);
            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingBatch, Window.GetWindow(this));

            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogCollection materialTrackingLogCollection = new Business.MaterialTracking.Model.MaterialTrackingLogCollection();
            this.ViewBatch(this, new YellowstonePathology.UI.CustomEventArgs.MaterialTrackingBatchEventArgs(materialTrackingBatch, materialTrackingLogCollection));
        }
        private void HyperlinkSendMaterial_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();

            YellowstonePathology.Business.Facility.Model.Facility toFacility = new YellowstonePathology.Business.Facility.Model.NullFacility();
            YellowstonePathology.Business.Facility.Model.Location toLocation = new YellowstonePathology.Business.Facility.Model.LocationDefinitions.NullLocation();

            YellowstonePathology.Business.Facility.Model.Facility fromFacility = facilityCollection.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
            YellowstonePathology.Business.Facility.Model.Location fromLocation = fromFacility.Locations.GetLocation(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.LocationId);

            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch(objectId, null, fromFacility, fromLocation, toFacility, toLocation, this.m_MasterAccessionNo);
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogCollection materialTrackingLogCollection = new Business.MaterialTracking.Model.MaterialTrackingLogCollection();

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingBatch, Window.GetWindow(this));
            this.ViewBatch(this, new YellowstonePathology.UI.CustomEventArgs.MaterialTrackingBatchEventArgs(materialTrackingBatch, materialTrackingLogCollection));
        }
Example #17
0
        private void HyperlinkSendMaterialToDrClegg_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Facility.Model.Facility fromFacility = Business.Facility.Model.FacilityCollection.Instance.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
            string fromLocation = YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.HostName;

            YellowstonePathology.Business.Facility.Model.Facility toFacility = YellowstonePathology.Business.Facility.Model.FacilityCollection.Instance.GetByFacilityId("YPCDY");


            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch(objectId, "Send material to Dr. Clegg", fromFacility, fromLocation, toFacility, null, this.m_MasterAccessionNo);
            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingBatch, Window.GetWindow(this));

            this.ViewBatch(this, new YellowstonePathology.UI.CustomEventArgs.MaterialTrackingBatchEventArgs(materialTrackingBatch));
        }
Example #18
0
 private static YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatchCollection BuildMaterialTrackingBatchCollection(SqlCommand cmd)
 {
     YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatchCollection materialTrackingBatchCollection = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatchCollection();
     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.MaterialTrackingBatch materialTrackingBatch = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch();
                 YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter      propertyWriter        = new Persistence.SqlDataReaderPropertyWriter(materialTrackingBatch, dr);
                 propertyWriter.WriteProperties();
                 materialTrackingBatchCollection.Add(materialTrackingBatch);
             }
         }
     }
     return(materialTrackingBatchCollection);
 }
Example #19
0
        private void HyperlinkReceiveMaterialFromOffsiteStorage_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Facility.Model.Facility fromFacility = YellowstonePathology.Business.Facility.Model.FacilityCollection.Instance.GetByFacilityId("PFFSTSTRG");

            YellowstonePathology.Business.Facility.Model.Facility toFacility = Business.Facility.Model.FacilityCollection.Instance.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
            string toLocation = YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.HostName;

            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch(objectId, "Receive material from offsite storage.", fromFacility, null, toFacility, toLocation, this.m_MasterAccessionNo);
            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingBatch, Window.GetWindow(this));

            this.ViewBatch(this, new YellowstonePathology.UI.CustomEventArgs.MaterialTrackingBatchEventArgs(materialTrackingBatch));
        }
Example #20
0
 public MaterialTrackingBatchEventArgs(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch)
 {
     this.m_MaterialTrackingBatch = materialTrackingBatch;
 }
 private void HyperlinkDeleteSelectedBatch_Click(object sender, RoutedEventArgs e)
 {
     if (this.ListBoxMaterialTrackingBatch.SelectedItem != null)
     {
         YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch = (YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch) this.ListBoxMaterialTrackingBatch.SelectedItem;
         YellowstonePathology.Business.Persistence.DocumentGateway.Instance.DeleteDocument(materialTrackingBatch, Window.GetWindow(this));
         this.m_MaterialTrackingBatchCollection.Remove(materialTrackingBatch);
         this.NotifyPropertyChanged(string.Empty);
     }
     else
     {
         MessageBox.Show("Please select a batch to delete.");
     }
 }
        public static YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch GetOpenBatchForFacilityLocation(string facilityId, string locationId)
        {
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch result = null;

            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "select * from tblMaterialTrackingBatch where IsOpen = 1 and FromFacilityId = @FacilityId and FromLocationId = @LocationId";
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("@FacilityId", SqlDbType.VarChar).Value = facilityId;
            cmd.Parameters.Add("@LocationId", SqlDbType.VarChar).Value = locationId;

            using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        result = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                    }
                }
            }
            return result;
        }
 private static YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatchCollection BuildMaterialTrackingBatchCollection(SqlCommand cmd)
 {
     YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatchCollection materialTrackingBatchCollection = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatchCollection();
     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.MaterialTrackingBatch materialTrackingBatch = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch();
                 YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(materialTrackingBatch, dr);
                 propertyWriter.WriteProperties();
                 materialTrackingBatchCollection.Add(materialTrackingBatch);
             }
         }
     }
     return materialTrackingBatchCollection;
 }
        private void HyperlinkReceiveMaterial_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();

            YellowstonePathology.Business.Facility.Model.Facility fromFacility = new YellowstonePathology.Business.Facility.Model.NullFacility();
            YellowstonePathology.Business.Facility.Model.Location fromLocation = new YellowstonePathology.Business.Facility.Model.LocationDefinitions.NullLocation();

            YellowstonePathology.Business.Facility.Model.Facility toFacility = facilityCollection.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
            YellowstonePathology.Business.Facility.Model.Location toLocation = toFacility.Locations.GetLocation(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.LocationId);

            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch(objectId, null, fromFacility, fromLocation, toFacility, toLocation, this.m_MasterAccessionNo);

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingBatch, Window.GetWindow(this));
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogCollection materialTrackingLogCollection = new Business.MaterialTracking.Model.MaterialTrackingLogCollection();
            this.ViewBatch(this, new YellowstonePathology.UI.CustomEventArgs.MaterialTrackingBatchEventArgs(materialTrackingBatch, materialTrackingLogCollection));
        }
Example #25
0
        private void HyperlinkViewSelectedBatch_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListBoxMaterialTrackingBatch.SelectedItem != null)
            {
                string materialTrackingBatchId = ((YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch) this.ListBoxMaterialTrackingBatch.SelectedItem).MaterialTrackingBatchId;
                YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullMaterialTrackingBatch(materialTrackingBatchId, Window.GetWindow(this));

                if (this.m_UseMasterAccessionNo == true)
                {
                    materialTrackingBatch = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullMaterialTrackingBatchWithMasterAccessionNo(materialTrackingBatchId, this.m_MasterAccessionNo, Window.GetWindow(this));
                }
                else
                {
                    materialTrackingBatch = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullMaterialTrackingBatch(materialTrackingBatchId, Window.GetWindow(this));
                }

                this.ViewBatch(this, new CustomEventArgs.MaterialTrackingBatchEventArgs(materialTrackingBatch));
            }
            else
            {
                MessageBox.Show("Please select a batch to view.");
            }
        }