public Admin GetAdminInfo(int adminId) { //// 136 TODO: get the admin info //// for now, returning the hard-coded value var errors = new List<string>(); var repository = new AdminRepository(); var service = new AdminService(repository); return service.GetAdmin(adminId, ref errors); }
public string InsertAdmin(Admin admin) { var errors = new List<string>(); var repository = new AdminRepository(); var service = new AdminService(repository); service.InsertAdmin(admin, ref errors); if (errors.Count == 0) { return "ok"; } return "error"; }
public string UpdateAdminInfo(Admin admin) { var errors = new List<string>(); var repository = new AdminRepository(this.entities); var service = new AdminService(repository); service.UpdateAdmin(admin, ref errors); if (errors.Count == 0) { return "Update Successful"; } return "error"; }
public string DeleteStudent(string id) { var errors = new List<string>(); var repository = new AdminRepository(); var service = new AdminService(repository); service.DeleteAdmin(id, ref errors); if (errors.Count == 0) { return "ok"; } return "error"; }
public Admin GetAdminInfo(int adminId) { var errors = new List<string>(); var repository = new AdminRepository(this.entities); var service = new AdminService(repository); var adminPoco = service.GetAdminById(adminId, ref errors); if (errors.Count == 0 && adminPoco != null) { return adminPoco; } return new Admin(); }