public void Change(ref Seat[,] seatlist) { wbSeat ws = new wbSeat(); Console.WriteLine("이동시킬 좌석 선택"); int id1 = ws.GetId(); Console.WriteLine("이동하고싶은 좌석 선택"); int id2 = ws.GetId(); Seat seat1 = ws.GetDataFromId(seatlist, id1); Seat seat2 = ws.GetDataFromId(seatlist, id2); if (seat2.Memberid == Constant.Empty) { Console.WriteLine("선택하신 좌석에 학생이 없습니다."); } else { //멤버 아이디 교환 int temp; temp = seat2.Memberid; seat2.Memberid = seat1.Memberid; seat1.Memberid = temp; } }
public void Delete(ref Seat[,] seatlist) { wbSeat ws = new wbSeat(); int id = ws.GetId(); ws.AddById(ref seatlist, id, Constant.Empty); }
public Seat Select(ref Seat[,] seatlist) { wbSeat ws = new wbSeat(); int id = ws.GetId(); Seat seat = ws.GetDataFromId(seatlist, id); if (seat.Memberid == Constant.Empty) { return(null); } else { return(seat); } }
public void Add(ref Seat[,] seatlist) { int memid, id; while (true) { memid = wbGlobal.InputInt("학생 아이디>>"); if (IdCheck(seatlist, memid) == false) { Console.WriteLine("중복된 id"); continue; } break; } id = new wbSeat().GetId(); new wbSeat().AddById(ref seatlist, id, memid); }
public void Move(ref Seat[,] seatlist) { wbSeat ws = new wbSeat(); Console.WriteLine("이동시킬 좌석 선택"); int id1 = ws.GetId(); Console.WriteLine("이동하고싶은 좌석 선택"); int id2 = ws.GetId(); Seat seat1 = ws.GetDataFromId(seatlist, id1); Seat seat2 = ws.GetDataFromId(seatlist, id2); if (seat2.Memberid == Constant.Empty) { seat2.Memberid = seat1.Memberid; seat1.Memberid = Constant.Empty; } else { Console.WriteLine("선택하신 좌석에 이미 학생이 있습니다."); } }