public YellowstonePathology.Business.Client.Model.ClientLocation GetClientLocation(int clientLocationId) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * from tblClientLocation where ClientLocationId = @ClientLocationId"; SqlParameter clientLocationIdParameter = new SqlParameter("@ClientLocationId", SqlDbType.Int); clientLocationIdParameter.Value = clientLocationId; cmd.Parameters.Add(clientLocationIdParameter); cmd.CommandType = System.Data.CommandType.StoredProcedure; YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = null; using (SqlConnection cn = new SqlConnection(YpiConnect.Service.Properties.Settings.Default.ServerSqlConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { clientLocation = new Business.Client.Model.ClientLocation(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter(clientLocation, dr); propertyWriter.WriteProperties(); } } } return clientLocation; }
private void ButtonAddClientLocation_Click(object sender, RoutedEventArgs e) { string location = "Medical Records"; if (this.m_Client.ClientLocationCollection.Exists(location) == false) { string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); int locationId = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetLargestClientLocationId(); locationId++; YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new Business.Client.Model.ClientLocation(); clientLocation.ObjectId = objectId; clientLocation.ClientLocationId = locationId; clientLocation.ClientId = this.m_Client.ClientId; clientLocation.Location = location; clientLocation.OrderType = "REQUISITION"; clientLocation.SpecimenTrackingInitiated = "Ypii Lab"; clientLocation.AllowMultipleOrderTypes = true; clientLocation.DefaultOrderPanelSetId = 13; clientLocation.AllowMultipleOrderDetailTypes = false; clientLocation.DefaultOrderDetailTypeCode = "SRGCL"; this.m_Client.ClientLocationCollection.Add(clientLocation); //YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(clientLocation, this.m_ParentWindow, this.m_SystemIdentity); } }
public YellowstonePathology.Business.Client.Model.ClientLocation GetClientLocation(int clientLocationId) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * from tblClientLocation where ClientLocationId = @ClientLocationId"; SqlParameter clientLocationIdParameter = new SqlParameter("@ClientLocationId", SqlDbType.Int); clientLocationIdParameter.Value = clientLocationId; cmd.Parameters.Add(clientLocationIdParameter); cmd.CommandType = System.Data.CommandType.StoredProcedure; YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = null; using (SqlConnection cn = new SqlConnection(YpiConnect.Service.Properties.Settings.Default.ServerSqlConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { clientLocation = new Business.Client.Model.ClientLocation(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter(clientLocation, dr); propertyWriter.WriteProperties(); } } } return(clientLocation); }
private void AddClientLocation(string orderType) { if (this.m_Client.ClientLocationCollection.Exists("Medical Records") == false) { string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); int locationId = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetLargestClientLocationId(); locationId++; YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new Business.Client.Model.ClientLocation(); clientLocation.ObjectId = objectId; clientLocation.ClientLocationId = locationId; clientLocation.ClientId = this.m_Client.ClientId; clientLocation.Location = "Medical Records"; clientLocation.OrderType = orderType; clientLocation.SpecimenTrackingInitiated = "Ypii Lab"; clientLocation.AllowMultipleOrderTypes = true; clientLocation.DefaultOrderPanelSetId = 13; clientLocation.AllowMultipleOrderDetailTypes = false; clientLocation.DefaultOrderDetailTypeCode = "SRGCL"; this.m_Client.ClientLocationCollection.Add(clientLocation); } }
private void ButtonAddClientLocation_Click(object sender, RoutedEventArgs e) { string location = "Medical Records"; if (this.m_Client.ClientLocationCollection.Exists(location) == false) { string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); int locationId = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetLargestClientLocationId(); locationId++; YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new Business.Client.Model.ClientLocation(); clientLocation.ObjectId = objectId; clientLocation.ClientLocationId = locationId; clientLocation.ClientId = this.m_Client.ClientId; clientLocation.Location = location; clientLocation.OrderType = "REQUISITION"; clientLocation.SpecimenTrackingInitiated = "Ypii Lab"; clientLocation.AllowMultipleOrderTypes = true; clientLocation.DefaultOrderPanelSetId = 13; clientLocation.AllowMultipleOrderDetailTypes = false; clientLocation.DefaultOrderDetailTypeCode = "SRGCL"; this.m_Client.ClientLocationCollection.Add(clientLocation); } }