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; } }
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; } }
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; } }
public void deleteListFromListContactMaster(Int64 listIDToBeDeleted, Int64 contactID) { try { using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString)) { bool ExecutionState = false; oDatabaseHelper.AddParameter("@ListID", listIDToBeDeleted); oDatabaseHelper.AddParameter("@ContactID", contactID); int IsSuccess = oDatabaseHelper.ExecuteNonQuery("sp_ListContactMaster_ListID_Delete_CustomProc", ref ExecutionState); } } catch (Exception ex) { throw ex; } }
public void UpdateColumnByNulls(string customfield) { DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString); bool ExecutionState = false; oDatabaseHelper.AddParameter("@customfield", customfield); oDatabaseHelper.ExecuteNonQuery("sp_ContactMaster_Update_Column", ref ExecutionState); oDatabaseHelper.Dispose(); }
public void RemoveMultipleContacts(string ContactsTobeRemoved) { try { bool ExecutionState = false; DatabaseHelper ObDatabaseHelper = new DatabaseHelper(ConnectionString); ObDatabaseHelper.AddParameter("@ContactIDs", ContactsTobeRemoved); int IsSuccess = ObDatabaseHelper.ExecuteNonQuery("sp_ContactMaster_DeleteMultipleContacts_CustomProc", ref ExecutionState); } catch (Exception ex) { throw ex; } }
private void unSubscribeContact(Int64 contactID, Int64 campaignID, string ipAddress, string reason, string notes, string whatToUnSub) { try { using (DatabaseHelper oDatabaseHelper = new DatabaseHelper()) { bool ExecutionState = false; oDatabaseHelper.AddParameter("@ContactID", contactID); oDatabaseHelper.AddParameter("@CampaignID", campaignID); oDatabaseHelper.AddParameter("@IPAddress", ipAddress); oDatabaseHelper.AddParameter("@OptOutReasonDesc", reason); oDatabaseHelper.AddParameter("@OptOutAdditionalNotes", notes); oDatabaseHelper.AddParameter("@WhatToUnSub", whatToUnSub); int IsSuccess = oDatabaseHelper.ExecuteNonQuery("sp_UnSubscribeDetails_Insert_CustomProc", ref ExecutionState); } } catch (Exception ex) { throw ex; } }
//Ganesh on 09feb10 //This method will insert recipients forwarded to ForwardDetails table.. public void InsertForwardDetails(Int64 campaignID, string forwardXMLData, int forwardCount, String ConnectionString) { try { using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString)) { bool ExecutionState = false; oDatabaseHelper.AddParameter("@CampaignMasterID", campaignID); oDatabaseHelper.AddParameter("@ForwardXML", forwardXMLData); oDatabaseHelper.AddParameter("@ForwardCount", forwardCount); int IsSuccess = oDatabaseHelper.ExecuteNonQuery("sp_ForwardDetals_Insert_CustomProc", ref ExecutionState); } } catch (Exception ex) { throw ex; } }
public static void RemoveMultipleFields(string FieldIds, String ConnectionString) { try { bool ExecutionState = false; DatabaseHelper ObDatabaseHelper = new DatabaseHelper(ConnectionString); ObDatabaseHelper.AddParameter("@FieldIds", FieldIds); int IsSuccess = ObDatabaseHelper.ExecuteNonQuery("sp_ManageFields_DeleteMultipleByField", ref ExecutionState); } catch (Exception ex) { throw ex; } }
private void CreateClientInBilling() { try { bool ExecutionState = false; string constr = ConfigurationManager.ConnectionStrings["BillingConnection"].ToString(); DatabaseHelper objDbHelper = new DatabaseHelper(constr); objDbHelper.AddParameter("@firstName", txtCreateFirstName.Text); objDbHelper.AddParameter("@lastName", txtCreateLastname.Text); objDbHelper.AddParameter("@email", txtCreateEmail.Text); objDbHelper.AddParameter("@phone", ""); objDbHelper.AddParameter("@stateCode", ""); objDbHelper.AddParameter("@country", ""); objDbHelper.AddParameter("@Active", ChkCreateStatus.Checked.ToString()); objDbHelper.AddParameter("@ParentCompanyId", ""); objDbHelper.AddParameter("@ClientCode", txtCreateUsername.Text); objDbHelper.AddParameter("@IntegratedSystemClientId", txtCreateUsername.Text); objDbHelper.AddParameter("@Option", "Add"); objDbHelper.ExecuteNonQuery("addClientsFromIntegratedApplication", ref ExecutionState); } catch { } }
public void RemoveMultipleContacts(string ContactsTobeRemoved) { try { bool ExecutionState = false; DatabaseHelper ObDatabaseHelper = new DatabaseHelper(ConnectionString); ObDatabaseHelper.AddParameter("@Emails", ContactsTobeRemoved); int IsSuccess = ObDatabaseHelper.ExecuteNonQuery("sp_SuppressContacts_RemoveSelected", ref ExecutionState); } catch (Exception ex) { throw ex; } }
public static void RemoveDuplicates(string ConnectionString) { bool ExecutionState = false; using (DatabaseHelper ObjDbase = new DatabaseHelper(ConnectionString)) { int i = ObjDbase.ExecuteNonQuery("Sp_SuppressContacts_RemoveDuplicates_Proc", ref ExecutionState); } }
//Anwar private void unSubscribeContactCheck(Int64 contactID, Int64 campaignID, string ipAddress, string reason, string notes, string whatToUnSub, out int Count) { try { using (DatabaseHelper oDatabaseHelper = new DatabaseHelper()) { bool ExecutionState = false; oDatabaseHelper.AddParameter("@ContactID", contactID); oDatabaseHelper.AddParameter("@CampaignID", campaignID); oDatabaseHelper.AddParameter("@IPAddress", ipAddress); oDatabaseHelper.AddParameter("@OptOutReasonDesc", reason); oDatabaseHelper.AddParameter("@OptOutAdditionalNotes", notes); oDatabaseHelper.AddParameter("@WhatToUnSub", whatToUnSub); oDatabaseHelper.AddParameter("@Count", -1, System.Data.ParameterDirection.Output); int IsSuccess = oDatabaseHelper.ExecuteNonQuery("sp_UnSubscribeDetails_CheckAndInsert_CustomProc", ref ExecutionState); Count = Convert.ToInt32(oDatabaseHelper.Command.Parameters["@Count"].Value); } } catch (Exception ex) { throw ex; } }
/// End Here /// public int InsertInToDomainSuppress_Bulk(int CompaignId, string ListMasterIds, DataTable SupressedDomain) { try { using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString)) { bool ExecutionState = false; oDatabaseHelper.AddParameter("@CampaignId", CompaignId); oDatabaseHelper.AddParameter("@ListIds", ListMasterIds); oDatabaseHelper.AddParameter("@DtDomainNames", SupressedDomain); int IsSuccess = oDatabaseHelper.ExecuteNonQuery("sp_InsertInToDomainSuppress", ref ExecutionState); return IsSuccess; } } catch (Exception ex) { throw ex; } }
public int InsertReturnID() { bool ExecutionState = false; DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString); // Pass the value of '_templateName' as parameter 'TemplateName' of the stored procedure. oDatabaseHelper.AddParameter("@TemplateName", TemplateName); // Pass the value of '_templateDescription' as parameter 'TemplateDescription' of the stored procedure. oDatabaseHelper.AddParameter("@TemplateDescription", TemplateDescription); // Pass the value of '_clientId' as parameter 'ClientId' of the stored procedure. oDatabaseHelper.AddParameter("@ClientId", ClientId); // Pass the value of '_hTMLContent' as parameter 'HTMLContent' of the stored procedure. oDatabaseHelper.AddParameter("@HTMLContent", HTMLContent); // Pass the value of '_textContent' as parameter 'TextContent' of the stored procedure. oDatabaseHelper.AddParameter("@TextContent", TextContent); // Pass the value of '_modifiedBy' as parameter 'ModifiedBy' of the stored procedure. oDatabaseHelper.AddParameter("@ModifiedBy", ModifiedBy); // Pass the value of '_modifiedDate' as parameter 'ModifiedDate' of the stored procedure. oDatabaseHelper.AddParameter("@ModifiedDate", ModifiedDate); // Pass the value of '_createdDate' as parameter 'CreatedDate' of the stored procedure. oDatabaseHelper.AddParameter("@CreatedDate", CreatedDate); // Pass the value of '_createdBy' as parameter 'CreatedBy' of the stored procedure. oDatabaseHelper.AddParameter("@CreatedBy", CreatedBy); // The parameter '@ErrorCode' will contain the status after execution of the stored procedure. oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output); oDatabaseHelper.AddParameter("@Id", -1, System.Data.ParameterDirection.Output); oDatabaseHelper.ExecuteNonQuery("sp_TemplateMaster_Insert_ReturnId", ref ExecutionState); int id = (int)oDatabaseHelper.GetParameterValue("@Id"); oDatabaseHelper.Dispose(); return id; }
public int SaveSuppressDomain(long ID, string SuppressDomain) { try { using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString)) { bool ExecutionState = false; oDatabaseHelper.AddParameter("@CampaignId", ID); oDatabaseHelper.AddParameter("@SuppressDomain", SuppressDomain); int IsSuccess = oDatabaseHelper.ExecuteNonQuery("USP_SaveSuppressDomain", ref ExecutionState); return IsSuccess; } } catch (Exception ex) { throw ex; } }
//Ganesh on 19nov09 //This method will insert a fieldmap in fieldmap table. public void InsertFieldmap(Int64 importJobID, string fieldMapXMLData) { try { using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString)) { bool ExecutionState = false; oDatabaseHelper.AddParameter("@ImportJobID", importJobID); oDatabaseHelper.AddParameter("@fieldMapXML", fieldMapXMLData); int IsSuccess = oDatabaseHelper.ExecuteNonQuery("sp_FieldMap_Insert", ref ExecutionState); } } catch (Exception ex) { throw ex; } }
public static void RemoveMultipleTemplates(string TemplatesTobeRemoved, string ConnectionString) { try { bool ExecutionState = false; DatabaseHelper ObDatabaseHelper = new DatabaseHelper(ConnectionString); ObDatabaseHelper.AddParameter("@TemplateIDs", TemplatesTobeRemoved); int IsSuccess = ObDatabaseHelper.ExecuteNonQuery("sp_TemplateMaster_DeleteMultipleTemplates", ref ExecutionState); } catch (Exception ex) { throw ex; } }
//Ganesh on 06feb10 //This method will insert a new contact in contactmaster adn listcontactmaster. public int InsertNewSubscriber(Int64 ListID, string EmailAddress) { try { using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString)) { bool ExecutionState = false; oDatabaseHelper.AddParameter("@ListID", ListID); oDatabaseHelper.AddParameter("@EmailAddress", EmailAddress); int IsSuccess = oDatabaseHelper.ExecuteNonQuery("sp_ContactMaster_ListContactMaster_AddSubscriber_CustomProc", ref ExecutionState); return IsSuccess; } } catch (Exception ex) { throw ex; } }
public void updateJobStatus(Int64 campaignID, Common.StatusType status, string statusMessage, int recipientsFound) { try { using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(clientConnectionString, Providers.SqlServer)) { bool ExecutionState = false; oDatabaseHelper.AddParameter("@CampaignMasterID", campaignID); oDatabaseHelper.AddParameter("@Status", Convert.ToInt32(status)); oDatabaseHelper.AddParameter("@StatusMessage", statusMessage); oDatabaseHelper.AddParameter("@TotalRecipients", recipientsFound); int isSuccess = oDatabaseHelper.ExecuteNonQuery("sp_AutomationJob_UpdateJobStatus_CustomProc", ref ExecutionState); } } catch (Exception ex) { throw ex; } }
//public static new ListMasters SelectByField(string field, object fieldValue) //{ // DatabaseHelper oDatabaseHelper = new DatabaseHelper(); // bool ExecutionState = false; // string ListName = fieldValue.ToString(); // if (ListName.Contains("'")) // { // ListName = ListName.Replace("'", "''"); // } // // Pass the specified field and its value to the stored procedure. // oDatabaseHelper.AddParameter("@Field", field); // oDatabaseHelper.AddParameter("@Value", ListName); // // 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_ListMaster_SelectByField", ref ExecutionState); // ListMasters ListMasters = PopulateObjectsFromReader(dr); // dr.Close(); // oDatabaseHelper.Dispose(); // return ListMasters; //} //Swaraj on 30th April //This method is used to delete multiple list public void RemoveMultipleLists(string ListsTobeRemoved, int value) { try { bool ExecutionState = false; int IsSuccess; DatabaseHelper ObDatabaseHelper = new DatabaseHelper(ConnectionString); ObDatabaseHelper.AddParameter("@ListIDs", ListsTobeRemoved); if (value == 0) IsSuccess = ObDatabaseHelper.ExecuteNonQuery("sp_ListMaster_DeleteMultipleLists_CustomProc", ref ExecutionState); if (value == 1) IsSuccess = ObDatabaseHelper.ExecuteNonQuery("sp_ListMaster_DeleteMultipleLists_WithContacts_CustomProc", ref ExecutionState); } catch (Exception ex) { throw ex; } }