/// <summary> /// Inserts a list of factor ids into the database. /// </summary> /// <param name="context">Web service request context.</param> /// <param name="factorIds">Id for factors to insert.</param> /// <param name="factorUsage">How user selected factors should be used.</param> public static void AddUserSelectedFactors(WebServiceContext context, List <Int32> factorIds, UserSelectedFactorUsage factorUsage) { DataTable factorTable; if (factorIds.IsNotEmpty()) { // Delete all factor ids that belong to this request from the "temporary" tables. // This is done to avoid problem with restarts of the webservice. DeleteUserSelectedFactors(context); // Insert the new list of factors. factorTable = GetUserSelectedFactorsTable(context, factorIds, factorUsage); DataServer.AddUserSelectedFactors(context, factorTable); } }