Esempio 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;
        }
Esempio n. 2
0
 public static DataTable SearchDomainLookup(string ConnectionString, string Domain, string ListIds)
 {
     try
     {
         using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
         {
             bool ExecutionState = false;
             //StringBuilder whereCondition = new StringBuilder();
             //Domain = Domain.Replace("'", "''");
             //Domain = Domain.Replace("%", "[%]");
             //Domain = Domain.Replace("_", "[_]");
             //if (!string.IsNullOrEmpty(Domain))
             //{
             //    if (whereCondition.Length > 0)
             //        whereCondition.Append(" OR %" + Domain + "%");
             //    else whereCondition.Append(" %" + Domain + "%");
             //}
             //if (whereCondition.Length == 0)
             //{
             //    whereCondition.Append("1=1");
             //}
             string whereCondition = "%" + Domain + "%";
             oDatabaseHelper.AddParameter("@ListIDs", ListIds.ToString());
             oDatabaseHelper.AddParameter("@whereCondition", whereCondition.ToString());
             DataSet dataSet = oDatabaseHelper.ExecuteDataSet("sp_ListMaster_SearchDomainName", ref ExecutionState);
             return dataSet.Tables[0];
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 3
0
 public static DataTable getSegmentDetails(long segmentId, string ConnectionString)
 {
     DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
     bool ExecutionState = false;
     oDatabaseHelper.AddParameter("@SegmentID", segmentId);
     oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);
     DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_SegmentMaster_GetSegmentDetails", ref ExecutionState);
     oDatabaseHelper.Dispose();
     return ds.Tables[0];
 }
        public static DataTable SelectAllTemplateNames(string ConnectionString, int CategoryID)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

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

            DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_CategoryTemplateMaster_SelectAllTemplateNames", ref ExecutionState);
            oDatabaseHelper.Dispose();
            return ds.Tables[0];
        }
Esempio n. 5
0
 public static DataTable GetUnSubDetailsByContactId(string ConnectionString, string ContactID, string EmailID)
 {
     DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
     bool ExecutionState = false;
     // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
     oDatabaseHelper.AddParameter("@ContactID", ContactID);
     if (EmailID != string.Empty)
         oDatabaseHelper.AddParameter("@EmailId", EmailID);
     else
         oDatabaseHelper.AddParameter("@EmailId", DBNull.Value);
     oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);
     DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_GetGlobalUnSubscribeDetails_ByContactId", ref ExecutionState);
     oDatabaseHelper.Dispose();
     return ds.Tables[0];
 }
Esempio n. 6
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;
        }
Esempio n. 7
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;
        }
Esempio n. 8
0
 public static DataTable BindAllContactsTargetedByAssignCamp_Unsub_Search(string where, string ConnectionString, string CampignID, string orderby, string dir, int pageIndex, int pageSize, out int Count)
 {
     try
     {
         using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
         {
             bool ExecutionState = false;
             oDatabaseHelper.AddParameter("@whereCondition", where);
             oDatabaseHelper.AddParameter("@AssignedCampaignID", CampignID);
             oDatabaseHelper.AddParameter("@orderby", orderby);
             oDatabaseHelper.AddParameter("@dir", dir);
             oDatabaseHelper.AddParameter("@PageIndex", pageIndex);
             oDatabaseHelper.AddParameter("@PageSize", pageSize);
             oDatabaseHelper.AddParameter("@Count", -1, System.Data.ParameterDirection.Output);
             DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_ListContactMaster_ShowContactsTargetedWithAssignCampaignID_Pagewise_Search", ref ExecutionState);
             Count = Convert.ToInt32(oDatabaseHelper.Command.Parameters["@Count"].Value);
             oDatabaseHelper.Dispose();
             return ds.Tables[0];
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 9
0
 public static DataTable GetContactStatusByEmailIdsWithActiveStatus(string ConnectionString, DataTable tblEmailAddress)
 {
     DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
     bool ExecutionState = false;
     oDatabaseHelper.AddParameter("@TableEmailIds", tblEmailAddress);
     DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_SelectContactStatusByEmailId_Active", ref ExecutionState);
     oDatabaseHelper.Dispose();
     return ds.Tables[0];
 }
Esempio n. 10
0
 public static DataTable GetAllBounceAndUnsubDetailsByType(string ConnectionString, string Type)
 {
     DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
     bool ExecutionState = false;
     oDatabaseHelper.AddParameter("@Type", Type);
     DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_GetAllBounceAndUnsubRecipientsByType", ref ExecutionState);
     oDatabaseHelper.Dispose();
     return ds.Tables[0];
 }
Esempio n. 11
0
        public static bool ChangeContactStatusByList(long contactID, bool status, string ConnectionString)
        {
            try
            {
                using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
                {
                    bool ExecutionState = false;
                    oDatabaseHelper.AddParameter("@ContactID", contactID);
                    oDatabaseHelper.AddParameter("@Status", status);
                    oDatabaseHelper.ExecuteNonQuery("sp_ListContactMaster_ChangeContactStatus", ref ExecutionState);

                }
                return true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 12
0
 public static DataTable GetAllRecipientsByListMasterIds(StringBuilder strbSelectedLists, 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("@listids", strbSelectedLists.ToString());
     DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_GetAllRecipientsByListMasterIds", ref ExecutionState);
     oDatabaseHelper.Dispose();
     return ds.Tables[0];
 }
        public void insertEmailOpenedDetails(Int64 contactID, Int64 campaignID, string ipAddress, string userAgent)
        {
            try
            {
                using (DatabaseHelper oDatabaseHelper = new DatabaseHelper())
                {
                    bool ExecutionState = false;
                    oDatabaseHelper.AddParameter("@ContactID", contactID);
                    oDatabaseHelper.AddParameter("@CampaignID", campaignID);
                    oDatabaseHelper.AddParameter("@IPAddress", ipAddress);
                    oDatabaseHelper.AddParameter("@UserAgent", userAgent);
                    int IsSuccess = oDatabaseHelper.ExecuteNonQuery("sp_EmailOpenDetails_CustomProc", ref ExecutionState);

                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 14
0
 public DataTable getAllMailingLinkUrls(String ConnectionString, string MailingName, string orderby, string dir)
 {
     try
     {
         using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
         {
             bool ExecutionState = false;
             oDatabaseHelper.AddParameter("@MailingName", MailingName);
             oDatabaseHelper.AddParameter("@orderby", orderby);
             oDatabaseHelper.AddParameter("@dir", dir);
             DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_ContactMaster_GetLinkURLsByCampName_AMMRpt", ref ExecutionState);
             oDatabaseHelper.Dispose();
             return ds.Tables[0];
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 15
0
        public static DataTable AdvanceSearchSelectLookup(string ConnectionString, string ListName)
        {
            try
            {
                using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
                {
                    bool ExecutionState = false;

                    StringBuilder whereCondition = new StringBuilder();

                    ListName = ListName.Replace("'", "''");

                    ListName = ListName.Replace("%", "[%]");
                    ListName = ListName.Replace("_", "[_]");

                    if (!string.IsNullOrEmpty(ListName))
                    {
                        if (whereCondition.Length > 0)
                            whereCondition.Append(" OR ListName LIKE '%" + ListName + "%'");
                        else whereCondition.Append(" ListName LIKE '%" + ListName + "%'");
                    }

                    if (whereCondition.Length == 0)
                    {
                        whereCondition.Append("1=1");
                    }

                    oDatabaseHelper.AddParameter("@whereCondition", whereCondition.ToString());

                    oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);

                    DataSet dataSet = oDatabaseHelper.ExecuteDataSet("sp_AdvanceListMaster_SearchSelectNew", ref ExecutionState);
                    return dataSet.Tables[0];

                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 16
0
        public int SelectEmailCount(string ClientName, string ConnectionString)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
            bool ExecutionState = false;

            oDatabaseHelper.AddParameter("@ClientName", ClientName);

            DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_Material_GetTierSizeByClient", ref ExecutionState);

            //we get only single column and row value in this so return single value
            return Convert.ToInt32(ds.Tables[0].Rows[0][0]);
        }
Esempio n. 17
0
        public DataTable getCustomLabel(Int64 TemplateID, Int64 CampaignID)
        {
            try
            {
                using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
                {

                    bool ExecutionState = false;
                    oDatabaseHelper.AddParameter("@CampaignID", CampaignID.ToString());
                    oDatabaseHelper.AddParameter("@TemplateID", TemplateID.ToString());

                    DataSet dataSet =
                        oDatabaseHelper.ExecuteDataSet("sp_GetCustomLabel", ref ExecutionState);
                    return dataSet.Tables[0];

                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 18
0
        //prashanth
        //Insertion of Links and returning the PK after insertion.
        public int InsertandReturnPrimaryKey()
        {
            bool ExecutionState = false;
            DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);

            // Pass the value of '_linkURL' as parameter 'LinkURL' of the stored procedure.
            oDatabaseHelper.AddParameter("@LinkURL", this.LinkURL);
            // Pass the value of '_linkName' as parameter 'LinkName' of the stored procedure.
            oDatabaseHelper.AddParameter("@LinkName", this.LinkName);
            // Pass the value of '_recordClicks' as parameter 'RecordClicks' of the stored procedure.
            oDatabaseHelper.AddParameter("@RecordClicks", this.RecordClicks);
            // The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);
            // The parameter '@LinkDetailID' will contain the LinkDetailID after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@LinkDetailID", -1, System.Data.ParameterDirection.Output);

            oDatabaseHelper.ExecuteScalar("sp_LinkDetails_InsertandReturnPrimarykey", ref ExecutionState);//ExecuteNonQuery("sp_ContactMaster_InsertandReturnPrimarykey", ref ExecutionState);
            int intLinkDetailID = (int)oDatabaseHelper.GetParameterValue("@LinkDetailID");
            oDatabaseHelper.Dispose();

            return intLinkDetailID;
        }
Esempio n. 19
0
 public DataTable getAllCountsOfCampaignsWithFilePagewise(String ConnectionString, string orderby, string dir, int pageIndex, int pageSize, out int count)
 {
     try
     {
         using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
         {
             bool ExecutionState = false;
             oDatabaseHelper.AddParameter("@orderby", orderby);
             oDatabaseHelper.AddParameter("@dir", dir);
             oDatabaseHelper.AddParameter("@PageIndex", pageIndex);
             oDatabaseHelper.AddParameter("@PageSize", pageSize);
             oDatabaseHelper.AddParameter("@TotalRowsCount", -1, System.Data.ParameterDirection.Output);
             DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_getAllCountsOfCampaignsWithFile_Pagewise", ref ExecutionState);
             count = Convert.ToInt32(oDatabaseHelper.Command.Parameters["@TotalRowsCount"].Value);
             oDatabaseHelper.Dispose();
             return ds.Tables[0];
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 20
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;
        }
Esempio n. 21
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;
        }
Esempio n. 22
0
 //Ganesh on 30nov09
 //This method will insert a new job in CampaignMaster table.
 public int insertAutomationMaster(AutomationMaster objAutomationMaster)
 {
     try
     {
         using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
         {
             bool ExecutionState = false;
             oDatabaseHelper.AddParameter("@CampaignName", objAutomationMaster.CampaignName);
             oDatabaseHelper.AddParameter("@CampaignDescription", objAutomationMaster.CampaignDescription);
             oDatabaseHelper.AddParameter("@FromAddress", objAutomationMaster.FromAddress);
             oDatabaseHelper.AddParameter("@FromName", objAutomationMaster.FromName);
             oDatabaseHelper.AddParameter("@ReplytoAddress", objAutomationMaster.ReplytoAddress);
             oDatabaseHelper.AddParameter("@ReplaytoName", objAutomationMaster.ReplaytoName);
             oDatabaseHelper.AddParameter("@TemplateId", objAutomationMaster.TemplateId);
             oDatabaseHelper.AddParameter("@Subject", objAutomationMaster.Subject);
             oDatabaseHelper.AddParameter("@TrackReads", objAutomationMaster.TrackReads);
             oDatabaseHelper.AddParameter("@SelectCondition", objAutomationMaster.SelectCondition);
             oDatabaseHelper.AddParameter("@HTMLContent", objAutomationMaster.HTMLContent);
             oDatabaseHelper.AddParameter("@TextContent", objAutomationMaster.TextContent);
             oDatabaseHelper.AddParameter("@AutomationScheduledDate", objAutomationMaster.AutomationScheduledDate);
             oDatabaseHelper.AddParameter("@DayOfWeek", objAutomationMaster.DayOfWeek);
             oDatabaseHelper.AddParameter("@ExpAutomationScheduledDate", objAutomationMaster.ExpAutomationScheduledDate);
             oDatabaseHelper.AddParameter("@SuppressDomain", objAutomationMaster.SuppressDomain);
             oDatabaseHelper.AddParameter("@URLText", objAutomationMaster.URLText);
             oDatabaseHelper.AddParameter("@CampaignID", -1, System.Data.ParameterDirection.Output);
             oDatabaseHelper.ExecuteScalar("sp_AutomationMaster_Insert_CustomProc", ref ExecutionState);
             int CampaignID = (int)oDatabaseHelper.GetParameterValue("@CampaignID");
             oDatabaseHelper.Dispose();
             return CampaignID;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 23
0
 public static DataTable getAllSentCampaignsOlderThan90Days(String ConnectionString, string orderby, string dir,int pageIndex, int pageSize, out int count)
 {
     try
     {
         using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
         {
             bool ExecutionState = false;
             //oDatabaseHelper.AddParameter("@status", status);
             oDatabaseHelper.AddParameter("@orderby", orderby);
             oDatabaseHelper.AddParameter("@dir", dir);
             oDatabaseHelper.AddParameter("@PageIndex", pageIndex);
             oDatabaseHelper.AddParameter("@PageSize", pageSize);
             oDatabaseHelper.AddParameter("@Count", -1, System.Data.ParameterDirection.Output);
             DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_CampaignJob_SelectAll_OlderThan90Days", ref ExecutionState);
             count = Convert.ToInt32(oDatabaseHelper.Command.Parameters["@Count"].Value);
             oDatabaseHelper.Dispose();
             return ds.Tables[0];
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public static DataTable SelectAllCategoryNames(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_CategoryTemplateMaster_SelectAllCategoryNames", ref ExecutionState);
            //CategoryTemplateMasters CategoryTemplateMasters = PopulateObjectsFromReader(dr, ConnectionString);
            //dr.Close();
            DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_CategoryTemplateMaster_SelectAllCategoryNames", ref ExecutionState);
            oDatabaseHelper.Dispose();
            return ds.Tables[0];
        }
        public bool DeleteAllContactsFromList(long listId)
        {
            try
            {
                using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
                {
                    bool ExecutionState = false;
                    oDatabaseHelper.AddParameter("@ListID", listId);
                    int IsSuccess = oDatabaseHelper.ExecuteNonQuery("sp_AdvanceListContactMaster_DeleteAllContactsByListId_CustomProc", ref ExecutionState);

                }
                return true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 26
0
        public static DataSet GetTemplatesInDraftByTemplateIds(string TemplateIds, string ConnectionString)
        {
            try
            {
                using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
                {
                    bool ExecutionState = false;
                    oDatabaseHelper.AddParameter("@TemplateIDs", TemplateIds);
                    DataSet dataSet = oDatabaseHelper.ExecuteDataSet("sp_TemplateMaster_ShowTemplatesUsedInDraftMails_CustomProc", ref ExecutionState);
                    return dataSet;
                }
            }
            catch (Exception ex)
            {
                throw ex;

            }
        }
Esempio n. 27
0
 public static DataTable GetAllAdvancedImportContactsPageWise(string ConnectionString, string OrderBy, string sortdir, int pageSize, int pageIndex, out int rowCount)
 {
     DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
     bool ExecutionState = false;
     oDatabaseHelper.AddParameter("@orderby", OrderBy);
     oDatabaseHelper.AddParameter("@dir", sortdir);
     oDatabaseHelper.AddParameter("@PageIndex", pageIndex);
     oDatabaseHelper.AddParameter("@PageSize", pageSize);
     oDatabaseHelper.AddParameter("@Count", -1, System.Data.ParameterDirection.Output);
     oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output);
     DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_RecipienMaster_GetAllContacts_PageWise", ref ExecutionState);
     rowCount = Convert.ToInt32(oDatabaseHelper.Command.Parameters["@Count"].Value);
     oDatabaseHelper.Dispose();
     return ds.Tables[0];
 }
Esempio n. 28
0
 public static DataTable getAllSentCampaignsOlderThan90Days_Search(string ConnectionString, string CampaignName,string orderby, string dir,int pageIndex, int pageSize, out int count)
 {
     try
     {
         using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
         {
             bool ExecutionState = false;
             StringBuilder whereCondition = new StringBuilder();
             CampaignName = CampaignName.Replace("'", "''");
             CampaignName = CampaignName.Replace("%", "[%]");
             CampaignName = CampaignName.Replace("_", "[_]");
             if (!string.IsNullOrEmpty(CampaignName))
             {
                 if (whereCondition.Length > 0)
                     whereCondition.Append(" OR CampaignName LIKE '%" + CampaignName + "%'");
                 else whereCondition.Append("CampaignName LIKE '%" + CampaignName + "%'");
             }
             if (whereCondition.Length == 0)
             {
                 whereCondition.Append("1=1");
             }
             oDatabaseHelper.AddParameter("@orderby", orderby);
             oDatabaseHelper.AddParameter("@dir", dir);
             oDatabaseHelper.AddParameter("@PageIndex", pageIndex);
             oDatabaseHelper.AddParameter("@PageSize", pageSize);
             oDatabaseHelper.AddParameter("@whereCondition", whereCondition.ToString());
             oDatabaseHelper.AddParameter("@Count", -1, System.Data.ParameterDirection.Output);
             DataSet dataSet = oDatabaseHelper.ExecuteDataSet("sp_CampaignJob_OlderThan90Days_Search_Pagewise", ref ExecutionState);
             count = Convert.ToInt32(oDatabaseHelper.Command.Parameters["@Count"].Value);
             return dataSet.Tables[0];
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 29
0
        public static DataSet GetSegmentResult(string ConString, string CampaignIds, string whereCondition, string orderBy, string dir, string keyValue, string segType)
        {
            try
            {
                using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConString))
                {
                    bool ExecutionState = false;
                    oDatabaseHelper.AddParameter("@CampaignIds", CampaignIds);
                    oDatabaseHelper.AddParameter("@whereCondition", whereCondition);
                    oDatabaseHelper.AddParameter("@orderby", orderBy);
                    oDatabaseHelper.AddParameter("@dir", dir);
                    oDatabaseHelper.AddParameter("@keyValue", keyValue);
                    oDatabaseHelper.AddParameter("@segType", segType);
                    DataSet dataSet = oDatabaseHelper.ExecuteDataSet("sp_ListContactMaster_ShowRecipientsOfCampaign_CustomProc", ref ExecutionState);
                    return dataSet;
                }
            }
            catch (Exception ex)
            {
                throw ex;

            }
        }
Esempio n. 30
0
 public static DataTable BindAllContactsTargeted(string ConnectionString, string ListIds, string orderby, string dir, int pageIndex, int pageSize, out int Count)
 {
     try
     {
         using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
         {
             bool ExecutionState = false;
             oDatabaseHelper.AddParameter("@ListID", ListIds);
             oDatabaseHelper.AddParameter("@orderby", orderby);
             oDatabaseHelper.AddParameter("@dir", dir);
             oDatabaseHelper.AddParameter("@PageIndex", pageIndex);
             oDatabaseHelper.AddParameter("@PageSize", pageSize);
             oDatabaseHelper.AddParameter("@Count", -1, System.Data.ParameterDirection.Output);
             DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_ListContactMaster_ShowListRecipientsWithCampaignID_Pagewise", ref ExecutionState);
             Count = Convert.ToInt32(oDatabaseHelper.Command.Parameters["@Count"].Value);
             oDatabaseHelper.Dispose();
             return ds.Tables[0];
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }