static void CreateTeacherAccount() { int id; string idTry, name, passwd, major; while (true) { Console.WriteLine("Please Enter ID: "); idTry = Console.ReadLine(); try { id = Int32.Parse(idTry); break; } catch (Exception e) { Console.WriteLine("Please Enter ID As Int: "); continue; throw; } } Console.WriteLine("Please Enter Your Name: "); name = Console.ReadLine(); Console.WriteLine("Please Enter Your Major: "); major = Console.ReadLine(); Console.WriteLine("Please Enter Your Password: "******"Create Teacher Account Successful!"); }
public async Task <IActionResult> AddTeacher(TeacherParameter teacherParameter) { if (ModelState.IsValid) { var isAdded = await _TeacherBusiness.AddTeacher(teacherParameter); if (isAdded) { return(Ok("Added successfully")); } } return(BadRequest(ModelState)); }