public static List <SeatMaDll.Seat> RetrieveStatusObjs(string szShowPlanId, string szHallId, int nLevel, int nUser) { List <SeatMaDll.Seat> listAll = new List <SeatMaDll.Seat>(); List <SeatMaDll.Seat> listNoBrother = new List <SeatMaDll.Seat>(); List <SeatMaDll.Seat> listHaveBrother = new List <SeatMaDll.Seat>(); List <SeatMaDll.SeatingChart> scList = SeatingChartAction.RetrieveObjList(szHallId, nLevel); if (scList == null || scList.Count <= 0) { return(listAll); } SeatstatusDbo dbo = new SeatstatusDbo(); //DataTable dt = dbo.RetrieveItemStatus_Init(szShowPlanId, szHallId, nLevel); DataTable dt = dbo.RetrieveItemStatus(szShowPlanId, scList[0].SeatingChartId); if (dt == null || dt.Rows.Count <= 0) { return(listAll); } foreach (DataRow dr in dt.Rows) { string szStatusFlag = "0"; SeatPo po = ChangeObj(dr, nUser, ref szStatusFlag); SeatMaDll.Seat st = SeatAction.ChangeObjFromData(po); //st._seatStatusFlag = dr["TicketingState"] == DBNull.Value ? "0" : dr["TicketingState"].ToString(); st._seatStatusFlag = szStatusFlag; if (st._seatSeatGroup.Trim().Length <= 0) { listAll.Add(st); } else { if (st._brotherList.Count <= 0) { listNoBrother.Add(st); } else { st._brotherList[0]._seatStatusFlag = szStatusFlag; listHaveBrother.Add(st); } } //if (!SeatAction.MergeObj(list, st)) list.Add(st); } SeatAction.MergeObjNew(listNoBrother, listHaveBrother); foreach (SeatMaDll.Seat st in listHaveBrother) { listAll.Add(st); } //if (listHaveBrother.Count > 0) // listAll.AddRange(listHaveBrother[0], listHaveBrother[listHaveBrother.Count-1]); //listAll = listAll.AddRange(listNoBrother); //.CopyTo(listNoBrother); return(listAll); }
void cbb_Level_SelectedIndexChanged(object sender, EventArgs e) { if (uC_HallInfoSeek1.cbb_Theater.SelectedItem == null) { return; } if (uC_HallInfoSeek1.cbb_Hall.SelectedItem == null) { return; } if (uC_HallInfoSeek1.cbb_Level.SelectedItem == null) { return; } SimTheaterInfo sti = (SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem; string szTheaterId = sti._TheaterId; SimHall sh = (SimHall)uC_HallInfoSeek1.cbb_Hall.SelectedItem; string szHallId = sh._HallId; SimHallLevel shl = (SimHallLevel)uC_HallInfoSeek1.cbb_Level.SelectedItem; string szLevel = shl._LevelId; _editSeatInfo = new SeatMaDll.EditSeatInfo(); _editSeatInfo._szTheaterName = sti._TheaterName; _editSeatInfo._szHallName = sh._HallName; _editSeatInfo._szLevelName = shl._LevelId; List <SeatMaDll.SeatingChart> scList = SeatingChartAction.RetrieveObjList(sh._HallId, Convert.ToInt32(shl._LevelId)); uC_HallInfoSeek1.InitSeatingChart(scList); QueryData(); }
public void InitSeatingChart(string szHallId, int nLevel) { cbb_SeatingChart.ResetText(); List <SeatMaDll.SeatingChart> scList = SeatingChartAction.RetrieveObjList(szHallId, nLevel); cbb_SeatingChart.DataSource = scList; if (scList.Count > 0) { cbb_SeatingChart.SelectedItem = scList[0]; } else { cbb_SeatingChart.SelectedItem = null; } }
public static List <SeatMaDll.Seat> RetrieveObjWithSeatingchartAndBlock(string szShowPlanId, string szHallId, int nLevel, int nUser, ref SeatMaDll.SeatingChart seatingchart) { List <SeatMaDll.Seat> listAll = new List <SeatMaDll.Seat>(); List <SeatMaDll.Seat> listNoBrother = new List <SeatMaDll.Seat>(); List <SeatMaDll.Seat> listHaveBrother = new List <SeatMaDll.Seat>(); List <SeatMaDll.SeatingChart> scList = SeatingChartAction.RetrieveObjList(szHallId, nLevel); if (scList == null || scList.Count <= 0) { return(listAll); } SeatstatusDbo dbo = new SeatstatusDbo(); //DataTable dt = dbo.RetrieveItemStatus_Init(szShowPlanId, szHallId, nLevel); DataTable dt = dbo.RetrieveItemStatus_InitWithBlock(szShowPlanId, scList[0].SeatingChartId); seatingchart = scList[0]; if (dt == null || dt.Rows.Count <= 0) { return(listAll); } foreach (DataRow dr in dt.Rows) { int nBgColour = dr["BgColour"] == DBNull.Value ? 0 : Convert.ToInt32(dr["BgColour"]); string szStatusFlag = "0"; SeatPo po = ChangeObj(dr, nUser, ref szStatusFlag); SeatMaDll.Seat st = SeatAction.ChangeObjFromData(po); st._BackColor = nBgColour; st._IsUsedBackColor = true; //st._seatStatusFlag = dr["TicketingState"] == DBNull.Value ? "0" : dr["TicketingState"].ToString(); st._seatStatusFlag = szStatusFlag; if (st._seatSeatGroup.Trim().Length <= 0) { listAll.Add(st); } else { if (st._brotherList.Count <= 0) { listNoBrother.Add(st); } else { st._brotherList[0]._BackColor = nBgColour; st._brotherList[0]._IsUsedBackColor = true; st._brotherList[0]._seatStatusFlag = szStatusFlag; listHaveBrother.Add(st); } } } SeatAction.MergeObjNew(listNoBrother, listHaveBrother); foreach (SeatMaDll.Seat st in listHaveBrother) { listAll.Add(st); } return(listAll); }
public static List <SeatMaDll.SeatingChart> RetrieveSeatingChartList(string szHallId, int nLevel) { List <SeatMaDll.SeatingChart> scList = SeatingChartAction.RetrieveObjList(szHallId, nLevel); return(scList); }