예제 #1
0
 /// <summary>
 /// Create a new Section object.
 /// </summary>
 /// <param name="sectionID">Initial value of the SectionID property.</param>
 /// <param name="location">Initial value of the Location property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 public static Section CreateSection(global::System.Guid sectionID, global::System.String location, global::System.String description)
 {
     Section section = new Section();
     section.SectionID = sectionID;
     section.Location = location;
     section.Description = description;
     return section;
 }
예제 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Sections EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSections(Section section)
 {
     base.AddObject("Sections", section);
 }
예제 #3
0
        /// <summary>
        /// This method shows the section image.  Passing in a null value 
        /// will show the default section image.
        /// </summary>
        /// <param name="section"></param>
        private void selectSectionImage(Section section)
        {
            float size;

            if (addingSale)
                size = 450F;
            else
                size = 300F;

            tableLayoutPanelImageBorder.Controls.Remove(panelBrickImage);

            this.tableLayoutPanelImage.ColumnStyles.Clear();
            this.tableLayoutPanelImage.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
            this.tableLayoutPanelImage.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, size));
            this.tableLayoutPanelImage.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));

            this.tableLayoutPanelImageBorder.RowStyles.Clear();
            this.tableLayoutPanelImageBorder.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
            this.tableLayoutPanelImageBorder.RowStyles.Add(new RowStyle(SizeType.Absolute, size));
            this.tableLayoutPanelImageBorder.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));

            if (section == null)
            {
                panelSectionImage.BackgroundImage = Properties.Resources.Plaza;
            }
            else
            {
                switch (section.Location)
                {
                    case "A":
                        panelSectionImage.BackgroundImage = Properties.Resources.Plaza_A;
                        break;
                    case "B":
                        panelSectionImage.BackgroundImage = Properties.Resources.Plaza_B;
                        break;
                    case "C":
                        panelSectionImage.BackgroundImage = Properties.Resources.Plaza_C;
                        break;
                    case "D":
                        panelSectionImage.BackgroundImage = Properties.Resources.Plaza_D;
                        break;
                    case "E":
                        panelSectionImage.BackgroundImage = Properties.Resources.Plaza_E;
                        break;
                    case "F":
                        panelSectionImage.BackgroundImage = Properties.Resources.Plaza_F;
                        break;
                    case "G":
                        panelSectionImage.BackgroundImage = Properties.Resources.Plaza_G;
                        break;
                    case "H":
                        panelSectionImage.BackgroundImage = Properties.Resources.Plaza_H;
                        break;
                    default:
                        panelSectionImage.BackgroundImage = Properties.Resources.Plaza;
                        break;
                }
            }

            if (addingSale)
            {
                groupBoxResults.Text = null;
                groupBoxResults.Controls.Clear();
                groupBoxResults.Controls.Add(panelSectionImage);
                this.tableLayoutPanelImageBorder.Controls.Add(groupBoxResults, 0, 1);
            }
            else
            {
                this.tableLayoutPanelImageBorder.Controls.Add(panelSectionImage, 0, 1);
            }
        }