Example #1
0
        public static YellowstonePathology.Business.ClientOrder.Model.ClientOrder BuildClientOrder(SqlDataReader dr)
        {
            YellowstonePathology.Business.ClientOrder.Model.ClientOrder clientOrder = null;
            Nullable<int> panelSetId = null;
            while (dr.Read())
            {
                if (dr["PanelSetId"] != DBNull.Value)
                {
                    panelSetId = Convert.ToInt32(dr["PanelSetId"].ToString());
                }
            }

            clientOrder = YellowstonePathology.Business.ClientOrder.Model.ClientOrderFactory.GetClientOrder(panelSetId);
            dr.NextResult();

            while (dr.Read())
            {
                YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientOrder, dr);
                propertyWriter.WriteProperties();
            }

            dr.NextResult();
            while (dr.Read())
            {
                YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation();
                YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter(clientLocation, dr);
                propertyWriter.WriteProperties();
                clientOrder.ClientLocation = clientLocation;
            }

            return clientOrder;
        }
 private void BuildClient(YellowstonePathology.Business.Client.Model.Client client)
 {
     using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
     {
         cn.Open();
         this.m_SQLCommand.Connection = cn;
         using (SqlDataReader dr = this.m_SQLCommand.ExecuteReader(CommandBehavior.KeyInfo))
         {
             while (dr.Read())
             {
                 Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(client, dr);
                 sqlDataReaderPropertyWriter.WriteProperties();
             }
             if (dr.IsClosed == false)
             {
                 dr.NextResult();
                 while (dr.Read())
                 {
                     YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation();
                     Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientLocation, dr);
                     sqlDataReaderPropertyWriter.WriteProperties();
                     client.ClientLocationCollection.Add(clientLocation);
                 }
             }
         }
     }
 }
Example #3
0
        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);
        }
Example #4
0
        public void Join(ClientOrder clientOrderToReadFrom)
        {
            YellowstonePathology.Business.Persistence.ObjectPropertyWriter objectPropertyWriter = new Persistence.ObjectPropertyWriter(this, clientOrderToReadFrom);
            objectPropertyWriter.WriteProperties();

            this.ClientLocation = clientOrderToReadFrom.ClientLocation;

            foreach (YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail clientOrderDetail in clientOrderToReadFrom.ClientOrderDetailCollection)
            {
                this.ClientOrderDetailCollection.AddIfNotExist(clientOrderDetail);
            }
        }
Example #5
0
 private void BuildLocation(YellowstonePathology.Business.Client.Model.Client client, XElement clientElement)
 {
     List<XElement> clientLocationElements = (from item in clientElement.Elements("ClientLocationCollection")
                                                  select item).ToList<XElement>();
     foreach (XElement clientLocationElement in clientLocationElements.Elements("ClientLocation"))
     {
         YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation();
         YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(clientLocationElement, clientLocation);
         xmlPropertyWriter.Write();
         client.ClientLocationCollection.Add(clientLocation);
     }
 }
Example #6
0
        private void BuildLocation(YellowstonePathology.Business.Client.Model.Client client, XElement clientElement)
        {
            List <XElement> clientLocationElements = (from item in clientElement.Elements("ClientLocationCollection")
                                                      select item).ToList <XElement>();

            foreach (XElement clientLocationElement in clientLocationElements.Elements("ClientLocation"))
            {
                YellowstonePathology.Business.Client.Model.ClientLocation   clientLocation    = new YellowstonePathology.Business.Client.Model.ClientLocation();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(clientLocationElement, clientLocation);
                xmlPropertyWriter.Write();
                client.ClientLocationCollection.Add(clientLocation);
            }
        }
        public void BuildClientOrder()
        {
            while (this.m_DataReader.Read())
            {
                YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(this.m_ClientOrder, this.m_DataReader);
                propertyWriter.WriteProperties();
            }

            this.m_DataReader.NextResult();
            while (this.m_DataReader.Read())
            {
                YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation();
                YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter(clientLocation, this.m_DataReader);
                propertyWriter.WriteProperties();
                this.m_ClientOrder.ClientLocation = clientLocation;
            }
        }
Example #8
0
 private void BuildClient(YellowstonePathology.Business.Client.Model.Client client)
 {
     using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
     {
         cn.Open();
         this.m_SQLCommand.Connection = cn;
         using (MySqlDataReader dr = this.m_SQLCommand.ExecuteReader(CommandBehavior.KeyInfo))
         {
             while (dr.Read())
             {
                 Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(client, dr);
                 sqlDataReaderPropertyWriter.WriteProperties();
             }
             if (dr.IsClosed == false)
             {
                 dr.NextResult();
                 while (dr.Read())
                 {
                     YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation();
                     Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter      = new Persistence.SqlDataReaderPropertyWriter(clientLocation, dr);
                     sqlDataReaderPropertyWriter.WriteProperties();
                     client.ClientLocationCollection.Add(clientLocation);
                 }
             }
         }
     }
 }
Example #9
0
        public void BuildClientOrder()
        {
            while (this.m_DataReader.Read())
            {
                YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(this.m_ClientOrder, this.m_DataReader);
                propertyWriter.WriteProperties();
            }

            this.m_DataReader.NextResult();
            while (this.m_DataReader.Read())
            {
                YellowstonePathology.Business.Client.Model.ClientLocation             clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation();
                YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter(clientLocation, this.m_DataReader);
                propertyWriter.WriteProperties();
                this.m_ClientOrder.ClientLocation = clientLocation;
            }
        }
Example #10
0
        public static YellowstonePathology.Business.ClientOrder.Model.ClientOrder BuildClientOrder(MySqlDataReader dr)
        {
            YellowstonePathology.Business.ClientOrder.Model.ClientOrder clientOrder = null;
            Nullable <int> panelSetId = null;

            while (dr.Read())
            {
                if (dr["PanelSetId"] != DBNull.Value)
                {
                    panelSetId = Convert.ToInt32(dr["PanelSetId"].ToString());
                }
            }

            clientOrder = YellowstonePathology.Business.ClientOrder.Model.ClientOrderFactory.GetClientOrder(panelSetId);
            dr.NextResult();

            while (dr.Read())
            {
                YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientOrder, dr);
                propertyWriter.WriteProperties();
            }

            dr.NextResult();
            while (dr.Read())
            {
                YellowstonePathology.Business.Client.Model.ClientLocation             clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation();
                YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter(clientLocation, dr);
                propertyWriter.WriteProperties();
                clientOrder.ClientLocation = clientLocation;
            }

            return(clientOrder);
        }
 private static YellowstonePathology.Business.Client.Model.ClientCollection BuildClientCollection(SqlCommand cmd)
 {
     Client.Model.ClientCollection result = new Client.Model.ClientCollection();
     using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
     {
         cn.Open();
         cmd.Connection = cn;
         using (SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.KeyInfo))
         {
             while (dr.Read())
             {
                 Client.Model.Client client = new YellowstonePathology.Business.Client.Model.Client();
                 Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(client, dr);
                 sqlDataReaderPropertyWriter.WriteProperties();
                 result.Add(client);
             }
             if (dr.IsClosed == false)
             {
                 dr.NextResult();
                 while (dr.Read())
                 {
                     YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation();
                     Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientLocation, dr);
                     sqlDataReaderPropertyWriter.WriteProperties();
                     foreach (Client.Model.Client client in result)
                     {
                         if (client.ClientId == clientLocation.ClientId)
                         {
                             client.ClientLocationCollection.Add(clientLocation);
                             break;
                         }
                     }
                 }
             }
         }
     }
     return result;
 }