コード例 #1
0
        public override void Render()
        {
            ViewHelp.WriteLine("CREATE A NEW BOOK", ConsoleColor.Green);

            string title       = ViewHelp.InputString("Title");
            string authors     = ViewHelp.InputString("Authors");
            string publisher   = ViewHelp.InputString("Publisher");
            int    year        = ViewHelp.InputInt("Year");
            int    edition     = ViewHelp.InputInt("Edition");
            string tags        = ViewHelp.InputString("Tags");
            string description = ViewHelp.InputString("Description");
            int    rate        = ViewHelp.InputInt("Rate");
            bool   reading     = ViewHelp.InputBool("Reading");
            string file        = ViewHelp.InputString("File");

            var request = "do create ? " +
                          $"title = {title} & " +
                          $"authors = {authors} & " +
                          $"publisher = {publisher} & " +
                          $"year = {year} & " +
                          $"edition = {edition} & " +
                          $"tags = {tags} & " +
                          $"description = {description} & " +
                          $"rate = {rate} & " +
                          $"reading = {reading} & " +
                          $"file = {file}";

            Router.Instance.Forward(request);
        }
コード例 #2
0
        public override void Render()
        {
            ViewHelp.WriteLine("UPDATE BOOK INFORMATION", ConsoleColor.Green);

            string title       = ViewHelp.InputString("Title", Model.Authors);
            string authors     = ViewHelp.InputString("Authors", Model.Authors);
            string publisher   = ViewHelp.InputString("Publisher", Model.Publisher);
            int    year        = ViewHelp.InputInt("Year", Model.Year);
            int    edition     = ViewHelp.InputInt("Edition", Model.Edition);
            string tags        = ViewHelp.InputString("Tags", Model.Tags);
            string description = ViewHelp.InputString("Description", Model.Description);
            int    rate        = ViewHelp.InputInt("Rate", Model.Rating);
            bool   reading     = ViewHelp.InputBool("Reading", Model.Reading);
            string file        = ViewHelp.InputString("File", Model.File);

            var request = "do update ? " +
                          $"id = {Model.Id} & " +
                          $"title = {title} & " +
                          $"authors = {authors} & " +
                          $"publisher = {publisher} & " +
                          $"year = {year} & " +
                          $"edition = {edition} & " +
                          $"tags = {tags} & " +
                          $"description = {description} & " +
                          $"rate = {rate} & " +
                          $"reading = {reading} & " +
                          $"file = {file}";

            Router.Instance.Forward(request);
        }
コード例 #3
0
ファイル: BookUpdateView.cs プロジェクト: tanhank2k/oop_c-
        public void Render()
        {
            ViewHelp.WriteLine("UPDATE BOOK INFORMATION", ConsoleColor.Green);


            var title       = ViewHelp.InputString("Title", Model.Title);
            var authors     = ViewHelp.InputString("Authors", Model.Authors);
            var publisher   = ViewHelp.InputString("Publisher", Model.Publisher);
            var year        = ViewHelp.InputInt("Year", Model.Year);
            var editon      = ViewHelp.InputInt("Edition", Model.Edition);
            var tags        = ViewHelp.InputString("Tags", Model.Tags);
            var description = ViewHelp.InputString("Description", Model.Description);
            var rate        = ViewHelp.InputInt("Rate", Model.Rating);
            var reading     = ViewHelp.InputBool("Reading", Model.Reading);
            var file        = ViewHelp.InputString("File", Model.File);
        }
コード例 #4
0
        /// <summary>
        /// Yeu cau nguoi dung nhap thong tin va luu lai thong tin do
        /// </summary>
        public void Render()
        {
            Console.ForegroundColor = ConsoleColor.DarkBlue;
            Console.WriteLine("CREATE A NEW BOOK");
            Console.ResetColor();

            var title       = ViewHelp.InputString("Title");
            var authors     = ViewHelp.InputString("Authors");
            var publisher   = ViewHelp.InputString("Publisher");
            var year        = ViewHelp.InputInt("Year");
            var editon      = ViewHelp.InputInt("Edition");
            var tags        = ViewHelp.InputString("Tags");
            var description = ViewHelp.InputString("Description");
            var rate        = ViewHelp.InputInt("Rate");
            var reading     = ViewHelp.InputBool("Reading");
            var file        = ViewHelp.InputString("File");
        }