private bool ExistInSelectItems_Column(List <SeatRows> listSR, EditSeatInfo editSiteInfoTemp) { bool result; if (listSR == null || listSR.Count < 2) { result = true; } else { SeatRows seatRows = listSR[0]; for (int i = 1; i < listSR.Count; i++) { SeatRows seatRows2 = listSR[i]; if (this.TwoRowHaveNoSelectRow(seatRows._seatRowNumber, seatRows2._seatRowNumber, editSiteInfoTemp)) { result = false; return(result); } if (!this.CompareTwoRow(seatRows2, seatRows)) { result = false; return(result); } seatRows = seatRows2; } result = true; } return(result); }
public static string GetRowNum_Char(EditSeatInfo esi, ref int iStep, ref int iFirstStep, ref int iLastStep, ref int firstNum, ref int lastNum) { if (iLastStep + iStep > 26) { firstNum++; iFirstStep++; lastNum = ((lastNum >= 97) ? 97 : 65); iLastStep = 1; } else { lastNum += iStep; iLastStep += iStep; } string result; if (esi._szFirsrRowText.Length == 1 && iFirstStep == 1) { result = Convert.ToChar(lastNum).ToString(); } else { result = Convert.ToChar(firstNum).ToString() + Convert.ToChar(lastNum).ToString(); } return(result); }
private int GetSeatRowsInlistPos(List <SeatRows> list, string seatRowNumber, EditSeatInfo editSiteInfoTemp, ref bool bExit) { int num = -1; int result; foreach (SeatRows current in list) { num++; int num2 = -1; if (editSiteInfoTemp._szRowNumType == "int") { num2 = Convert.ToInt32(seatRowNumber) - Convert.ToInt32(current._seatRowNumber); } else { seatRowNumber.CompareTo(current._seatRowNumber); } if (num2 == 0) { bExit = true; result = num; return(result); } if (num2 < 0) { bExit = false; result = num; return(result); } } bExit = false; result = -1; return(result); }
public static string GetRowNum_Int(EditSeatInfo esi, int nRow) { string result = ""; if (esi._szRowNumType.Equals("int")) { result = (nRow + Convert.ToInt32(esi._szFirsrRowText)).ToString(); } return(result); }
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(); } } }
public static int MaxColumnCount(EditSeatInfo esi) { int result; if (esi._nIncreaseNumber > 0) { result = esi._nFirRowColumnCount + esi._nIncreaseNumber * esi._nRows; } else { result = esi._nFirRowColumnCount; } return(result); }
public static void GetFirstData_Char(EditSeatInfo esi, ref int iStep, ref int iFirstStep, ref int iLastStep, ref int firstNum, ref int lastNum) { iStep = 0; iFirstStep = 1; iLastStep = 1; firstNum = 0; lastNum = 0; if (esi._szFirsrRowText.Length == 2) { firstNum = Convert.ToInt32(esi._szFirsrRowText.ToCharArray()[0]); lastNum = Convert.ToInt32(esi._szFirsrRowText.ToCharArray()[1]); if (firstNum >= 97) { iFirstStep = firstNum - 96; } else { iFirstStep = firstNum - 64; } if (lastNum >= 97) { iLastStep = lastNum - 96; } else { iLastStep = lastNum - 64; } } else { if (esi._szFirsrRowText.Length == 1) { lastNum = Convert.ToInt32(esi._szFirsrRowText.ToCharArray()[0]); if (lastNum >= 97) { iLastStep = lastNum - 96; } else { iLastStep = lastNum - 64; } iFirstStep = 1; firstNum = 97; } } }
private List <SeatRows> DispathControls(List <Control> listSelect, EditSeatInfo editSiteInfoTemp, string szSeatType) { List <SeatRows> list = new List <SeatRows>(); List <SeatRows> result; foreach (Control current in listSelect) { BHSeatControlEditer bHSeatControlEditer = (BHSeatControlEditer)current; Seat seat = (Seat)bHSeatControlEditer.Tag; seat._seatFlag = szSeatType; if (seat._brotherList.Count > 0) { result = null; return(result); } bool flag = false; int seatRowsInlistPos = this.GetSeatRowsInlistPos(list, seat._seatRowNumber, editSiteInfoTemp, ref flag); SeatRows seatRows = flag ? list[seatRowsInlistPos] : new SeatRows(seat._seatRowNumber); if (seatRowsInlistPos == -1) { list.Add(seatRows); } else { if (!flag) { list.Insert(seatRowsInlistPos, seatRows); } } int seatInlistPos = this.GetSeatInlistPos(seatRows._listSiteItem, seat); if (seatInlistPos < 0) { seatRows._listSiteItem.Add(seat); } else { seatRows._listSiteItem.Insert(seatInlistPos, seat); } } result = list; return(result); }
public static string GetColumnNum(EditSeatInfo esi, int nRow, int nColumn) { string result = ""; string nRuleCode = esi._nRuleCode; if (nRuleCode != null) { if (!(nRuleCode == "0")) { if (!(nRuleCode == "1")) { if (!(nRuleCode == "2")) { if (!(nRuleCode == "3")) { if (!(nRuleCode == "4")) { if (nRuleCode == "5") { if (nRow % 2 != 0) { if (nColumn < nRow / 2 + 1) { if (nColumn * 2 + 1 < 10) { result = string.Concat(nColumn * 2 + 1); } else { result = string.Concat(nColumn * 2 + 1); } } else { if (nRow * 2 - nColumn * 2 < 10) { result = string.Concat(nRow * 2 - nColumn * 2); } else { result = string.Concat(nRow * 2 - nColumn * 2); } } } else { if (nColumn < nRow / 2) { if (nColumn * 2 + 1 < 10) { result = string.Concat(nColumn * 2 + 1); } else { result = string.Concat(nColumn * 2 + 1); } } else { if (nRow * 2 - nColumn * 2 < 10) { result = string.Concat(nRow * 2 - nColumn * 2); } else { result = string.Concat(nRow * 2 - nColumn * 2); } } } } } else { if (nRow % 2 != 0) { if (nColumn <= nRow / 2) { if (nRow - nColumn * 2 < 10) { result = string.Concat(nRow - nColumn * 2); } else { result = string.Concat(nRow - nColumn * 2); } } else { if (nColumn * 2 - nRow + 1 < 10) { result = string.Concat(nColumn * 2 - nRow + 1); } else { result = string.Concat(nColumn * 2 - nRow + 1); } } } else { if (nColumn < nRow / 2) { if (nRow - 1 - nColumn * 2 < 10) { result = string.Concat(nRow - 1 - nColumn * 2); } else { result = string.Concat(nRow - 1 - nColumn * 2); } } else { if ((nColumn + 1) * 2 - nRow < 10) { result = string.Concat((nColumn + 1) * 2 - nRow); } else { result = string.Concat((nColumn + 1) * 2 - nRow); } } } } } else { if (nColumn + 1 <= nRow / 2) { if ((nColumn + 1) * 2 < 10) { result = "0" + (nColumn + 1) * 2; } else { result = string.Concat((nColumn + 1) * 2); } } else { if ((nRow - nColumn) * 2 - 1 < 10) { result = string.Concat((nRow - nColumn) * 2 - 1); } else { result = string.Concat((nRow - nColumn) * 2 - 1); } } } } else { if (nColumn < nRow / 2) { if (nRow / 2 * 2 - nColumn * 2 < 10) { result = string.Concat(nRow / 2 * 2 - nColumn * 2); } else { result = string.Concat(nRow / 2 * 2 - nColumn * 2); } } else { if (nRow / 2 * -2 + 1 + nColumn * 2 < 10) { result = string.Concat(nRow / 2 * -2 + 1 + nColumn * 2); } else { result = string.Concat(nRow / 2 * -2 + 1 + nColumn * 2); } } } } else { if (nRow - nColumn < 10) { result = string.Concat(nRow - nColumn); } else { result = string.Concat(nRow - nColumn); } } } else { if (nColumn + 1 < 10) { result = string.Concat(nColumn + 1); } else { result = string.Concat(nColumn + 1); } } } return(result); }
public static bool CheckFirstRowNum(EditSeatInfo esi, ref string szMsg) { bool result; if (esi._szFirsrRowText != null && !esi._szFirsrRowText.Equals("")) { try { esi._nFirstRowNum = Convert.ToInt32(esi._szFirsrRowText); esi._szRowNumType = "int"; result = true; return(result); } catch { if (esi._szFirsrRowText.Length > 2) { szMsg = "排号为字母的时候,不能超过2个字符!"; result = false; return(result); } if (esi._szFirsrRowText.Length == 1) { int num = Convert.ToInt32(esi._szFirsrRowText.ToCharArray()[0]); if (num < 73 && num - 65 + esi._nRows - 1 > 600) { szMsg = "排号为字母的时候,最大排号不能超过ZZ!"; result = false; return(result); } if (num > 73 && num < 79 && num - 65 + esi._nRows - 2 > 600) { szMsg = "排号为字母的时候,最大排号不能超过ZZ!"; result = false; return(result); } if (num > 79 && num < 90 && num - 65 + esi._nRows - 3 > 600) { szMsg = "排号为字母的时候,最大排号不能超过ZZ!"; result = false; return(result); } if (num >= 97 && num < 105 && num - 97 + esi._nRows - 1 > 600) { szMsg = "排号为字母的时候,最大排号不能超过ZZ!"; result = false; return(result); } if (num > 105 && num < 111 && num - 97 + esi._nRows - 2 > 600) { szMsg = "排号为字母的时候,最大排号不能超过ZZ!"; result = false; return(result); } if (num > 111 && num - 97 + esi._nRows - 3 > 600) { szMsg = "排号为字母的时候,最大排号不能超过ZZ!"; result = false; return(result); } } else { int num2 = Convert.ToInt32(esi._szFirsrRowText.ToCharArray()[0]); int num3 = Convert.ToInt32(esi._szFirsrRowText.ToCharArray()[1]); if ((num2 < 97 && num3 >= 97) || (num2 >= 97 && num3 < 97)) { szMsg = "排号为字母的时候,不允许使用类似Aa或aA的排号!"; result = false; return(result); } if (num2 < 73) { num2 = num2 - 65 + 1 - 2; } else { if (num2 > 73 && num2 < 79) { num2 = num2 - 65 + 1 - 1; } else { if (num2 > 79 && num2 < 90) { num2 = num2 - 65 + 1; } else { if (num2 >= 97 && num2 < 105) { num2 = num2 - 97 + 1 - 2; } else { if (num2 > 105 && num2 < 111) { num2 = num2 - 97 + 1 - 1; } else { if (num2 > 111) { num2 = num2 - 97 + 1; } } } } } } if (num3 < 73) { num3 = num2 - 65 + 1 - 2; } else { if (num3 > 73 && num3 < 79) { num3 = num2 - 65 + 1 - 1; } else { if (num3 > 79 && num3 < 90) { num3 = num3 - 65 + 1; } else { if (num3 >= 97 && num3 < 105) { num3 = num3 - 97 + 1 - 2; } else { if (num3 > 105 && num3 < 111) { num3 = num3 - 97 + 1 - 1; } else { if (num3 > 111) { num3 = num3 - 97 + 1; } } } } } } if (num2 * num3 + esi._nRows > 576) { szMsg = "排号为字母的时候,最大排号不能超过ZZ或zz!"; result = false; return(result); } } esi._szRowNumType = "char"; esi._nFirstRowNum = 1; result = true; return(result); } } result = false; return(result); }
public static string GetRowNum_Char0(EditSeatInfo esi, ref int iStep, ref int iFirstStep, ref int iLastStep, ref int firstNum, ref int lastNum) { string text = ""; if (!esi._szRowNumType.Equals("int")) { if (iLastStep < 9) { iStep = 0; } else { if (iLastStep >= 9 && iLastStep < 14) { iStep = 1; } else { iStep = 2; } } if (iLastStep + iStep > 26) { iLastStep = 1; iFirstStep++; } if (iFirstStep < 9) { iStep = 0; } else { if (iFirstStep >= 9 && iFirstStep < 14) { iStep = 1; } else { iStep = 2; } } if (esi._szFirsrRowText.Length != 1 || iFirstStep != 1) { text += Convert.ToChar(iFirstStep - 2 + firstNum + iStep).ToString(); } if (iLastStep < 9) { iStep = 0; } else { if (iLastStep >= 9 && iLastStep < 14) { iStep = 1; } else { iStep = 2; } } text += Convert.ToChar(iLastStep - 1 + lastNum + iStep).ToString(); iLastStep++; } return(text); }
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(); } } } }
private bool TwoRowHaveNoSelectRow(string seatRowNumber1, string seatRowNumber2, EditSeatInfo editSiteInfoTemp) { bool result; foreach (Control control in this._container.Controls) { if (control.GetType() == typeof(BHSeatControlEditer)) { BHSeatControlEditer bHSeatControlEditer = (BHSeatControlEditer)control; Seat seat = (Seat)bHSeatControlEditer.Tag; int num = -1; if (editSiteInfoTemp._szRowNumType == "int") { num = Convert.ToInt32(seatRowNumber1) - Convert.ToInt32(seat._seatRowNumber); } else { seatRowNumber1.CompareTo(seat._seatRowNumber); } if (num < 0) { if (editSiteInfoTemp._szRowNumType == "int") { num = Convert.ToInt32(seatRowNumber2) - Convert.ToInt32(seat._seatRowNumber); } else { num = seatRowNumber2.CompareTo(seat._seatRowNumber); } if (num > 0) { result = true; return(result); } } } } result = false; return(result); }