Пример #1
0
        private void CreateDepartment()
        {
            string     departmentName = CLIHelper.GetString("Provide a name for the new department:");
            Department newDept        = new Department
            {
                Name = departmentName
            };

            int id = departmentDAO.CreateDepartment(newDept);

            if (id > 0)
            {
                Console.WriteLine("*** SUCCESS ***");
            }
            else
            {
                Console.WriteLine("*** DID NOT CREATE ***");
            }
        }
Пример #2
0
        private MenuOptionResult CreateDepartment()
        {
            string     departmentName = GetString("Provide a name for the new department:");
            Department newDept        = new Department
            {
                // TODO: Uncomment this after the Department Model is implemented
                //Name = departmentName
            };

            int id = departmentDAO.CreateDepartment(newDept);

            if (id > 0)
            {
                Console.WriteLine($"*** Department {id} was created. ***");
            }
            else
            {
                Console.WriteLine("*** DID NOT CREATE ***");
            }
            return(MenuOptionResult.WaitAfterMenuSelection);
        }