private void inputConfigToolStripMenuItem_Click(object sender, EventArgs e) { ConfigFile temp = new ConfigFile(); openFileDialog1.Filter = "Config File(*.cfgdata)|*.cfgdata"; openFileDialog1.FilterIndex = 1; if (openFileDialog1.ShowDialog() == DialogResult.OK) { temp.LoadFromFile(openFileDialog1.FileName); List <Student> tempStudents = new List <Student>(); studentListTable.Items.Clear(); foreach (string i in temp.students) { Student newStudent = new Student(i); tempStudents.Add(newStudent); studentListTable.Items.Add(newStudent); } students = new StudentList(tempStudents); seats = new SeatList(0, Array.Empty <int>()); seatTable.RowCount = 1; seatTable.ColumnCount = 1; CleanTableWithFrontSign(); for (int k = 0; k < temp.row; k++) { AddNewRow(k + 1, temp.col[k]); } } }
private void cleanTable_Click(object sender, EventArgs e) { seatTable.RowCount = 1; seatTable.ColumnCount = 1; CleanTableWithFrontSign(); int[] temp0 = { }; seats = new SeatList(0, temp0, null); }
public ActionResult DeleteConfirmed(int id) { SeatList seatList = db.SeatLists.Find(id); db.SeatLists.Remove(seatList); db.SaveChanges(); return(RedirectToAction("Index")); }
public Form1() { InitializeComponent(); CleanTableWithFrontSign(); int[] temp0 = { }; seats = new SeatList(0, temp0, null); string[] temp1 = { }; students = new StudentList(temp1); }
public ConfigFile(SeatList inputSeatList, StudentList inputStudentList) { row = inputSeatList.row; col = inputSeatList.col; students = new List <string>(); foreach (Student i in inputStudentList.students) { students.Add(i.name); } }
public ActionResult Edit([Bind(Include = "id,seatNumber,IsAvailable,Hallid")] SeatList seatList) { if (ModelState.IsValid) { db.Entry(seatList).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Hallid = new SelectList(db.Halls, "id", "id", seatList.Hallid); return(View(seatList)); }
public ActionResult Create([Bind(Include = "id,seatNumber,IsAvailable,Hallid")] SeatList seatList) { if (ModelState.IsValid) { db.SeatLists.Add(seatList); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Hallid = new SelectList(db.Halls, "id", "id", seatList.Hallid); return(View(seatList)); }
// GET: SeatLists/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SeatList seatList = db.SeatLists.Find(id); if (seatList == null) { return(HttpNotFound()); } return(View(seatList)); }
public TableResultFile(SeatList inputSeatList) { students = new List <string>(); Seat temp = inputSeatList.head; while (temp != null) { if (temp.stu == null) { return; } students.Add(temp.stu.name); temp = temp.next; } }
// GET: SeatLists/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SeatList seatList = db.SeatLists.Find(id); if (seatList == null) { return(HttpNotFound()); } ViewBag.Hallid = new SelectList(db.Halls, "id", "id", seatList.Hallid); return(View(seatList)); }
public void List_CheckStatus_ReturnSeat(int row, int column, int allocationTypeId, string allocationTypeDescription) { //Arrange var seatReservationDataContext = new InMemorySeatReservationDataContext($"SeatList{row}{column}"); var testDB = new TestDataset1(); testDB.Load(seatReservationDataContext); //Act var eventList = new SeatList(seatReservationDataContext).List(2); var item = eventList.Where(p => p.Row == row && p.Column == column).FirstOrDefault(); //Assert Assert.NotNull(item); Assert.Equal(item.AllocationTypeId, allocationTypeId); Assert.Equal(item.AllocationTypeDescription, allocationTypeDescription); }
public void AddSeatsToCart(CsharpSeatBookingSystemContext _databaseConn) { int i = 0; string[] SeatListArr = SeatList.Split(' '); foreach (string seat in SeatListArr) { Console.Out.WriteLine(seat); i++; Cart temp = new Cart(); temp.SeatId = Int16.Parse(seat.Trim()); temp.UserId = UserId; temp.EventId = EventID; _databaseConn.Add(temp); _databaseConn.SaveChanges(); } }
public ActionResult Create([Bind(Include = "id,numberOfSeats")] Hall hall) { if (ModelState.IsValid) { db.Halls.Add(hall); db.SaveChanges(); for (int i = 1; i <= hall.numberOfSeats; i++) { SeatList seatList = new SeatList(); seatList.IsAvailable = true; seatList.seatNumber = i.ToString(); seatList.Hallid = hall.id; db.SeatLists.Add(seatList); db.SaveChanges(); } return(RedirectToAction("Index")); } return(View(hall)); }
public SeatModel PickSeat(int Number, string Type) { SeatModel pickedSeat = SeatList.FirstOrDefault(i => i.Number == Number && i.Type == Type && !i.IsOccuped); return(pickedSeat); }
public SeatRow() { Seats = new SeatList(); }