private void LoadManagerInterface(SeatingLayout seatLayout) { //Set window title Text = "Seating Layout Manager"; //Hide customer interface controls btn_buySeats.Hide(); btn_help.Hide(); btn_backToShow.Hide(); //Used for text box height int buttonCount = 8; //Move text box into place and resize height to fill space rtb_selectionInfo.Location = new Point(marginSize + pb_layout.Size.Width + marginSize, marginSize + labelHeight + marginSize); rtb_selectionInfo.Height = pb_layout.Height - labelHeight - (buttonHeight * buttonCount) - marginSize * (buttonCount + 1); //Move buttons, labels, and info text into place btn_addRow.Location = new Point(marginSize + pb_layout.Size.Width + marginSize, marginSize + labelHeight + marginSize + rtb_selectionInfo.Height + marginSize + ((buttonHeight + marginSize) * 7)); btn_addSeat.Location = new Point(marginSize + pb_layout.Size.Width + marginSize, marginSize + labelHeight + marginSize + rtb_selectionInfo.Height + marginSize + ((buttonHeight + marginSize) * 6)); btn_selectAllSeats.Location = new Point(marginSize + pb_layout.Size.Width + marginSize, marginSize + labelHeight + marginSize + rtb_selectionInfo.Height + marginSize + ((buttonHeight + marginSize) * 5)); btn_deleteSeats.Location = new Point(marginSize + pb_layout.Size.Width + marginSize, marginSize + labelHeight + marginSize + rtb_selectionInfo.Height + marginSize + ((buttonHeight + marginSize) * 4)); btn_modifySeats.Location = new Point(marginSize + pb_layout.Size.Width + marginSize, marginSize + labelHeight + marginSize + rtb_selectionInfo.Height + marginSize + ((buttonHeight + marginSize) * 3)); btn_saveLayout.Location = new Point(marginSize + pb_layout.Size.Width + marginSize, marginSize + labelHeight + marginSize + rtb_selectionInfo.Height + marginSize + ((buttonHeight + marginSize) * 2)); btn_loadSeatingLayout.Location = new Point(marginSize + pb_layout.Size.Width + marginSize, marginSize + labelHeight + marginSize + rtb_selectionInfo.Height + marginSize + ((buttonHeight + marginSize) * 1)); btn_promotionsManager.Location = new Point(marginSize + pb_layout.Size.Width + marginSize, marginSize + labelHeight + marginSize + rtb_selectionInfo.Height + marginSize + ((buttonHeight + marginSize) * 0)); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SeatingLayout newSeatLayout = new SeatingLayout(Properties.Resources.sampleLayout1); //Application.Run(new CreateSeatUI()); Application.Run(new SeatingLayoutUI(newSeatLayout, true)); // try { Application.Run(new LoginForm()); } catch { Application.Exit(); }; }
public SeatingLayoutUI(SeatingLayout seatLayout, bool managerModeEnabled, int loggedInAgentId = -1) { InitializeComponent(); CheckForIllegalCrossThreadCalls = false; //Fill representitive value seatingLayout = seatLayout; //Fill privilege values isManager = managerModeEnabled; agentId = loggedInAgentId; //Fill calculated size values buttonAndInfoWidth = btn_backToShow.Width; buttonHeight = btn_backToShow.Height; labelHeight = lbl_selectionInformation.Height; formBorderSize = (Width - ClientSize.Width) / 2; //Create selected seat ui element list selectedSeatUIs = new List <SeatUI>(); selectedSeats = new List <Seat>(); //Create seat list seatList = seatingLayout.seatList; allSeatUIs = new List <SeatUI>(); //Resize picture box to match seat layout given pb_layout.Size = new Size(seatLayout.seatLayoutImageSize.X, seatLayout.seatLayoutImageSize.Y); pb_layout.Location = new Point(marginSize, marginSize); //Resize form to match layout given Size = new Size(formBorderSize + marginSize + pb_layout.Size.Width + marginSize + buttonAndInfoWidth + marginSize + formBorderSize, topBarHeight + marginSize + seatLayout.seatLayoutImageSize.Y + marginSize + marginSize); //Move selection info label into place lbl_selectionInformation.Location = new Point(marginSize + pb_layout.Size.Width + marginSize, marginSize); //If manager interface, else customer interface if (managerModeEnabled) { LoadManagerInterface(seatLayout); } else { LoadCustomerInterface(seatLayout); }; }
controllingAgentID; //Controlling agent id from all controlling agents, -1 if none /*==================================================================== * Constructor * ==================================================================*/ public Seat(string name, int xPos, int yPos, SeatingLayout seatLayout, SeatStates status = SeatStates.Available, int promoID = -1, int agentID = -1) { //Set values from input seatName = name; seatPosX = xPos; seatPosY = yPos; seatStatus = status; seatPromoID = promoID; controllingAgentID = agentID; //Fil default values seatTimer = -1; //Create Seat ID using layout seatID = seatLayout.seatList.Count; //Add seat to seating layout list of seats seatLayout.seatList.Add(this); }