//管理员账号注册 public ActionResult ManAdd(string ID, string pass, string name) { accountService account = new accountService(); if (account.AddNew1(ID, pass, name, "Manager") == true) { return(Json("注册成功")); } else { return(Json("注册账号已存在")); } }
//护士账号注册 public ActionResult ManAdd1(string nurseID, string nurseName, string nursePassword, string nursePosition, string nurseDept_name, string nurseGender) { accountService accountS = new accountService(); NurseService nurseService = new NurseService(); account account = new account(); if (accountS.AddNew1(nurseID, nursePassword, nurseName, "Nurse") == false) { return(Json("账号已存在,请重新注册"));//ToDo } account.user_ID = nurseID; account.name = nurseName; nurseService.AddNew(account, nurseDept_name, nursePosition, 0, nurseGender); //返回值待定 return(Json("注册成功")); }
//医生账号注册 public ActionResult ManAdd2(string userID, string name, string pass, string dept, string position, string age, string sex) { accountService accounts = new accountService(); DoctorService doctorService = new DoctorService(); account account = new account(); if (accounts.AddNew1(userID, pass, name, "Doctor") == false)//ToDo { return(Json("账号已存在,请重新注册")); } account.user_ID = userID; account.name = name; int iu = int.Parse(age); doctorService.AddNew(account, dept, position, 0, iu, sex); //返回值待定 return(Json("注册成功")); }