public SlideOrderReturnEventArgs(YellowstonePathology.Business.Slide.Model.SlideOrder slideOrder)
 {
     this.m_SlideOrder = slideOrder;
 }
 private void BuildTestOrderSlideOrderCollection(YellowstonePathology.Business.Test.Model.TestOrder testOrder, XElement testOrderElement)
 {
     List<XElement> slideOrderElements = (from item in testOrderElement.Elements("SlideOrderCollection")
                                                    select item).ToList<XElement>();
     foreach (XElement slideOrderElement in slideOrderElements.Elements("SlideOrder"))
     {
         YellowstonePathology.Business.Slide.Model.SlideOrder slideOrder = new YellowstonePathology.Business.Slide.Model.SlideOrder();
         YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(slideOrderElement, slideOrder);
         xmlPropertyWriter.Write();
         testOrder.SlideOrderCollection.Add(slideOrder);
     }
 }
 public RemoveSlideOrderVisitor(YellowstonePathology.Business.Slide.Model.SlideOrder slideOrder)
     : base(true, true)
 {
     this.m_SlideOrder = slideOrder;
 }
        private void BuildTestOrderSlideOrderCollection(YellowstonePathology.Business.Test.Model.TestOrder testOrder, XElement testOrderElement)
        {
            List<XElement> slideOrderElements = (from item in testOrderElement.Elements("SlideOrderCollection")
                                                           select item).ToList<XElement>();

            testOrder.SlideOrderCollection.RemoveDeleted(slideOrderElements.Elements("SlideOrder"));
            foreach (XElement slideOrderElement in slideOrderElements.Elements("SlideOrder"))
            {
                string slideOrderId = slideOrderElement.Element("SlideOrderId").Value;
                YellowstonePathology.Business.Slide.Model.SlideOrder slideOrder = new YellowstonePathology.Business.Slide.Model.SlideOrder();
                if (testOrder.SlideOrderCollection.Exists(slideOrderId) == true)
                {
                    slideOrder = testOrder.SlideOrderCollection.Get(slideOrderId);
                }
                else
                {
                    slideOrder = new YellowstonePathology.Business.Slide.Model.SlideOrder();
                    testOrder.SlideOrderCollection.Add(slideOrder);
                }

                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(slideOrderElement, slideOrder);
                xmlPropertyWriter.Write();
            }
        }
 public SlideOptionsPage(YellowstonePathology.Business.Slide.Model.SlideOrder slideOrder)
 {
     this.m_SlideOrder = slideOrder;
     InitializeComponent();
     DataContext = this;
 }
 private static YellowstonePathology.Business.Slide.Model.SlideOrderCollection BuildSlideOrderCollection(SqlCommand cmd)
 {
     YellowstonePathology.Business.Slide.Model.SlideOrderCollection result = new YellowstonePathology.Business.Slide.Model.SlideOrderCollection();
     using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString))
     {
         cn.Open();
         cmd.Connection = cn;
         using (SqlDataReader dr = cmd.ExecuteReader())
         {
             while (dr.Read())
             {
                 YellowstonePathology.Business.Slide.Model.SlideOrder slideOrder = new YellowstonePathology.Business.Slide.Model.SlideOrder();
                 YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(slideOrder, dr);
                 sqlDataReaderPropertyWriter.WriteProperties();
                 result.Add(slideOrder);
             }
         }
     }
     return result;
 }
        public static YellowstonePathology.Business.Slide.Model.SlideOrder GetSlideOrder(string slideOrderId)
        {
            YellowstonePathology.Business.Slide.Model.SlideOrder result = null;

            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "Select * from tblSlideOrder where SlideOrderid = @SlideOrderId";
            cmd.CommandType = System.Data.CommandType.Text;
            cmd.Parameters.Add("@SlideOrderId", System.Data.SqlDbType.VarChar).Value = slideOrderId;

            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.Slide.Model.SlideOrder();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr);
                        propertyWriter.WriteProperties();
                    }
                }
            }

            return result;
        }