예제 #1
0
        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;
            }
        }
예제 #2
0
        public void Delete(ref Seat[,] seatlist)
        {
            wbSeat ws = new wbSeat();
            int    id = ws.GetId();

            ws.AddById(ref seatlist, id, Constant.Empty);
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
파일: SeatAdd.cs 프로젝트: agahong/C_Sharp
        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);
        }
예제 #5
0
        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("선택하신 좌석에 이미 학생이 있습니다.");
            }
        }