Exemplo n.º 1
0
        public static DataTable GetTop5AutomationJobs(int Status, String ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            // Pass the specified field and its value to the stored procedure.
            oDatabaseHelper.AddParameter("@Status", Status);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            SqlDataReader drCampaigns = (SqlDataReader)oDatabaseHelper.ExecuteReader("sp_AutomationJob_GetTop5CampaignJobs", ref ExecutionState);
            //CampaignJobs CampaignJobs = PopulateObjectsFromReader(dr, ConnectionString);
            //dr.Close();
            DataTable dt = new DataTable();
            // Add the table columns.
            for (int i = 0; i < drCampaigns.FieldCount; i++)
                dt.Columns.Add(drCampaigns.GetName(i), drCampaigns.GetFieldType(i));

            while (drCampaigns.Read())
            {
                DataRow r = dt.NewRow();
                // Assign DataReader values to DataRow.
                for (int i = 0; i < drCampaigns.FieldCount; i++)
                    r[i] = drCampaigns[i];
                dt.Rows.Add(r);
            }

            drCampaigns.Close();
            oDatabaseHelper.Dispose();
            return dt;
        }
Exemplo n.º 2
0
        public static ContactDeleteds SelectAllByToday(string ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.

            IDataReader dr = oDatabaseHelper.ExecuteReader("sp_ContactDeleted_SelectAll_ByToday", ref ExecutionState);
            ContactDeleteds ContactDeleteds = PopulateObjectsFromReader(dr, ConnectionString);
            dr.Close();
            oDatabaseHelper.Dispose();
            return ContactDeleteds;
        }
Exemplo n.º 3
0
        public static AutomationJobs SelectAllByDays(int days, String ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@DAYS", days);

            IDataReader dr = oDatabaseHelper.ExecuteReader("sp_AutomationJob_SelectAll_ByDays", ref ExecutionState);
            AutomationJobs ContactMasters = PopulateObjectsFromReader(dr, ConnectionString);
            dr.Close();
            oDatabaseHelper.Dispose();
            return ContactMasters;
        }
Exemplo n.º 4
0
        //This method will Select all te campaigns from the table CampaignMaster which are not included in CampaignJob
        public static CampaignMasters selectAllForLaunchCampaigns(String ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr = oDatabaseHelper.ExecuteReader("sp_CampaignJob_selectAllForLaunchCampaigns", ref ExecutionState);
            CampaignMasters CampaignMasters = PopulateObjectsFromReader(dr,ConnectionString);
            dr.Close();
            oDatabaseHelper.Dispose();
            return CampaignMasters;
        }
Exemplo n.º 5
0
        public static ContactDeleteds SelectAllByMonths(DateTime FromDate, DateTime ToDate, String ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@FromDate", FromDate);
            oDatabaseHelper.AddParameter("@ToDate", ToDate);

            IDataReader dr = oDatabaseHelper.ExecuteReader("sp_ContactDeleted_SelectAll_ByMonths", ref ExecutionState);
            ContactDeleteds ContactMasters = PopulateObjectsFromReader(dr, ConnectionString);
            dr.Close();
            oDatabaseHelper.Dispose();
            return ContactMasters;
        }
Exemplo n.º 6
0
        public static ImportJobs SelectAllBasedOnListID(string listID,string ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;

            // Pass the specified field and its value to the stored procedure.
            oDatabaseHelper.AddParameter("@ListID", listID);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr = oDatabaseHelper.ExecuteReader("sp_ImportJob_SelectAllBasedOnListID", ref ExecutionState);
            ImportJobs ImportJobs = PopulateObjectsFromReader(dr,ConnectionString);
            dr.Close();
            oDatabaseHelper.Dispose();
            return ImportJobs;
        }
Exemplo n.º 7
0
        //Vikas Kumar Bhatnagar on 04thJuly2011
        public static CampaignJobs SelectAllDomianLast90Days(string ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.

            IDataReader dr = oDatabaseHelper.ExecuteReader("TotalDeliverCountByDomainLast90Days", ref ExecutionState);
            CampaignJobs CampaignJobs = PopulateObjectsFromReaderNew(dr, ConnectionString);
            dr.Close();
            oDatabaseHelper.Dispose();
            return CampaignJobs;
        }
Exemplo n.º 8
0
        /// <summary>
        /// </summary>
        /// <param name="days"></param>
        /// <param name="ConnectionString"></param>
        /// <returns></returns>
        //Vikas Kumar Bhatnagar on 04thJuly2011
        public static CampaignJobs SelectAllDomianByWeek(String ConnectionString, ref DateTime from, ref DateTime to)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            // oDatabaseHelper.AddParameter("@DAYS", days);

            IDataReader dr = oDatabaseHelper.ExecuteReader("TotalDeliverCountByDomainLast7Days", ref ExecutionState);
            CampaignJobs ContactMasters = PopulateObjectsFromReaderNew(dr, ConnectionString);
            dr.Close();
            oDatabaseHelper.Dispose();
            return ContactMasters;
        }
Exemplo n.º 9
0
        //swaraj on 23rd apr 2010
        //this method is used to search the contacts depends on search criteria
        public static DataTable SearchContacts(string WhereCondn, string connectionstring, int ListId)
        {
            bool ExcutionState = false;
            DatabaseHelper obDatahelper = new DatabaseHelper(connectionstring);
            obDatahelper.AddParameter("@whereCondition", WhereCondn);
            obDatahelper.AddParameter("@ListId", ListId);
            obDatahelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);
            SqlDataReader drContactMaster = (SqlDataReader)obDatahelper.ExecuteReader("sp_ListContactMaster_SelectBySearchCondition_Proc", ref ExcutionState);
            DataTable dt = new DataTable();
            // Add the table columns.
            for (int i = 0; i < drContactMaster.FieldCount; i++)
                dt.Columns.Add(drContactMaster.GetName(i), drContactMaster.GetFieldType(i));

            while (drContactMaster.Read())
            {
                DataRow r = dt.NewRow();
                // Assign DataReader values to DataRow.
                for (int i = 0; i < drContactMaster.FieldCount; i++)
                    r[i] = drContactMaster[i];
                dt.Rows.Add(r);
            }

            drContactMaster.Close();
            return dt;
        }
Exemplo n.º 10
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        /// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
        /// <returns>True if succeeded</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			11/21/2009 4:19:24 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public bool InsertWithDefaultValues(bool getBackValues)
        {
            bool ExecutionState = false;
            oDatabaseHelper = new DatabaseHelper(ConnectionString);

            // Pass the value of '_id' as parameter 'ID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ID", _idNonDefault);
            // Pass the value of '_importJobID' as parameter 'ImportJobID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ImportJobID", _importJobIDNonDefault);
            // Pass the value of '_sourceField' as parameter 'SourceField' of the stored procedure.
            oDatabaseHelper.AddParameter("@SourceField", _sourceFieldNonDefault);
            // Pass the value of '_destinationField' as parameter 'DestinationField' of the stored procedure.
            oDatabaseHelper.AddParameter("@DestinationField", _destinationFieldNonDefault);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            if(!getBackValues )
            {
                oDatabaseHelper.ExecuteScalar("sp_FieldMap_Insert_WithDefaultValues", ref ExecutionState);
            }
            else
            {
                IDataReader dr=oDatabaseHelper.ExecuteReader("sp_FieldMap_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
                if (dr.Read())
                {
                    PopulateObjectFromReader(this,dr);
                }
                dr.Close();
            }
            oDatabaseHelper.Dispose();
            return ExecutionState;
        }
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        /// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
        /// <returns>True if succeeded</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			7/28/2012 02:17:32 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public bool InsertWithDefaultValues(bool getBackValues)
        {
            bool ExecutionState = false;
            oDatabaseHelper = new DatabaseHelper();

            // Pass the value of '_listContactId' as parameter 'ListContactId' of the stored procedure.
            oDatabaseHelper.AddParameter("@ListContactId", _listContactIdNonDefault);
            // Pass the value of '_listMasterID' as parameter 'ListMasterID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ListMasterID", _listMasterIDNonDefault);
            // Pass the value of '_contactId' as parameter 'ContactId' of the stored procedure.
            oDatabaseHelper.AddParameter("@ContactId", _contactIdNonDefault);
            // Pass the value of '_clientId' as parameter 'ClientId' of the stored procedure.
            oDatabaseHelper.AddParameter("@ClientId", _clientIdNonDefault);
            // Pass the value of '_createdDate' as parameter 'CreatedDate' of the stored procedure.
            oDatabaseHelper.AddParameter("@CreatedDate", _createdDateNonDefault);
            // Pass the value of '_modifiedDate' as parameter 'ModifiedDate' of the stored procedure.
            oDatabaseHelper.AddParameter("@ModifiedDate", _modifiedDateNonDefault);
            // Pass the value of '_createdBy' as parameter 'CreatedBy' of the stored procedure.
            oDatabaseHelper.AddParameter("@CreatedBy", _createdByNonDefault);
            // Pass the value of '_modifiedBy' as parameter 'ModifiedBy' of the stored procedure.
            oDatabaseHelper.AddParameter("@ModifiedBy", _modifiedByNonDefault);
            // Pass the value of '_isActive' as parameter 'IsActive' of the stored procedure.
            oDatabaseHelper.AddParameter("@IsActive", _isActiveNonDefault);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            if(!getBackValues )
            {
                oDatabaseHelper.ExecuteScalar("sp_AdvanceListContactMaster_Insert_WithDefaultValues", ref ExecutionState);
            }
            else
            {
                IDataReader dr=oDatabaseHelper.ExecuteReader("sp_AdvanceListContactMaster_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
                if (dr.Read())
                {
                    PopulateObjectFromReader(this,dr);
                }
                dr.Close();
            }
            oDatabaseHelper.Dispose();
            return ExecutionState;
        }
Exemplo n.º 12
0
        /// <summary>
        /// This method will get row(s) from the database using the value of the field specified 
        /// along with the details of the child table.
        /// </summary>
        ///
        /// <param name="pk" type="AdvancedImportJobPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class AdvancedFieldMaps</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			7/4/2012 2:40:13 PM				Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static AdvancedFieldMaps SelectAllByForeignKeyFromAdvancedImportJob(AdvancedImportJobPrimaryKey pk)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;
            AdvancedFieldMaps obj = null;

            // Pass the values of all key parameters to the stored procedure.
            System.Collections.Specialized.NameValueCollection nvc = pk.GetKeysAndValues();
            foreach (string key in nvc.Keys)
            {
                oDatabaseHelper.AddParameter("@" + key,nvc[key] );
            }

            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr=oDatabaseHelper.ExecuteReader("sp_AdvancedFieldMap_SelectAllByForeignKeyAdvancedImportJob", ref ExecutionState);
            obj = new AdvancedFieldMaps();
            obj = AdvancedFieldMap.PopulateObjectsFromReaderWithCheckingReader(dr, oDatabaseHelper);

            dr.Close();
            oDatabaseHelper.Dispose();
            return obj;
        }
Exemplo n.º 13
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        /// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
        /// <returns>True if succeeded</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			07/27/2010 11:57:21 AM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public bool InsertWithDefaultValues(bool getBackValues)
        {
            bool ExecutionState = false;
            oDatabaseHelper = new DatabaseHelper(ConnectionString);

            // Pass the value of '_exceptionLogID' as parameter 'ExceptionLogID' of the stored procedure.
            //oDatabaseHelper.AddParameter("@ExceptionLogID", _exceptionLogIDNonDefault);
            // Pass the value of '_date' as parameter 'Date' of the stored procedure.
            oDatabaseHelper.AddParameter("@Date", _dateNonDefault);
            // Pass the value of '_type' as parameter 'Type' of the stored procedure.
            oDatabaseHelper.AddParameter("@Type", _typeNonDefault);
            // Pass the value of '_message' as parameter 'Message' of the stored procedure.
            oDatabaseHelper.AddParameter("@Message", _messageNonDefault);
            // Pass the value of '_stackTrace' as parameter 'StackTrace' of the stored procedure.
            oDatabaseHelper.AddParameter("@StackTrace", _stackTraceNonDefault);
            // Pass the value of '_userID' as parameter 'UserID' of the stored procedure.
            oDatabaseHelper.AddParameter("@UserID", _userIDNonDefault);
            // Pass the value of '_isCompleted' as parameter 'IsCompleted' of the stored procedure.
            oDatabaseHelper.AddParameter("@IsCompleted", _isCompletedNonDefault);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            if(!getBackValues )
            {
                oDatabaseHelper.ExecuteScalar("sp_ExceptionLog_Insert_WithDefaultValues", ref ExecutionState);
            }
            else
            {
                IDataReader dr=oDatabaseHelper.ExecuteReader("sp_ExceptionLog_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
                if (dr.Read())
                {
                    PopulateObjectFromReader(this,dr);
                }
                dr.Close();
            }
            oDatabaseHelper.Dispose();
            return ExecutionState;
        }
Exemplo n.º 14
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        /// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
        /// <returns>True if succeeded</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			2/15/2012 12:52:22 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public bool InsertWithDefaultValues(bool getBackValues)
        {
            bool ExecutionState = false;
            oDatabaseHelper = new DatabaseHelper();

            // Pass the value of '_id' as parameter 'Id' of the stored procedure.
            oDatabaseHelper.AddParameter("@Id", _idNonDefault);
            // Pass the value of '_userId' as parameter 'UserId' of the stored procedure.
            oDatabaseHelper.AddParameter("@UserId", _userIdNonDefault);
            // Pass the value of '_userName' as parameter 'UserName' of the stored procedure.
            oDatabaseHelper.AddParameter("@UserName", _userNameNonDefault);
            // Pass the value of '_firstName' as parameter 'FirstName' of the stored procedure.
            oDatabaseHelper.AddParameter("@FirstName", _firstNameNonDefault);
            // Pass the value of '_lastName' as parameter 'LastName' of the stored procedure.
            oDatabaseHelper.AddParameter("@LastName", _lastNameNonDefault);
            // Pass the value of '_address1' as parameter 'Address1' of the stored procedure.
            oDatabaseHelper.AddParameter("@Address1", _address1NonDefault);
            // Pass the value of '_address2' as parameter 'Address2' of the stored procedure.
            oDatabaseHelper.AddParameter("@Address2", _address2NonDefault);
            // Pass the value of '_workPhone' as parameter 'WorkPhone' of the stored procedure.
            oDatabaseHelper.AddParameter("@WorkPhone", _workPhoneNonDefault);
            // Pass the value of '_cellPhone' as parameter 'CellPhone' of the stored procedure.
            oDatabaseHelper.AddParameter("@CellPhone", _cellPhoneNonDefault);
            // Pass the value of '_Fax' as parameter 'Fax' of the stored procedure.
            oDatabaseHelper.AddParameter("@Fax", _fax);
            // Pass the value of '_homePhone' as parameter 'HomePhone' of the stored procedure.
            oDatabaseHelper.AddParameter("@HomePhone", _homePhone);
            oDatabaseHelper.AddParameter("@City", _cityNonDefault);
            // Pass the value of '_state' as parameter 'State' of the stored procedure.
            oDatabaseHelper.AddParameter("@State", _stateNonDefault);
            // Pass the value of '_country' as parameter 'Country' of the stored procedure.
            oDatabaseHelper.AddParameter("@Country", _countryNonDefault);
            // Pass the value of '_postalCode' as parameter 'PostalCode' of the stored procedure.
            oDatabaseHelper.AddParameter("@PostalCode", _postalCodeNonDefault);
            // Pass the value of '_emailAddress' as parameter 'EmailAddress' of the stored procedure.
            oDatabaseHelper.AddParameter("@EmailAddress", _emailAddressNonDefault);

            // Pass the value of '_listTab' as parameter 'ListTab' of the stored procedure.
            oDatabaseHelper.AddParameter("@ListTab", _listTabNonDefault);
            // Pass the value of '_campaignTab' as parameter 'CampaignTab' of the stored procedure.
            oDatabaseHelper.AddParameter("@CampaignTab", _campaignTabNonDefault);
            // Pass the value of '_advancedTab' as parameter 'AdvancedTab' of the stored procedure.
            oDatabaseHelper.AddParameter("@AdvancedTab", _advancedTabNonDefault);
            // Pass the value of '_reportsTab' as parameter 'ReportsTab' of the stored procedure.
            oDatabaseHelper.AddParameter("@ReportsTab", _reportsTabNonDefault);
            // Pass the value of '_campaignReportsTab' as parameter 'CampaignReportsTab' of the stored procedure.
            oDatabaseHelper.AddParameter("@CampaignReportsTab", _campaignReportsTabNonDefault);

            // Pass the value of '_logo' as parameter 'Logo' of the stored procedure.
            oDatabaseHelper.AddParameter("@Logo", _logoNonDefault);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            if(!getBackValues )
            {
                oDatabaseHelper.ExecuteScalar("sp_UserInfo_Insert_WithDefaultValues", ref ExecutionState);
            }
            else
            {
                IDataReader dr=oDatabaseHelper.ExecuteReader("sp_UserInfo_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
                if (dr.Read())
                {
                    PopulateObjectFromReader(this,dr);
                }
                dr.Close();
            }
            oDatabaseHelper.Dispose();
            return ExecutionState;
        }
Exemplo n.º 15
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        /// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
        /// <returns>True if succeeded</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			1/27/2010 1:13:46 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public bool InsertWithDefaultValues(bool getBackValues)
        {
            bool ExecutionState = false;
            oDatabaseHelper = new DatabaseHelper(ConnectionString);

            // Pass the value of '_contactId' as parameter 'ContactId' of the stored procedure.
            oDatabaseHelper.AddParameter("@ContactId", _contactIdNonDefault);
            // Pass the value of '_importJobID' as parameter 'ImportJobID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ImportJobID", _importJobIDNonDefault);
            // Pass the value of '_emailAddress' as parameter 'EmailAddress' of the stored procedure.
            oDatabaseHelper.AddParameter("@EmailAddress", _emailAddressNonDefault);
            // Pass the value of '_firstName' as parameter 'FirstName' of the stored procedure.
            oDatabaseHelper.AddParameter("@FirstName", _firstNameNonDefault);
            // Pass the value of '_lastName' as parameter 'LastName' of the stored procedure.
            oDatabaseHelper.AddParameter("@LastName", _lastNameNonDefault);
            // Pass the value of '_address1' as parameter 'Address1' of the stored procedure.
            oDatabaseHelper.AddParameter("@Address1", _address1NonDefault);
            // Pass the value of '_address2' as parameter 'Address2' of the stored procedure.
            oDatabaseHelper.AddParameter("@Address2", _address2NonDefault);
            // Pass the value of '_createdDate' as parameter 'CreatedDate' of the stored procedure.
            oDatabaseHelper.AddParameter("@CreatedDate", _createdDateNonDefault);
            // Pass the value of '_modifiedDate' as parameter 'ModifiedDate' of the stored procedure.
            oDatabaseHelper.AddParameter("@ModifiedDate", _modifiedDateNonDefault);
            // Pass the value of '_createdBy' as parameter 'CreatedBy' of the stored procedure.
            oDatabaseHelper.AddParameter("@CreatedBy", _createdByNonDefault);
            // Pass the value of '_modifiedBy' as parameter 'ModifiedBy' of the stored procedure.
            oDatabaseHelper.AddParameter("@ModifiedBy", _modifiedByNonDefault);
            // Pass the value of '_clientId' as parameter 'ClientId' of the stored procedure.
            oDatabaseHelper.AddParameter("@ClientId", _clientIdNonDefault);
            // Pass the value of '_active' as parameter 'Active' of the stored procedure.
            oDatabaseHelper.AddParameter("@Active", _activeNonDefault);
            // Pass the value of '_makeVerified' as parameter 'MakeVerified' of the stored procedure.
            oDatabaseHelper.AddParameter("@MakeVerified", _makeVerifiedNonDefault);
            // Pass the value of '_customField1' as parameter 'CustomField1' of the stored procedure.
            oDatabaseHelper.AddParameter("@CustomField1", _customField1NonDefault);
            // Pass the value of '_customField2' as parameter 'CustomField2' of the stored procedure.
            oDatabaseHelper.AddParameter("@CustomField2", _customField2NonDefault);
            // Pass the value of '_customField3' as parameter 'CustomField3' of the stored procedure.
            oDatabaseHelper.AddParameter("@CustomField3", _customField3NonDefault);
            // Pass the value of '_customField4' as parameter 'CustomField4' of the stored procedure.
            oDatabaseHelper.AddParameter("@CustomField4", _customField4NonDefault);
            // Pass the value of '_customField5' as parameter 'CustomField5' of the stored procedure.
            oDatabaseHelper.AddParameter("@CustomField5", _customField5NonDefault);
            // Pass the value of '_customField6' as parameter 'CustomField6' of the stored procedure.
            oDatabaseHelper.AddParameter("@CustomField6", _customField6NonDefault);
            // Pass the value of '_customField7' as parameter 'CustomField7' of the stored procedure.
            oDatabaseHelper.AddParameter("@CustomField7", _customField7NonDefault);
            // Pass the value of '_customField8' as parameter 'CustomField8' of the stored procedure.
            oDatabaseHelper.AddParameter("@CustomField8", _customField8NonDefault);
            // Pass the value of '_customField9' as parameter 'CustomField9' of the stored procedure.
            oDatabaseHelper.AddParameter("@CustomField9", _customField9NonDefault);
            // Pass the value of '_customField10' as parameter 'CustomField10' of the stored procedure.
            oDatabaseHelper.AddParameter("@CustomField10", _customField10NonDefault);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            if(!getBackValues )
            {
                oDatabaseHelper.ExecuteScalar("sp_ContactMasterTemp_Insert_WithDefaultValues", ref ExecutionState);
            }
            else
            {
                IDataReader dr=oDatabaseHelper.ExecuteReader("sp_ContactMasterTemp_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
                if (dr.Read())
                {
                    PopulateObjectFromReader(this,dr,ConnectionString);
                }
                dr.Close();
            }
            oDatabaseHelper.Dispose();
            return ExecutionState;
        }
Exemplo n.º 16
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        /// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
        /// <returns>True if succeeded</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/17/2012 12:22:55 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public bool InsertWithDefaultValues(bool getBackValues)
        {
            bool ExecutionState = false;
            oDatabaseHelper = new DatabaseHelper();

            // Pass the value of '_mailingID' as parameter 'MailingID' of the stored procedure.
            oDatabaseHelper.AddParameter("@MailingID", _mailingIDNonDefault);
            // Pass the value of '_approvalMail' as parameter 'ApprovalMail' of the stored procedure.
            oDatabaseHelper.AddParameter("@ApprovalMail", _approvalMailNonDefault);
            // Pass the value of '_reportMailTo' as parameter 'ReportMailTo' of the stored procedure.
            oDatabaseHelper.AddParameter("@ReportMailTo", _reportMailToNonDefault);
            // Pass the value of '_approvalStatus' as parameter 'ApprovalStatus' of the stored procedure.
            oDatabaseHelper.AddParameter("@ApprovalStatus", _approvalStatusNonDefault);
            // Pass the value of '_approvedDate' as parameter 'ApprovedDate' of the stored procedure.
            oDatabaseHelper.AddParameter("@ApprovedDate", _approvedDateNonDefault);
            // Pass the value of '_isApprovalSent' as parameter 'IsApprovalSent' of the stored procedure.
            oDatabaseHelper.AddParameter("@IsApprovalSent", _isApprovalSentNonDefault);
            // Pass the value of '_isReportMailied' as parameter 'IsReportMailied' of the stored procedure.
            oDatabaseHelper.AddParameter("@IsReportMailied", _isReportMailiedNonDefault);
            // Pass the value of '_reportSentDate' as parameter 'ReportSentDate' of the stored procedure.
            oDatabaseHelper.AddParameter("@ReportSentDate", _reportSentDateNonDefault);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            if(!getBackValues )
            {
                oDatabaseHelper.ExecuteScalar("sp_MailApproval_Insert_WithDefaultValues", ref ExecutionState);
            }
            else
            {
                IDataReader dr=oDatabaseHelper.ExecuteReader("sp_MailApproval_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
                if (dr.Read())
                {
                    PopulateObjectFromReader(this,dr);
                }
                dr.Close();
            }
            oDatabaseHelper.Dispose();
            return ExecutionState;
        }
Exemplo n.º 17
0
        //This method is used to retrieve the ListContactMaster details based on listID and ContactID
        public static ListContactMasters SelectAllByListIDAndContactID(Int64 listMasterID, Int64 contactID, string ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            // Pass the specified field and its value to the stored procedure.
            oDatabaseHelper.AddParameter("@ListMasterID", listMasterID);
            oDatabaseHelper.AddParameter("@ContactId", contactID);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr = oDatabaseHelper.ExecuteReader("sp_ListContactMaster_SelectAllByListIDAndContactID", ref ExecutionState);
            ListContactMasters ListContactMasters = PopulateObjectsFromReader(dr, ConnectionString);
            dr.Close();
            oDatabaseHelper.Dispose();
            return ListContactMasters;
        }
Exemplo n.º 18
0
        public static CampaignJobs SelectSingleByToday(int CampaignId, string ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@CampaignId", CampaignId);

            IDataReader dr = oDatabaseHelper.ExecuteReader("sp_CampaignJob_SelectAll_ByToday_Single", ref ExecutionState);
            CampaignJobs CampaignJobs = PopulateObjectsFromReader(dr, ConnectionString);
            dr.Close();
            oDatabaseHelper.Dispose();
            return CampaignJobs;
        }
Exemplo n.º 19
0
        /// <summary>
        /// This method will return a list of objects representing all records in the table.
        /// </summary>
        ///
        /// <returns>list of objects of class AdvancedFieldMap in the form of object of AdvancedFieldMaps </returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			7/4/2012 2:40:13 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static AdvancedFieldMaps SelectAll()
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;

            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr=oDatabaseHelper.ExecuteReader("sp_AdvancedFieldMap_SelectAll", ref ExecutionState);
            AdvancedFieldMaps AdvancedFieldMaps = PopulateObjectsFromReader(dr);
            dr.Close();
            oDatabaseHelper.Dispose();
            return AdvancedFieldMaps;
        }
Exemplo n.º 20
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        /// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
        /// <returns>True if succeeded</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			4/12/2012 11:16:28 AM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public bool InsertWithDefaultValues(bool getBackValues)
        {
            bool ExecutionState = false;
            oDatabaseHelper = new DatabaseHelper();

            // Pass the value of '_complaintID' as parameter 'ComplaintID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ComplaintID", _complaintIDNonDefault);
            // Pass the value of '_contactID' as parameter 'ContactID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ContactID", _contactIDNonDefault);
            // Pass the value of '_bounceCategory' as parameter 'BounceCategory' of the stored procedure.
            oDatabaseHelper.AddParameter("@BounceCategory", _bounceCategoryNonDefault);
            // Pass the value of '_campaignID' as parameter 'CampaignID' of the stored procedure.
            oDatabaseHelper.AddParameter("@CampaignID", _campaignIDNonDefault);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            if(!getBackValues )
            {
                oDatabaseHelper.ExecuteScalar("sp_MailComplaints_Insert_WithDefaultValues", ref ExecutionState);
            }
            else
            {
                IDataReader dr=oDatabaseHelper.ExecuteReader("sp_MailComplaints_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
                if (dr.Read())
                {
                    PopulateObjectFromReader(this,dr);
                }
                dr.Close();
            }
            oDatabaseHelper.Dispose();
            return ExecutionState;
        }
Exemplo n.º 21
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        /// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
        /// <returns>True if succeeded</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			7/31/2012 02:55:35 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public bool InsertWithDefaultValues(bool getBackValues)
        {
            bool ExecutionState = false;
            oDatabaseHelper = new DatabaseHelper();

            // Pass the value of '_id' as parameter 'ID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ID", _idNonDefault);
            // Pass the value of '_campaignId' as parameter 'CampaignId' of the stored procedure.
            oDatabaseHelper.AddParameter("@CampaignId", _campaignIdNonDefault);
            // Pass the value of '_listMasterID' as parameter 'ListMasterID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ListMasterID", _listMasterIDNonDefault);
            // Pass the value of '_contactId' as parameter 'ContactId' of the stored procedure.
            oDatabaseHelper.AddParameter("@ContactId", _contactIdNonDefault);
            // Pass the value of '_supressedDomain' as parameter 'SupressedDomain' of the stored procedure.
            oDatabaseHelper.AddParameter("@SupressedDomain", _supressedDomainNonDefault);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            if(!getBackValues )
            {
                oDatabaseHelper.ExecuteScalar("sp_DomineSupress_Insert_WithDefaultValues", ref ExecutionState);
            }
            else
            {
                IDataReader dr=oDatabaseHelper.ExecuteReader("sp_DomineSupress_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
                if (dr.Read())
                {
                    PopulateObjectFromReader(this,dr);
                }
                dr.Close();
            }
            oDatabaseHelper.Dispose();
            return ExecutionState;
        }
Exemplo n.º 22
0
        /// <summary>
        /// This method will get row(s) from the database using the value of the field specified 
        /// along with the details of the child table.
        /// </summary>
        ///
        /// <param name="pk" type="ContactMasterPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class EmailOpenDetails</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			1/8/2010 12:24:52 PM				Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static EmailOpenDetails SelectAllByForeignKeyFromContactMaster(ContactMasterPrimaryKey pk, String ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;
            EmailOpenDetails obj = null;

            // Pass the values of all key parameters to the stored procedure.
            System.Collections.Specialized.NameValueCollection nvc = pk.GetKeysAndValues();
            foreach (string key in nvc.Keys)
            {
                oDatabaseHelper.AddParameter("@" + key,nvc[key] );
            }

            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr=oDatabaseHelper.ExecuteReader("sp_EmailOpenDetails_SelectAllByForeignKeyContactMaster", ref ExecutionState);
            obj = new EmailOpenDetails();
            obj = EmailOpenDetail.PopulateObjectsFromReaderWithCheckingReader(dr, oDatabaseHelper,ConnectionString);

            dr.Close();
            oDatabaseHelper.Dispose();
            return obj;
        }
Exemplo n.º 23
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        /// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
        /// <returns>True if succeeded</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			2/3/2010 4:14:00 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public bool InsertWithDefaultValues(bool getBackValues)
        {
            bool ExecutionState = false;
            oDatabaseHelper = new DatabaseHelper(ConnectionString);

            // Pass the value of '_id' as parameter 'ID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ID", _idNonDefault);
            // Pass the value of '_campaignMasterID' as parameter 'CampaignMasterID' of the stored procedure.
            oDatabaseHelper.AddParameter("@CampaignMasterID", _campaignMasterIDNonDefault);
            // Pass the value of '_scheduledDatetime' as parameter 'ScheduledDatetime' of the stored procedure.
            oDatabaseHelper.AddParameter("@ScheduledDatetime", _scheduledDatetimeNonDefault);
            // Pass the value of '_createdDatetime' as parameter 'CreatedDatetime' of the stored procedure.
            oDatabaseHelper.AddParameter("@CreatedDatetime", _createdDatetimeNonDefault);
            // Pass the value of '_status' as parameter 'Status' of the stored procedure.
            oDatabaseHelper.AddParameter("@Status", _statusNonDefault);
            // Pass the value of '_statusMessage' as parameter 'StatusMessage' of the stored procedure.
            oDatabaseHelper.AddParameter("@StatusMessage", _statusMessageNonDefault);
            // Pass the value of '_deliveredCount' as parameter 'DeliveredCount' of the stored procedure.
            oDatabaseHelper.AddParameter("@DeliveredCount", _deliveredCountNonDefault);
            // Pass the value of '_openCount' as parameter 'OpenCount' of the stored procedure.
            oDatabaseHelper.AddParameter("@OpenCount", _openCountNonDefault);
            // Pass the value of '_clickCount' as parameter 'ClickCount' of the stored procedure.
            oDatabaseHelper.AddParameter("@ClickCount", _clickCountNonDefault);
            // Pass the value of '_bounceCount' as parameter 'BounceCount' of the stored procedure.
            oDatabaseHelper.AddParameter("@BounceCount", _bounceCountNonDefault);
            // Pass the value of '_optoutCount' as parameter 'OptoutCount' of the stored procedure.
            oDatabaseHelper.AddParameter("@OptoutCount", _optoutCountNonDefault);
            // Pass the value of '_sendType' as parameter 'SendType' of the stored procedure.
            oDatabaseHelper.AddParameter("@SendType", _sendTypeNonDefault);
            // Pass the value of '_totalRecipients' as parameter 'TotalRecipients' of the stored procedure.
            oDatabaseHelper.AddParameter("@TotalRecipients", _totalRecipientsNonDefault);
            // Pass the value of '_unSubscribeCount' as parameter 'UnSubscribeCount' of the stored procedure.
            oDatabaseHelper.AddParameter("@UnSubscribeCount", _unSubscribeCountNonDefault);
            // Pass the value of '_startTime' as parameter 'StartTime' of the stored procedure.
            oDatabaseHelper.AddParameter("@StartTime", _startTimeNonDefault);
            // Pass the value of '_completionTime' as parameter 'CompletionTime' of the stored procedure.
            oDatabaseHelper.AddParameter("@CompletionTime", _completionTimeNonDefault);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            if(!getBackValues )
            {
                oDatabaseHelper.ExecuteScalar("sp_CampaignJob_Insert_WithDefaultValues", ref ExecutionState);
            }
            else
            {
                IDataReader dr=oDatabaseHelper.ExecuteReader("sp_CampaignJob_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
                if (dr.Read())
                {
                    PopulateObjectFromReader(this,dr);
                }
                dr.Close();
            }
            oDatabaseHelper.Dispose();
            return ExecutionState;
        }
Exemplo n.º 24
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="EmailOpenDetailPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class EmailOpenDetail</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			1/8/2010 12:24:52 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static EmailOpenDetail SelectOne(EmailOpenDetailPrimaryKey pk, String ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            // Pass the values of all key parameters to the stored procedure.
            System.Collections.Specialized.NameValueCollection nvc = pk.GetKeysAndValues();
            foreach (string key in nvc.Keys)
            {
                oDatabaseHelper.AddParameter("@" + key,nvc[key] );
            }
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr=oDatabaseHelper.ExecuteReader("sp_EmailOpenDetails_SelectbyPrimaryKey", ref ExecutionState);
            if (dr.Read())
            {
                EmailOpenDetail obj=new EmailOpenDetail(ConnectionString);
                PopulateObjectFromReader(obj,dr);
                dr.Close();
                oDatabaseHelper.Dispose();
                return obj;
            }
            else
            {
                dr.Close();
                oDatabaseHelper.Dispose();
                return null;
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// This method will return a list of objects representing all records in the table.
        /// </summary>
        ///
        /// <returns>list of objects of class EmailOpenDetail in the form of object of EmailOpenDetails </returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			1/8/2010 12:24:52 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static EmailOpenDetails SelectAll(String ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr=oDatabaseHelper.ExecuteReader("sp_EmailOpenDetails_SelectAll", ref ExecutionState);
            EmailOpenDetails EmailOpenDetails = PopulateObjectsFromReader(dr,ConnectionString);
            dr.Close();
            oDatabaseHelper.Dispose();
            return EmailOpenDetails;
        }
Exemplo n.º 26
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        /// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
        /// <returns>True if succeeded</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			11/29/2012 12:32:23 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public bool InsertWithDefaultValues(bool getBackValues)
        {
            bool ExecutionState = false;
            oDatabaseHelper = new DatabaseHelper();

            // Pass the value of '_id' as parameter 'ID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ID", _idNonDefault);
            // Pass the value of '_linkID' as parameter 'LinkID' of the stored procedure.
            oDatabaseHelper.AddParameter("@LinkID", _linkIDNonDefault);
            // Pass the value of '_mailingID' as parameter 'MailingID' of the stored procedure.
            oDatabaseHelper.AddParameter("@MailingID", _mailingIDNonDefault);
            // Pass the value of '_contactID' as parameter 'ContactID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ContactID", _contactIDNonDefault);
            // Pass the value of '_ditectMail' as parameter 'DirectMail' of the stored procedure.
            oDatabaseHelper.AddParameter("@DirectMail", _ditectMailNonDefault);
            // Pass the value of '_submitDate' as parameter 'SubmitDate' of the stored procedure.
            oDatabaseHelper.AddParameter("@SubmitDate", _submitDateNonDefault);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            if(!getBackValues )
            {
                oDatabaseHelper.ExecuteScalar("sp_FormSubmitClicks_Insert_WithDefaultValues", ref ExecutionState);
            }
            else
            {
                IDataReader dr=oDatabaseHelper.ExecuteReader("sp_FormSubmitClicks_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
                if (dr.Read())
                {
                    PopulateObjectFromReader(this,dr);
                }
                dr.Close();
            }
            oDatabaseHelper.Dispose();
            return ExecutionState;
        }
Exemplo n.º 27
0
        /// <summary>
        /// This method will get row(s) from the database using the value of the field specified
        /// </summary>
        ///
        /// <param name="field" type="string">Field of the class EmailOpenDetail</param>
        /// <param name="fieldValue" type="object">Value for the field specified.</param>
        ///
        /// <returns>List of object of class EmailOpenDetail in the form of an object of class EmailOpenDetails</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			1/8/2010 12:24:52 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static EmailOpenDetails SelectByField(string field, object fieldValue, String ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            // Pass the specified field and its value to the stored procedure.
            oDatabaseHelper.AddParameter("@Field",field);
            oDatabaseHelper.AddParameter("@Value", fieldValue );
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr=oDatabaseHelper.ExecuteReader("sp_EmailOpenDetails_SelectByField", ref ExecutionState);
            EmailOpenDetails EmailOpenDetails = PopulateObjectsFromReader(dr,ConnectionString);
            dr.Close();
            oDatabaseHelper.Dispose();
            return EmailOpenDetails;
        }
Exemplo n.º 28
0
        /// <summary>
        /// This method will get row(s) from the database using the value of the field specified 
        /// along with the details of the child table.
        /// </summary>
        ///
        /// <param name="pk" type="TemplateMasterPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class TemplateMaster</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			11/24/2009 12:37:33 PM				Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static TemplateMaster SelectOneWithCampaignMasterUsingTemplateId(TemplateMasterPrimaryKey pk, string ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;
            TemplateMaster obj=null;

            // Pass the values of all key parameters to the stored procedure.
            System.Collections.Specialized.NameValueCollection nvc = pk.GetKeysAndValues();
            foreach (string key in nvc.Keys)
            {
                oDatabaseHelper.AddParameter("@" + key,nvc[key] );
            }

            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr=oDatabaseHelper.ExecuteReader("sp_TemplateMaster_SelectOneWithCampaignMasterUsingTemplateId", ref ExecutionState);
            if (dr.Read())
            {
                obj= new TemplateMaster(ConnectionString);
                PopulateObjectFromReader(obj,dr);

                dr.NextResult();

                //Get the child records.
                obj.CampaignMasters=CampaignMaster.PopulateObjectsFromReader(dr,ConnectionString);
            }
            dr.Close();
            oDatabaseHelper.Dispose();
            return obj;
        }
Exemplo n.º 29
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        /// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
        /// <returns>True if succeeded</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			1/8/2010 12:24:52 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public bool InsertWithDefaultValues(bool getBackValues)
        {
            bool ExecutionState = false;
            oDatabaseHelper = new DatabaseHelper(ConnectionString);

            // Pass the value of '_id' as parameter 'ID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ID", _idNonDefault);
            // Pass the value of '_campaignID' as parameter 'CampaignID' of the stored procedure.
            oDatabaseHelper.AddParameter("@CampaignID", _campaignIDNonDefault);
            // Pass the value of '_contactID' as parameter 'ContactID' of the stored procedure.
            oDatabaseHelper.AddParameter("@ContactID", _contactIDNonDefault);
            // Pass the value of '_openedDate' as parameter 'OpenedDate' of the stored procedure.
            oDatabaseHelper.AddParameter("@OpenedDate", _openedDateNonDefault);
            // Pass the value of '_iPAddress' as parameter 'IPAddress' of the stored procedure.
            oDatabaseHelper.AddParameter("@IPAddress", _iPAddressNonDefault);
            // Pass the value of '_userAgent' as parameter 'UserAgent' of the stored procedure.
            oDatabaseHelper.AddParameter("@UserAgent", _userAgentNonDefault);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            if(!getBackValues )
            {
                oDatabaseHelper.ExecuteScalar("sp_EmailOpenDetails_Insert_WithDefaultValues", ref ExecutionState);
            }
            else
            {
                IDataReader dr=oDatabaseHelper.ExecuteReader("sp_EmailOpenDetails_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
                if (dr.Read())
                {
                    PopulateObjectFromReader(this,dr);
                }
                dr.Close();
            }
            oDatabaseHelper.Dispose();
            return ExecutionState;
        }
Exemplo n.º 30
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        /// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
        /// <returns>True if succeeded</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			11/24/2009 12:37:33 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public bool InsertWithDefaultValues(bool getBackValues)
        {
            bool ExecutionState = false;
            oDatabaseHelper = new DatabaseHelper(ConnectionString);

            // Pass the value of '_templateId' as parameter 'TemplateId' of the stored procedure.
            oDatabaseHelper.AddParameter("@TemplateId", _templateIdNonDefault);
            // Pass the value of '_templateName' as parameter 'TemplateName' of the stored procedure.
            oDatabaseHelper.AddParameter("@TemplateName", _templateNameNonDefault);
            // Pass the value of '_templateDescription' as parameter 'TemplateDescription' of the stored procedure.
            oDatabaseHelper.AddParameter("@TemplateDescription", _templateDescriptionNonDefault);
            // Pass the value of '_clientId' as parameter 'ClientId' of the stored procedure.
            oDatabaseHelper.AddParameter("@ClientId", _clientIdNonDefault);
            // Pass the value of '_hTMLContent' as parameter 'HTMLContent' of the stored procedure.
            oDatabaseHelper.AddParameter("@HTMLContent", _hTMLContentNonDefault);
            // Pass the value of '_textContent' as parameter 'TextContent' of the stored procedure.
            oDatabaseHelper.AddParameter("@TextContent", _textContentNonDefault);
            // Pass the value of '_modifiedBy' as parameter 'ModifiedBy' of the stored procedure.
            oDatabaseHelper.AddParameter("@ModifiedBy", _modifiedByNonDefault);
            // Pass the value of '_modifiedDate' as parameter 'ModifiedDate' of the stored procedure.
            oDatabaseHelper.AddParameter("@ModifiedDate", _modifiedDateNonDefault);
            // Pass the value of '_createdDate' as parameter 'CreatedDate' of the stored procedure.
            oDatabaseHelper.AddParameter("@CreatedDate", _createdDateNonDefault);
            // Pass the value of '_createdBy' as parameter 'CreatedBy' of the stored procedure.
            oDatabaseHelper.AddParameter("@CreatedBy", _createdByNonDefault);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

            if(!getBackValues )
            {
                oDatabaseHelper.ExecuteScalar("sp_TemplateMaster_Insert_WithDefaultValues", ref ExecutionState);
            }
            else
            {
                IDataReader dr=oDatabaseHelper.ExecuteReader("sp_TemplateMaster_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
                if (dr.Read())
                {
                    PopulateObjectFromReader(this,dr);
                }
                dr.Close();
            }
            oDatabaseHelper.Dispose();
            return ExecutionState;
        }