public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { UserIPAddress userIPAddressDto = criteria as UserIPAddress; //Create a database command object within which T-SQL commands can //be executed. DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spInsertUserIPAddress"); //Parameters are added here, update each line to reflect the parameter from //the subscription object cw.AddInParameter("UserId", DbType.Int32, userIPAddressDto.UserId); cw.AddInParameter("IPOctet1Begin", DbType.Int32, userIPAddressDto.BeginAddress.Octet1); cw.AddInParameter("IPOctet2Begin", DbType.Int32, userIPAddressDto.BeginAddress.Octet2); cw.AddInParameter("IPOctet3Begin", DbType.Int32, userIPAddressDto.BeginAddress.Octet3); cw.AddInParameter("IPOctet3End", DbType.Int32, userIPAddressDto.EndAddress.Octet3); cw.AddInParameter("IPOctet4Begin", DbType.Int32, userIPAddressDto.BeginAddress.Octet4); cw.AddInParameter("IPOctet4End", DbType.Int32, userIPAddressDto.EndAddress.Octet4); //Return the commandwrapper object to DALCHelper where the stored proc //will be executed return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { //Cast the DataTransferObject to the Subscription object Subscription subscriptionDto = criteria as Subscription; //Create a database command object within which T-SQL commands can //be executed. DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spAdminUpdateSubscription"); //Parameters are added here, update each line to reflect the parameter from //the subscription object cw.AddInParameter("SubscriptionId", DbType.Int32, subscriptionDto.SubscriptionId); cw.AddInParameter("UserId", DbType.Int32, subscriptionDto.UserId); cw.AddInParameter("VolumeIssueId", DbType.Int32, subscriptionDto.VolumeIssueId); cw.AddInParameter("ArticleId", DbType.Int32, subscriptionDto.ArticleId); cw.AddInParameter("EffectiveDate", DbType.DateTime, subscriptionDto.EffectiveDate); cw.AddInParameter("ExpirationDate", DbType.DateTime, subscriptionDto.ExpirationDate); cw.AddInParameter("Active", DbType.Boolean, subscriptionDto.IsActive); cw.AddInParameter("UpdateUserId", DbType.Int32, subscriptionDto.UpdateUserId); //Return the commandwrapper object to DALCHelper where the stored proc //will be executed return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { User userDto = criteria as User; DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spGetUserRolesByUserId"); cw.AddInParameter("UserId", DbType.Int32, userDto.UserId); return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { Issue issueDto = criteria as Issue; DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spGetActiveArticles"); cw.AddInParameter("VolumeIssueId", DbType.Int32, issueDto.VolumeIssueId); return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { Volume volDeleteDto = criteria as Volume; DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spDeleteVolume"); cw.AddInParameter("VolumeId", DbType.Int32, volDeleteDto.VolumeId); return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { User userDto = criteria as User; DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spGetUserByEmail"); cw.AddInParameter("Email", DbType.String, userDto.EmailAddress); return(cw); }
public override DbCommandWrapper InitializeCommand(Microsoft.Practices.EnterpriseLibrary.Data.Database db, MN.Enterprise.Base.DataTransferObject criteria) { Issue issueDto = criteria as Issue; //Create a database command object within which T-SQL commands can //be executed. DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spGetVolumeAndIssueName"); cw.AddInParameter("VolumeIssueId", DbType.Int32, issueDto.VolumeIssueId); return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { UserIPAddress userIPAddressDto = criteria as UserIPAddress; //Create a database command object within which T-SQL commands can //be executed. DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spAdminGetUserIPAddresses"); //TODO: Add the appropriate parameter to the commandwrapper object here cw.AddInParameter("UserId", DbType.Int32, userIPAddressDto.UserId); return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { User userDto = criteria as User; DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spUpdateUserPasswordHash"); cw.AddInParameter("Email", DbType.String, userDto.EmailAddress); cw.AddInParameter("PasswordHash", DbType.String, userDto.PasswordHash); cw.AddInParameter("AccountStatus", DbType.Int32, userDto.AccountStatus); return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { Subscription subscriptionDto = criteria as Subscription; //Create a database command object within which T-SQL commands can //be executed. DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spAdminGetAvailableSubscriptions"); //TODO: Add the appropriate parameter to the commandwrapper object here cw.AddInParameter("UserId", DbType.Int32, subscriptionDto.UserId); cw.AddInParameter("VolumeIssueId", DbType.Int32, subscriptionDto.VolumeIssueId); return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { UserIPAddress userIPAddressDto = criteria as UserIPAddress; DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spGetUserIPAddressByIP"); cw.AddInParameter("@IPOctet1", DbType.Int32, userIPAddressDto.BeginAddress.Octet1); cw.AddInParameter("@IPOctet2", DbType.Int32, userIPAddressDto.BeginAddress.Octet2); cw.AddInParameter("@IPOctet3", DbType.Int32, userIPAddressDto.BeginAddress.Octet3); cw.AddInParameter("@IPOctet4", DbType.Int32, userIPAddressDto.BeginAddress.Octet4); return(cw); }
//TODO: 12-30-2006 - MN - Implement this class for deleting subscription records //Coding is complete. Use as reference public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { //Cast the DataTransferObject to the Subscription object Subscription subscriptionDto = criteria as Subscription; //Create a database command object within which T-SQL commands can //be executed. DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spAdminDeleteSubscription"); //Parameters are added here, update each line to reflect the parameter from //the subscription object cw.AddInParameter("SubscriptionId", DbType.Int32, subscriptionDto.SubscriptionId); //Return the commandwrapper object to DALCHelper where the stored proc //will be executed return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { Volume volumeUpdateDto = criteria as Volume; DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spUpdateVolume"); cw.AddInParameter("VolumeId", DbType.Int32, volumeUpdateDto.VolumeId); cw.AddInParameter("VolumeName", DbType.String, volumeUpdateDto.VolumeName); cw.AddInParameter("VolumeYear", DbType.String, volumeUpdateDto.VolumeYear); cw.AddInParameter("Active", DbType.Boolean, volumeUpdateDto.IsActive); cw.AddInParameter("UpdateUserId", DbType.Int32, volumeUpdateDto.UpdateUserId); return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { Subscription subscriptionDto = criteria as Subscription; //Create a database command object within which T-SQL commands can //be executed. DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spGetArticleDocumentsBySubscription"); cw.AddInParameter("UserId", DbType.Int32, subscriptionDto.UserId); cw.AddInParameter("VolumeIssueId", DbType.Int32, subscriptionDto.VolumeIssueId); cw.AddInParameter("ArticleId", DbType.Int32, subscriptionDto.ArticleId); return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { User userDto = criteria as User; DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spUpdateUserPasswordRecoveryInfo"); cw.AddInParameter("Email", DbType.String, userDto.EmailAddress); cw.AddInParameter("SecretQuestion1Id", DbType.Int32, userDto.SecretQuestion1Id); cw.AddInParameter("SecretQuestion2Id", DbType.Int32, userDto.SecretQuestion2Id); cw.AddInParameter("SecretAnswer1Hash", DbType.String, userDto.SecretAnswer1Hash); cw.AddInParameter("SecretAnswer2Hash", DbType.String, userDto.SecretAnswer2Hash); return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { UserIPAddress userIPAddressDto = criteria as UserIPAddress; DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spAdminExistsUserIPAddress"); cw.AddInParameter("IPOctet1Begin", DbType.Int32, userIPAddressDto.BeginAddress.Octet1); cw.AddInParameter("IPOctet2Begin", DbType.Int32, userIPAddressDto.BeginAddress.Octet2); cw.AddInParameter("IPOctet3Begin", DbType.Int32, userIPAddressDto.BeginAddress.Octet3); cw.AddInParameter("IPOctet3End", DbType.Int32, userIPAddressDto.EndAddress.Octet3); cw.AddInParameter("IPOctet4Begin", DbType.Int32, userIPAddressDto.BeginAddress.Octet4); cw.AddInParameter("IPOctet4End", DbType.Int32, userIPAddressDto.EndAddress.Octet4); return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject criteria) { User userDto = criteria as User; DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spUpdateUser"); cw.AddInParameter("UserId", DbType.Int32, userDto.UserId); cw.AddInParameter("FirstName", DbType.String, userDto.FirstName); cw.AddInParameter("LastName", DbType.String, userDto.LastName); cw.AddInParameter("MiddleInitial", DbType.String, userDto.MiddleInitial); cw.AddInParameter("AccountTypeId", DbType.Int32, userDto.AccountType); cw.AddInParameter("AccountStatus", DbType.Int32, userDto.AccountStatus); cw.AddInParameter("Active", DbType.Boolean, userDto.IsActive); cw.AddInParameter("UpdateUserId", DbType.Int32, userDto.UpdateUserId); return(cw); }
public override DbCommandWrapper InitializeCommand(Database db, DataTransferObject insertObj) { Volume volumeDto = insertObj as Volume; //Create a database command object within which T-SQL commands can //be executed. DbCommandWrapper cw = DbCommandFactory.GetStoredProcCommandWrapper(db, "spInsertVolume"); //Parameters are added here, update each line to reflect the parameter from //the subscription object cw.AddOutParameter("VolumeId", DbType.Int32, 4); cw.AddInParameter("VolumeName", DbType.String, volumeDto.VolumeName); cw.AddInParameter("VolumeYear", DbType.String, volumeDto.VolumeYear); cw.AddInParameter("Active", DbType.Boolean, volumeDto.IsActive); cw.AddInParameter("CreationUserId", DbType.Int32, volumeDto.CreationUserId); //Return the commandwrapper object to DALCHelper where the stored proc //will be executed return(cw); }