Exemple #1
0
        public bool SetSelectItemsStatus_One(BHSeatControl bh, BHSeatControl.BHSeatStatus bhSeatStatus)
        {
            bool result;

            if (this._listControlSelect.Count <= 0)
            {
                result = false;
            }
            else
            {
                foreach (Control current in this._listControlSelect)
                {
                    if (bh.Name == current.Name)
                    {
                        ((BHSeatControl)current).SeatStatus = bhSeatStatus;
                        Seat seat = (Seat)current.Tag;
                        seat._seatStatusFlag = EditSeatItem.GetControlStatus_ByFlag(bhSeatStatus);
                        current.Tag          = seat;
                        ((BHSeatControl)current).ExtendImage = (((BHSeatControl)current).DispImageMode ? EditSeatItem.GetControlExtendImg(seat._seatStatusFlag) : null);
                        result = true;
                        return(result);
                    }
                }
                result = false;
            }
            return(result);
        }
Exemple #2
0
        public bool SetSelectItemsType_One(BHSeatControl bh, BHSeatControl.BHSeatType bhSeatType)
        {
            bool result;

            if (this._listControlSelect.Count <= 0)
            {
                result = false;
            }
            else
            {
                foreach (Control current in this._listControlSelect)
                {
                    if (bh.Name == current.Name)
                    {
                        ((BHSeatControl)current).SeatType = bhSeatType;
                        Seat seat = (Seat)current.Tag;
                        seat._seatFlag = EditSeatItem.GetString_ByControlFlag(bhSeatType);
                        current.Tag    = seat;
                        ((BHSeatControl)current).Image = (((BHSeatControl)current).DispImageMode ? EditSeatItem.GetControlImg(seat._seatFlag) : null);
                        result = true;
                        return(result);
                    }
                }
                result = false;
            }
            return(result);
        }
        private void DrawDispImage(PaintEventArgs e, Rectangle rect)
        {
            Seat  seat       = (Seat)base.Tag;
            Image controlImg = EditSeatItem.GetControlImg(seat._seatFlag);

            if (this._Rotation == 180)
            {
                Point   point      = new Point(rect.X, rect.Bottom);
                Point   point2     = new Point(rect.Right, rect.Bottom);
                Point   point3     = new Point(rect.X, rect.Y);
                Point[] destPoints = new Point[]
                {
                    point,
                    point2,
                    point3
                };
                e.Graphics.DrawImage(controlImg, destPoints);
            }
            else
            {
                e.Graphics.DrawImage(controlImg, rect);
            }
            if (this._displayText)
            {
                if (seat._seatFlag == "0" || seat._seatFlag == "1" || seat._seatFlag == "2" || seat._seatFlag == "5" || seat._seatFlag == "4")
                {
                    if (this._seatStatus != BHSeatControl.BHSeatStatus.Success)
                    {
                        this.DrawDisplayText(e, base.ClientRectangle, this.Text, this._Rotation);
                    }
                }
            }
        }
Exemple #4
0
 private void DrawDispImage(PaintEventArgs e, Rectangle rect)
 {
     if (base.Tag == null)
     {
         Pen pen = new Pen(Color.Black, 4f);
         e.Graphics.DrawRectangle(pen, rect);
         pen.Dispose();
     }
     else
     {
         Seat seat = (Seat)base.Tag;
         if (seat._IsUsedBackColor)
         {
             if (seat._BackColor != 0)
             {
                 Color      color      = Color.FromArgb(seat._BackColor & 255, (seat._BackColor & 65280) >> 8, (seat._BackColor & 16711680) >> 16);
                 SolidBrush solidBrush = new SolidBrush(color);
                 e.Graphics.FillRectangle(solidBrush, rect);
                 solidBrush.Dispose();
             }
         }
         Image controlImg = EditSeatItem.GetControlImg(seat._seatFlag);
         if (this._Rotation == 180)
         {
             Point   point      = new Point(rect.X, rect.Bottom);
             Point   point2     = new Point(rect.Right, rect.Bottom);
             Point   point3     = new Point(rect.X, rect.Y);
             Point[] destPoints = new Point[]
             {
                 point,
                 point2,
                 point3
             };
             e.Graphics.DrawImage(controlImg, destPoints);
         }
         else
         {
             e.Graphics.DrawImage(EditSeatItem.GetControlImg(seat._seatFlag), rect);
         }
         if (this._seatStatus == BHSeatControl.BHSeatStatus.Lock || this._seatStatus == BHSeatControl.BHSeatStatus.SpecialLock || this._seatStatus == BHSeatControl.BHSeatStatus.PrSuccess || this._seatStatus == BHSeatControl.BHSeatStatus.Success)
         {
             this.DrawExtendImg(e, rect, seat._seatStatusFlag);
         }
         if (this._seatStatus == BHSeatControl.BHSeatStatus.Selected)
         {
             this.DrawSelectBorder(e, base.ClientRectangle);
         }
         if (this._displayText)
         {
             if (seat._seatFlag == "0" || seat._seatFlag == "1" || seat._seatFlag == "2" || seat._seatFlag == "5" || seat._seatFlag == "4")
             {
                 if (seat._seatStatusFlag == "0" || seat._seatStatusFlag == "5")
                 {
                     this.DrawDisplayText(e, rect, seat._seatColumn, this._Rotation);
                 }
             }
         }
     }
 }
Exemple #5
0
 private void DrawExtendImg(PaintEventArgs e, Rectangle rect, string szSeatStatusFlag)
 {
     if (szSeatStatusFlag == "1" || szSeatStatusFlag == "2" || szSeatStatusFlag == "3" || szSeatStatusFlag == "4")
     {
         Image controlExtendImg = EditSeatItem.GetControlExtendImg(szSeatStatusFlag);
         if (controlExtendImg != null)
         {
             e.Graphics.DrawImage(controlExtendImg, rect);
         }
     }
 }
Exemple #6
0
 public void SetSelectItemsType_All(BHSeatControl.BHSeatType bhSeatType)
 {
     foreach (Control current in this._listControlSelect)
     {
         ((BHSeatControl)current).SeatType = bhSeatType;
         Seat seat = (Seat)current.Tag;
         seat._seatFlag = EditSeatItem.GetString_ByControlFlag(bhSeatType);
         current.Tag    = seat;
         ((BHSeatControl)current).CursorSelectedIt = false;
     }
     this._listControlSelect.Clear();
     this._CurrentSelectControl = null;
 }
 public void SplitMultiItems(EditSeatInfo editSiteInfoTemp, bool bDispImageMode)
 {
     if (this._listControlSelect.Count == 1)
     {
         BHSeatControlEditer bHSeatControlEditer = (BHSeatControlEditer)this._listControlSelect[0];
         Seat seat = (Seat)this._listControlSelect[0].Tag;
         if (seat._brotherList.Count > 0)
         {
             Seat seat2 = seat._brotherList[0];
             for (int i = 1; i < seat._brotherList.Count; i++)
             {
                 Seat seat3 = seat._brotherList[i];
                 BHSeatControlEditer bHSeatControlEditer2 = new BHSeatControlEditer();
                 bHSeatControlEditer2.DisplayText      = true;
                 bHSeatControlEditer2.CursorSelectedIt = false;
                 bHSeatControlEditer2.Name             = "Site" + seat3._seatRowNumber + "_" + seat3._seatColumn;
                 bHSeatControlEditer2.Text             = seat3._seatColumn;
                 Point location = new Point(seat3._seatPosX, seat3._seatPosY);
                 bHSeatControlEditer2.Location      = location;
                 bHSeatControlEditer2.Width         = seat3._seatWidth;
                 bHSeatControlEditer2.Height        = seat3._seatHeight;
                 bHSeatControlEditer2.SeatType      = BHSeatControl.BHSeatType.One;
                 bHSeatControlEditer2.SeatStatus    = BHSeatControl.BHSeatStatus.Empty;
                 bHSeatControlEditer2.DispImageMode = bDispImageMode;
                 bHSeatControlEditer2.Image         = (bDispImageMode ? SeatResource.ImgEmpty : null);
                 bHSeatControlEditer2.Rotation      = editSiteInfoTemp._nRotation;
                 string seatId      = seat3._seatId;
                 string seatColumn  = seat3._seatColumn;
                 string seatNumber  = seat3._seatNumber;
                 string seatDisplay = seat3._seatDisplay;
                 bHSeatControlEditer2.Tag = new Seat(EditSeatItem.GetString_ByControlFlag(bHSeatControlEditer2.SeatType), EditSeatItem.GetControlStatus_ByFlag(bHSeatControlEditer2.SeatStatus), seat3._seatRowNumber, seat3._seatRowNumberDisplay, seatId, seatColumn, seatNumber, seatDisplay, 1, bHSeatControlEditer2.Location.X, bHSeatControlEditer2.Location.Y, bHSeatControlEditer2.Width, bHSeatControlEditer2.Height, seat3._seatSeatingChartId, seat3._seatBlockId);
                 this._container.Controls.Add(bHSeatControlEditer2);
                 this.WireControl(bHSeatControlEditer2);
             }
             bHSeatControlEditer.CursorSelectedIt = false;
             bHSeatControlEditer.SeatType         = BHSeatControl.BHSeatType.One;
             bHSeatControlEditer.SeatStatus       = BHSeatControl.BHSeatStatus.Empty;
             bHSeatControlEditer.Width            = seat2._seatWidth;
             bHSeatControlEditer.Height           = seat2._seatHeight;
             bHSeatControlEditer.Location         = new Point(seat2._seatPosX, seat2._seatPosY);
             seat._seatFlag        = EditSeatItem.GetString_ByControlFlag(BHSeatControl.BHSeatType.One);
             seat._seatColumnCount = 1;
             seat._seatWidth       = bHSeatControlEditer.Width;
             seat._seatHeight      = bHSeatControlEditer.Height;
             seat._seatPosX        = seat2._seatPosX;
             seat._seatPosY        = seat2._seatPosY;
             seat._brotherList.Clear();
             this._listControlSelect.Clear();
         }
     }
 }
 private void DrawDispImageBox(PaintEventArgs e, Rectangle rect)
 {
     if (base.Image == null)
     {
         Pen pen = new Pen(Color.Black, 4f);
         e.Graphics.DrawRectangle(pen, rect);
         pen.Dispose();
     }
     else
     {
         Seat seat = (Seat)base.Tag;
         int  num  = 10000;
         int  num2 = 10000;
         this.GetMinLeftAndTopSize(seat._brotherList, ref num, ref num2);
         foreach (Seat current in seat._brotherList)
         {
             Image     controlImg = EditSeatItem.GetControlImg(current._seatFlag);
             Rectangle rect2      = new Rectangle(rect.X + current._seatPosX - num, rect.Y + current._seatPosY - num2, current._seatWidth, current._seatHeight);
             if (this._Rotation == 180)
             {
                 Point   point      = new Point(rect2.X, rect2.Bottom);
                 Point   point2     = new Point(rect2.Right, rect2.Bottom);
                 Point   point3     = new Point(rect2.X, rect2.Y);
                 Point[] destPoints = new Point[]
                 {
                     point,
                     point2,
                     point3
                 };
                 e.Graphics.DrawImage(controlImg, destPoints);
             }
             else
             {
                 e.Graphics.DrawImage(controlImg, rect2);
             }
             if (this._displayText)
             {
                 if (seat._seatFlag == "0" || seat._seatFlag == "1" || seat._seatFlag == "2" || seat._seatFlag == "5" || seat._seatFlag == "4")
                 {
                     if (this._seatStatus != BHSeatControl.BHSeatStatus.Success)
                     {
                         this.DrawDisplayText(e, rect2, current._seatDisplay, this._Rotation);
                     }
                 }
             }
         }
         Pen pen2 = new Pen(this.BoxBorderColor, 6f);
         e.Graphics.DrawRectangle(pen2, rect);
         pen2.Dispose();
     }
 }
Exemple #9
0
 public void SetSelectItemsStatus_All(BHSeatControl.BHSeatStatus bhSeatStatus)
 {
     foreach (Control current in this._listControlSelect)
     {
         ((BHSeatControl)current).SeatStatus = bhSeatStatus;
         Seat seat = (Seat)current.Tag;
         seat._seatStatusFlag = EditSeatItem.GetControlStatus_ByFlag(bhSeatStatus);
         current.Tag          = seat;
         ((BHSeatControl)current).ExtendImage      = (((BHSeatControl)current).DispImageMode ? EditSeatItem.GetControlExtendImg(seat._seatStatusFlag) : null);
         ((BHSeatControl)current).CursorSelectedIt = false;
     }
     this._listControlSelect.Clear();
     this._CurrentSelectControl = null;
 }
Exemple #10
0
 private void DrawDispImageBox(PaintEventArgs e, Rectangle rect)
 {
     if (base.Image == null)
     {
         Pen pen = new Pen(Color.Black, 4f);
         e.Graphics.DrawRectangle(pen, rect);
         pen.Dispose();
     }
     else
     {
         Seat seat = (Seat)base.Tag;
         int  num  = 10000;
         int  num2 = 10000;
         this.GetMinLeftAndTopSize(seat._brotherList, ref num, ref num2);
         int num3 = 0;
         foreach (Seat current in seat._brotherList)
         {
             Image     controlImg = EditSeatItem.GetControlImg(current._seatFlag);
             Rectangle rect2      = new Rectangle(rect.X + current._seatPosX - num, rect.Y + current._seatPosY - num2, current._seatWidth, current._seatHeight);
             if (current._IsUsedBackColor)
             {
                 if (current._BackColor != 0)
                 {
                     Color      color      = Color.FromArgb(current._BackColor & 255, (current._BackColor & 65280) >> 8, (current._BackColor & 16711680) >> 16);
                     SolidBrush solidBrush = new SolidBrush(color);
                     e.Graphics.FillRectangle(solidBrush, rect2);
                     solidBrush.Dispose();
                 }
             }
             if (this._Rotation == 180)
             {
                 Point   point      = new Point(rect2.X, rect2.Bottom);
                 Point   point2     = new Point(rect2.Right, rect2.Bottom);
                 Point   point3     = new Point(rect2.X, rect2.Y);
                 Point[] destPoints = new Point[]
                 {
                     point,
                     point2,
                     point3
                 };
                 e.Graphics.DrawImage(controlImg, destPoints);
             }
             else
             {
                 e.Graphics.DrawImage(EditSeatItem.GetControlImg(current._seatFlag), rect2);
             }
             if (current._seatStatusFlag == "1" || current._seatStatusFlag == "2" || current._seatStatusFlag == "3" || current._seatStatusFlag == "4")
             {
                 this.DrawExtendImg(e, rect2, current._seatStatusFlag);
             }
             if (current._seatStatusFlag == "5")
             {
                 this.DrawSelectBorder(e, new Rectangle(rect2.Left + 3, rect2.Top + 4, rect2.Width - 6, rect2.Height - 8), 3);
                 num3++;
             }
             if (this._displayText)
             {
                 if (current._seatFlag == "0" || current._seatFlag == "1" || current._seatFlag == "2" || current._seatFlag == "5" || current._seatFlag == "4")
                 {
                     if (current._seatStatusFlag == "0" || current._seatStatusFlag == "5")
                     {
                         this.DrawDisplayText(e, rect2, current._seatColumn, this._Rotation);
                     }
                 }
             }
         }
         Pen pen2 = new Pen(this._BoxBorderColor, 6f);
         e.Graphics.DrawRectangle(pen2, rect);
         pen2.Dispose();
         if (num3 == seat._brotherList.Count)
         {
             this.DrawSelectBorder(e, base.ClientRectangle);
         }
     }
 }
 public void MergeMultiItems(EditSeatInfo editSiteInfoTemp, bool bDispImageMode, Color boxBorderColor)
 {
     if (this._listControlSelect.Count >= 2)
     {
         string text = "2";
         if (this._listControlSelect.Count == 2)
         {
             Seat seat  = (Seat)((BHSeatControlEditer)this._listControlSelect[0]).Tag;
             Seat seat2 = (Seat)((BHSeatControlEditer)this._listControlSelect[1]).Tag;
             if (seat._seatRowNumber == seat2._seatRowNumber)
             {
                 text = "1";
             }
         }
         BHSeatControlEditer bHSeatControlEditer  = (BHSeatControlEditer)this._listControlSelect[0];
         BHSeatControlEditer bHSeatControlEditer2 = (BHSeatControlEditer)this._listControlSelect[0];
         BHSeatControlEditer bHSeatControlEditer3 = (BHSeatControlEditer)this._listControlSelect[0];
         BHSeatControlEditer bHSeatControlEditer4 = (BHSeatControlEditer)this._listControlSelect[0];
         if (this.GetFourMarginControl(this._listControlSelect, ref bHSeatControlEditer, ref bHSeatControlEditer2, ref bHSeatControlEditer3, ref bHSeatControlEditer4))
         {
             List <SeatRows> list = this.DispathControls(this._listControlSelect, editSiteInfoTemp, text);
             if (list != null)
             {
                 int  columnsSize = this.GetColumnsSize(list);
                 int  count       = list.Count;
                 Seat seat3       = list[0]._listSiteItem[0];
                 int  minLeftSize = this.GetMinLeftSize(list);
                 BHSeatControlEditer bHSeatControlEditer5 = (BHSeatControlEditer)this.FindControlInSeatRows(seat3);
                 BHSeatControlEditer bHSeatControlEditer6 = new BHSeatControlEditer();
                 bHSeatControlEditer6.DisplayText      = true;
                 bHSeatControlEditer6.CursorSelectedIt = false;
                 bHSeatControlEditer6.Name             = bHSeatControlEditer5.Name;
                 bHSeatControlEditer6.Text             = bHSeatControlEditer5.Text;
                 bHSeatControlEditer6.Location         = new Point(bHSeatControlEditer.Location.X, bHSeatControlEditer2.Location.Y);
                 bHSeatControlEditer6.Width            = bHSeatControlEditer3.Width + bHSeatControlEditer3.Location.X - bHSeatControlEditer.Location.X;
                 bHSeatControlEditer6.Height           = bHSeatControlEditer4.Height + bHSeatControlEditer4.Location.Y - bHSeatControlEditer2.Location.Y;
                 bHSeatControlEditer6.SeatType         = EditSeatItem.GetControl_ByFlag(text);
                 bHSeatControlEditer6.SeatStatus       = BHSeatControl.BHSeatStatus.Empty;
                 bHSeatControlEditer6.DispImageMode    = bDispImageMode;
                 bHSeatControlEditer6.Image            = (bDispImageMode ? SeatResource.ImgEmpty : null);
                 bHSeatControlEditer6.Rotation         = editSiteInfoTemp._nRotation;
                 bHSeatControlEditer6.BoxBorderColor   = boxBorderColor;
                 string seatRowNumber        = seat3._seatRowNumber;
                 string seatColumn           = seat3._seatColumn;
                 string text2                = (Convert.ToInt32(seatColumn) + 1).ToString();
                 string seatColumn2          = seatColumn;
                 string seatNumber           = seatRowNumber + "排" + seatColumn + "号";
                 string seatId               = seat3._seatId;
                 string seatDisplay          = seat3._seatDisplay;
                 string seatRowNumberDisplay = seat3._seatRowNumberDisplay;
                 Seat   seat4                = new Seat(EditSeatItem.GetString_ByControlFlag(bHSeatControlEditer6.SeatType), EditSeatItem.GetControlStatus_ByFlag(bHSeatControlEditer6.SeatStatus), seatRowNumber, seatRowNumberDisplay, seatId, seatColumn2, seatNumber, seatDisplay, 2, bHSeatControlEditer6.Location.X, bHSeatControlEditer6.Location.Y, bHSeatControlEditer6.Width, bHSeatControlEditer6.Height, seat3._seatSeatingChartId, seat3._seatBlockId);
                 bHSeatControlEditer6.Tag = seat4;
                 seat4._brotherList.Clear();
                 foreach (SeatRows current in list)
                 {
                     foreach (Seat current2 in current._listSiteItem)
                     {
                         seat4._brotherList.Add(current2);
                     }
                 }
                 this._container.Controls.Add(bHSeatControlEditer6);
                 this.WireControl(bHSeatControlEditer6);
                 foreach (Control current3 in this._listControlSelect)
                 {
                     this._container.Controls.Remove(current3);
                 }
                 this._listControlSelect.Clear();
             }
         }
     }
 }