public static List <SeatMaDll.Seat> RetrieveItemsWithBlock(string SeatingChartId) { List <SeatMaDll.Seat> listAll = new List <SeatMaDll.Seat>(); List <SeatMaDll.Seat> listNoBrother = new List <SeatMaDll.Seat>(); List <SeatMaDll.Seat> listHaveBrother = new List <SeatMaDll.Seat>(); SeatDbo dbo = new SeatDbo(); DataTable dt = dbo.RetrieveALLItemsWithBlock(SeatingChartId); 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"]); SeatPo po = ChangeObj(dr); SeatMaDll.Seat st = ChangeObjFromData(po); st._BackColor = nBgColour; st._IsUsedBackColor = true; 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; listHaveBrother.Add(st); } } } SeatAction.MergeObjNew(listNoBrother, listHaveBrother); foreach (SeatMaDll.Seat st in listHaveBrother) { listAll.Add(st); } return(listAll); }
public static List <SeatMaDll.Seat> RetrieveItems(string SeatingChartId) { List <SeatMaDll.Seat> listAll = new List <SeatMaDll.Seat>(); List <SeatMaDll.Seat> listNoBrother = new List <SeatMaDll.Seat>(); List <SeatMaDll.Seat> listHaveBrother = new List <SeatMaDll.Seat>(); SeatDbo dbo = new SeatDbo(); DataTable dt = dbo.RetrieveALLItems(SeatingChartId); if (dt == null || dt.Rows.Count <= 0) { return(listAll); } foreach (DataRow dr in dt.Rows) { SeatPo po = ChangeObj(dr); SeatMaDll.Seat st = ChangeObjFromData(po); if (st._seatSeatGroup.Trim().Length <= 0) { listAll.Add(st); } else { if (st._brotherList.Count <= 0) { listNoBrother.Add(st); } else { listHaveBrother.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); }
public static int GetSeatsByHallId(string szHallId) { SeatDbo dbo = new SeatDbo(); return(dbo.GetSeatsByHallId(szHallId)); }
public static bool DeleteBySeatingChartId(string SeatingChartId) { SeatDbo dbo = new SeatDbo(); return(dbo.DeleteBySeatingChartId(SeatingChartId)); }