Пример #1
0
        public void Run()
        {
            // 기본 생성자 이용
            int    number   = 1;
            string title    = "첫 번째 게시글입니다.";
            string contents = "첫 번째 공지사항입니다.";
            string writer   = "운영자";

            Service.BoardService boardService = new Service.BoardService();
            boardService.Save(number, title, contents, writer);
            boardService.Read();

            WriteLine("=====");

            title = "첫 번째 게시글 수정!!";
            boardService.Update(title, contents, writer);
            boardService.Read();

            WriteLine("=====");

            boardService.Delete();
            boardService.Read();

            WriteLine("=====");

            // 생성자 오버로딩 이용
            Board board = new Board();

            board.Number     = 2;
            board.Title      = "두 번째 게시글입니다.";
            board.Contents   = "두 번째 공지사항입니다.";
            board.Writer     = "운영자";
            board.CreateDate = DateTime.Now;
            board.UpdateDate = DateTime.Now;

            Service.BoardService anotherBoardService = new Service.BoardService(board);
            anotherBoardService.Read();
        }
Пример #2
0
        private void update()
        {
            WriteLine("게시글 제목을 입력하세요.");
            string title = ReadLine();

            WriteLine("게시글 내용을 입력하세요.");
            string contents = ReadLine();

            WriteLine("작성자를 입력하세요");
            string writer = ReadLine();

            Service.BoardService boardService = new Service.BoardService();
            boardService.Update(title, contents, writer);
            boardService.Read();
        }
Пример #3
0
        private void creat_post()
        {
            int number = 1;

            WriteLine("게시글 제목을 입력하세요.");
            string title = ReadLine();

            WriteLine("게시글 내용을 입력하세요.");
            string contents = ReadLine();

            WriteLine("작성자를 입력하세요");
            string writer = ReadLine();

            Service.BoardService boardService = new Service.BoardService();
            boardService.Save(number, title, contents, writer);
            boardService.Read();
        }