/// <summary> /// Run OrganizationMetaData_SelectBy_MetaDataId, and return results as a list of OrganizationMetaDataRow. /// </summary> /// <param name="fldMetaDataId">Value for MetaDataId</param> /// <returns>A collection of OrganizationMetaDataRow.</returns> public virtual bool SelectBy_MetaDataId(int fldMetaDataId ) { var result = false; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[OrganizationMetaData_SelectBy_MetaDataId]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@MetaDataId", fldMetaDataId) }); using(var r = cmd.ExecuteReader()) result = ReadAll(r); } }); return result; }
/// <summary> /// Run Role_Search, and return results as a list of RoleRow. /// </summary> /// <param name="fldTitle">Value for Title</param> /// <param name="fldDescription">Value for Description</param> /// <param name="fldWINSID">Value for WINSID</param> /// <returns>A collection of RoleRow.</returns> public virtual bool Search(string fldTitle , string fldDescription , string fldWINSID ) { var result = false; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Auth].[Role_Search]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@Title", fldTitle) , new SqlParameter("@Description", fldDescription) , new SqlParameter("@WINSID", fldWINSID) }); using (var r = cmd.ExecuteReader()) result = ReadAll(r); } }); return(result); }
/// <summary> /// Run Organizations_Search, and return results as a list of OrganizationsRow. /// </summary> /// <param name="fldOrganizationName">Value for OrganizationName</param> /// <param name="fldSourceUrl">Value for SourceUrl</param> /// <returns>A collection of OrganizationsRow.</returns> public virtual bool Search(string fldOrganizationName , string fldSourceUrl ) { var result = false; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Client].[Organizations_Search]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@OrganizationName", fldOrganizationName) , new SqlParameter("@SourceUrl", fldSourceUrl) }); using (var r = cmd.ExecuteReader()) result = ReadAll(r); } }); return(result); }
/// <summary> /// Insert by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>1, if insert was successful</returns> public int Insert(VoterContract row) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[Voter_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@UserId", row.UserId) , new SqlParameter("@ContentInspectionId", row.ContentInspectionId) , new SqlParameter("@LocationId", row.LocationId) , new SqlParameter("@VoterName", row.VoterName) , new SqlParameter("@PostalCode", row.PostalCode) , new SqlParameter("@FavoriteOrganizationId", row.FavoriteOrganizationId) }); result = (int?)cmd.ExecuteScalar(); row.VoterId = result; } }); return(result != null ? 1 : 0); }
/// <summary> /// Run UserRole_Insert. /// </summary> /// <param name="fldUserId">Value for UserId</param> /// <param name="fldRoleId">Value for RoleId</param> /// <returns>The new ID</returns> public virtual int?Insert(int fldUserId , int fldRoleId ) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Auth].[UserRole_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@UserId", fldUserId) , new SqlParameter("@RoleId", fldRoleId) }); result = (int?)cmd.ExecuteScalar(); } }); return(result); }
/// <summary> /// Update by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>The number of rows affected.</returns> public virtual int Update(CandidateMetaDataContract row) { var rowCount = 0; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[CandidateMetaData_Update]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@CandidateMetaDataId", row.CandidateMetaDataId) , new SqlParameter("@ContentInspectionId", row.ContentInspectionId) , new SqlParameter("@CandidateId", row.CandidateId) , new SqlParameter("@MetaDataId", row.MetaDataId) , new SqlParameter("@MetaDataValue", row.MetaDataValue) }); rowCount = cmd.ExecuteNonQuery(); } }); return(rowCount); }
/// <summary> /// Run CandidateMetaData_Delete. /// </summary> /// <returns>The number of rows affected.</returns> /// <param name="fldCandidateMetaDataId">Value for CandidateMetaDataId</param> public virtual int Delete(int fldCandidateMetaDataId ) { var rowCount = 0; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[CandidateMetaData_Delete]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@CandidateMetaDataId", fldCandidateMetaDataId) }); rowCount = cmd.ExecuteNonQuery(); } }); return(rowCount); }
/// <summary> /// Update by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>The number of rows affected.</returns> public virtual int Update(ElectionCandidateContract row) { var rowCount = 0; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[ElectionCandidate_Update]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@ElectionCandidateId", row.ElectionCandidateId) , new SqlParameter("@ContentInspectionId", row.ContentInspectionId) , new SqlParameter("@CandidateId", row.CandidateId) , new SqlParameter("@ElectionId", row.ElectionId) , new SqlParameter("@IsWinner", row.IsWinner) , new SqlParameter("@ReportedVoteCount", row.ReportedVoteCount) }); rowCount = cmd.ExecuteNonQuery(); } }); return(rowCount); }
/// <summary> /// Run ElectionLevel_Update. /// </summary> /// <returns>The number of rows affected.</returns> /// <param name="fldElectionLevelId">Value for ElectionLevelId</param> /// <param name="fldContentInspectionId">Value for ContentInspectionId</param> /// <param name="fldElectionLevelTitle">Value for ElectionLevelTitle</param> public virtual int Update(int fldElectionLevelId , int fldContentInspectionId , string fldElectionLevelTitle ) { var rowCount = 0; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[ElectionLevel_Update]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@ElectionLevelId", fldElectionLevelId) , new SqlParameter("@ContentInspectionId", fldContentInspectionId) , new SqlParameter("@ElectionLevelTitle", fldElectionLevelTitle) }); rowCount = cmd.ExecuteNonQuery(); } }); return(rowCount); }
/// <summary> /// Run Users_SelectByUser_UpdateProfile, and return results as a list of UsersRow. /// </summary> /// <param name="fldAuthUserId">Value for AuthUserId</param> /// <param name="fldDisplayName">Value for DisplayName</param> /// <param name="fldEmail">Value for Email</param> /// <returns>A collection of UsersRow.</returns> public virtual bool SelectByUser_UpdateProfile(int fldAuthUserId , string fldDisplayName , string fldEmail ) { var result = false; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Client].[Users_SelectByUser_UpdateProfile]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@AuthUserId", fldAuthUserId) , new SqlParameter("@DisplayName", fldDisplayName) , new SqlParameter("@Email", fldEmail) }); using (var r = cmd.ExecuteReader()) result = ReadAll(r); } }); return(result); }
/// <summary> /// Insert by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>1, if insert was successful</returns> public int Insert(MetaDataContract row) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[MetaData_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@ContentInspectionId", row.ContentInspectionId) , new SqlParameter("@MetaDataName", row.MetaDataName) , new SqlParameter("@IsRequired", row.IsRequired) , new SqlParameter("@AppliesAtAllLevels", row.AppliesAtAllLevels) , new SqlParameter("@AppliesToCandidates", row.AppliesToCandidates) , new SqlParameter("@AppliesToOrganizations", row.AppliesToOrganizations) }); result = (int?)cmd.ExecuteScalar(); row.MetaDataId = result; } }); return(result != null ? 1 : 0); }
/// <summary> /// Run Permission_Insert. /// </summary> /// <param name="fldPermissionName">Value for PermissionName</param> /// <param name="fldTitle">Value for Title</param> /// <param name="fldIsRead">Value for IsRead</param> /// <returns>The new ID</returns> public virtual int?Insert(string fldPermissionName , string fldTitle , bool fldIsRead ) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Auth].[Permission_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@PermissionName", fldPermissionName) , new SqlParameter("@Title", fldTitle) , new SqlParameter("@IsRead", fldIsRead) }); result = (int?)cmd.ExecuteScalar(); } }); return(result); }
/// <summary> /// Run RolePermission_Update. /// </summary> /// <returns>The number of rows affected.</returns> /// <param name="fldRolePermissionId">Value for RolePermissionId</param> /// <param name="fldRoleId">Value for RoleId</param> /// <param name="fldPermissionId">Value for PermissionId</param> public virtual int Update(int fldRolePermissionId , int fldRoleId , int fldPermissionId ) { var rowCount = 0; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Auth].[RolePermission_Update]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@RolePermissionId", fldRolePermissionId) , new SqlParameter("@RoleId", fldRoleId) , new SqlParameter("@PermissionId", fldPermissionId) }); rowCount = cmd.ExecuteNonQuery(); } }); return(rowCount); }
/// <summary> /// Update by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>The number of rows affected.</returns> public virtual int Update(PermissionContract row) { var rowCount = 0; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Auth].[Permission_Update]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@PermissionId", row.PermissionId) , new SqlParameter("@PermissionName", row.PermissionName) , new SqlParameter("@Title", row.Title) , new SqlParameter("@IsRead", row.IsRead) }); rowCount = cmd.ExecuteNonQuery(); } }); return(rowCount); }
/// <summary> /// Insert by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>1, if insert was successful</returns> public int Insert(PermissionContract row) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Auth].[Permission_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@PermissionName", row.PermissionName) , new SqlParameter("@Title", row.Title) , new SqlParameter("@IsRead", row.IsRead) }); result = (int?)cmd.ExecuteScalar(); row.PermissionId = result; } }); return(result != null ? 1 : 0); }
/// <summary> /// Run Voter_Search, and return results as a list of VoterRow. /// </summary> /// <param name="fldVoterName">Value for VoterName</param> /// <param name="fldPostalCode">Value for PostalCode</param> /// <returns>A collection of VoterRow.</returns> public virtual bool Search(string fldVoterName , string fldPostalCode ) { var result = false; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[Voter_Search]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@VoterName", fldVoterName) , new SqlParameter("@PostalCode", fldPostalCode) }); using (var r = cmd.ExecuteReader()) result = ReadAll(r); } }); return(result); }
/// <summary> /// Insert by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>1, if insert was successful</returns> public int Insert(UserRoleContract row) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Auth].[UserRole_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@UserId", row.UserId) , new SqlParameter("@RoleId", row.RoleId) }); result = (int?)cmd.ExecuteScalar(); row.UserRoleId = result; } }); return(result != null ? 1 : 0); }
/// <summary> /// Insert by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>1, if insert was successful</returns> public int Insert(ElectionContract row) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[Election_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@ContentInspectionId", row.ContentInspectionId) , new SqlParameter("@ElectionLevelId", row.ElectionLevelId) , new SqlParameter("@LocationId", row.LocationId) , new SqlParameter("@VotingDate", row.VotingDate) }); result = (int?)cmd.ExecuteScalar(); row.ElectionId = result; } }); return(result != null ? 1 : 0); }
/// <summary> /// Run User_Search, and return results as a list of UserRow. /// </summary> /// <param name="fldUserName">Value for UserName</param> /// <param name="fldDisplayName">Value for DisplayName</param> /// <param name="fldEmail">Value for Email</param> /// <param name="fldWINSID">Value for WINSID</param> /// <returns>A collection of UserRow.</returns> public virtual bool Search(string fldUserName , string fldDisplayName , string fldEmail , string fldWINSID ) { var result = false; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Auth].[User_Search]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@UserName", fldUserName) , new SqlParameter("@DisplayName", fldDisplayName) , new SqlParameter("@Email", fldEmail) , new SqlParameter("@WINSID", fldWINSID) }); using (var r = cmd.ExecuteReader()) result = ReadAll(r); } }); return(result); }
/// <summary> /// Update by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>The number of rows affected.</returns> public virtual int Update(ElectionContract row) { var rowCount = 0; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[Election_Update]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@ElectionId", row.ElectionId) , new SqlParameter("@ContentInspectionId", row.ContentInspectionId) , new SqlParameter("@ElectionLevelId", row.ElectionLevelId) , new SqlParameter("@LocationId", row.LocationId) , new SqlParameter("@VotingDate", row.VotingDate) }); rowCount = cmd.ExecuteNonQuery(); } }); return(rowCount); }
/// <summary> /// Insert by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>1, if insert was successful</returns> public int Insert(ElectionCandidateContract row) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[ElectionCandidate_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@ContentInspectionId", row.ContentInspectionId) , new SqlParameter("@CandidateId", row.CandidateId) , new SqlParameter("@ElectionId", row.ElectionId) , new SqlParameter("@IsWinner", row.IsWinner) , new SqlParameter("@ReportedVoteCount", row.ReportedVoteCount) }); result = (int?)cmd.ExecuteScalar(); row.ElectionCandidateId = result; } }); return(result != null ? 1 : 0); }
/// <summary> /// Run Election_Insert. /// </summary> /// <param name="fldContentInspectionId">Value for ContentInspectionId</param> /// <param name="fldElectionLevelId">Value for ElectionLevelId</param> /// <param name="fldLocationId">Value for LocationId</param> /// <param name="fldVotingDate">Value for VotingDate</param> /// <returns>The new ID</returns> public virtual int?Insert(int fldContentInspectionId , int fldElectionLevelId , int fldLocationId , DateTime fldVotingDate ) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[Election_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@ContentInspectionId", fldContentInspectionId) , new SqlParameter("@ElectionLevelId", fldElectionLevelId) , new SqlParameter("@LocationId", fldLocationId) , new SqlParameter("@VotingDate", fldVotingDate) }); result = (int?)cmd.ExecuteScalar(); } }); return(result); }
/// <summary> /// Run ElectionCandidate_Insert. /// </summary> /// <param name="fldContentInspectionId">Value for ContentInspectionId</param> /// <param name="fldCandidateId">Value for CandidateId</param> /// <param name="fldElectionId">Value for ElectionId</param> /// <param name="fldIsWinner">Value for IsWinner</param> /// <param name="fldReportedVoteCount">Value for ReportedVoteCount</param> /// <returns>The new ID</returns> public virtual int?Insert(int fldContentInspectionId , int fldCandidateId , int fldElectionId , bool fldIsWinner , bool fldReportedVoteCount ) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[ElectionCandidate_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@ContentInspectionId", fldContentInspectionId) , new SqlParameter("@CandidateId", fldCandidateId) , new SqlParameter("@ElectionId", fldElectionId) , new SqlParameter("@IsWinner", fldIsWinner) , new SqlParameter("@ReportedVoteCount", fldReportedVoteCount) }); result = (int?)cmd.ExecuteScalar(); } }); return(result); }
/// <summary> /// Insert by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>1, if insert was successful</returns> public int Insert(RoleContract row) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Auth].[Role_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@Title", row.Title) , new SqlParameter("@Description", row.Description) , new SqlParameter("@IsActive", row.IsActive) , new SqlParameter("@ApplyToAnon", row.ApplyToAnon) , new SqlParameter("@ApplyToAllUsers", row.ApplyToAllUsers) , new SqlParameter("@PreventAddingUsers", row.PreventAddingUsers) , new SqlParameter("@WINSID", row.WINSID) }); result = (int?)cmd.ExecuteScalar(); row.RoleId = result; } }); return(result != null ? 1 : 0); }
/// <summary> /// Insert by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>1, if insert was successful</returns> public int Insert(CandidateMetaDataContract row) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[CandidateMetaData_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@ContentInspectionId", row.ContentInspectionId) , new SqlParameter("@CandidateId", row.CandidateId) , new SqlParameter("@MetaDataId", row.MetaDataId) , new SqlParameter("@MetaDataValue", row.MetaDataValue) }); result = (int?)cmd.ExecuteScalar(); row.CandidateMetaDataId = result; } }); return(result != null ? 1 : 0); }
/// <summary> /// Determine if the table contains a row with the existing values /// </summary> /// <param name="fldOrganizationMetaDataId">Value for OrganizationMetaDataId</param> /// <returns>True, if the values exist, or false.</returns> public virtual bool Exists(int fldOrganizationMetaDataId ) { bool result = false; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[OrganizationMetaData_Exists]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@OrganizationMetaDataId", fldOrganizationMetaDataId) }); result = (bool)cmd.ExecuteScalar(); } }); return result; }
/// <summary> /// Run CandidateMetaData_Insert. /// </summary> /// <param name="fldContentInspectionId">Value for ContentInspectionId</param> /// <param name="fldCandidateId">Value for CandidateId</param> /// <param name="fldMetaDataId">Value for MetaDataId</param> /// <param name="fldMetaDataValue">Value for MetaDataValue</param> /// <returns>The new ID</returns> public virtual int?Insert(int fldContentInspectionId , int fldCandidateId , int fldMetaDataId , string fldMetaDataValue ) { int?result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[CandidateMetaData_Insert]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@ContentInspectionId", fldContentInspectionId) , new SqlParameter("@CandidateId", fldCandidateId) , new SqlParameter("@MetaDataId", fldMetaDataId) , new SqlParameter("@MetaDataValue", fldMetaDataValue) }); result = (int?)cmd.ExecuteScalar(); } }); return(result); }
/// <summary> /// Update by providing a populated data row container /// </summary> /// <param name="row">The table row data to use</param> /// <returns>The number of rows affected.</returns> public virtual int Update(UserRoleContract row) { var rowCount = 0; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Auth].[UserRole_Update]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@UserRoleId", row.UserRoleId) , new SqlParameter("@UserId", row.UserId) , new SqlParameter("@RoleId", row.RoleId) }); rowCount = cmd.ExecuteNonQuery(); } }); return(rowCount); }
/// <summary> /// Delete the rows in bulk, uses the same connection (faster). /// </summary> /// <param name="rows">The table rows to Delete</param> /// <returns>The number of rows affected.</returns> public virtual int DeleteAll(List<OrganizationMetaDataContract> rows) { var rowCount = 0; VotingInfoDb.ConnectThen(x => { rowCount = DeleteAll(rows, x, null); }); return rowCount; }
/// <summary> /// Save the rows in bulk, uses the same connection (faster). /// </summary> /// <param name="rows">The table rows to Save</param> /// <returns>The number of rows affected.</returns> public virtual int SaveAll(List<OrganizationMetaDataContract> rows) { var rowCount = 0; VotingInfoDb.ConnectThen(x => { foreach(var row in rows) rowCount += Save(row, x, null); }); return rowCount; }