public AccountView CreateAccount(AccountView accountView) { if (CheckAccount(accountView) == true) { var lastempCode = GetLastEmpCode(); var accNew = new Account { Code = lastempCode != null?GenerateCode.GenerateEmpCodeNTU(lastempCode, "EMP") : "EMP00000001", Email = accountView.Email, FullName = accountView.FullName, Password = accountView.Password, Image = accountView.Image, Role = 2, Active = true, Status = true }; var account = CreateNTU(accNew).Result; accountView.Id = account.Id; accountView.Code = account.Code; return(accountView); } return(null); }