本文整理汇总了C#中ReplyPositiveBL.DatabaseHelper类的典型用法代码示例。如果您正苦于以下问题:C# DatabaseHelper类的具体用法?C# DatabaseHelper怎么用?C# DatabaseHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DatabaseHelper类属于ReplyPositiveBL命名空间,在下文中一共展示了DatabaseHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertandReturnID
public bool InsertandReturnID(ref int JobId)
{
bool ExecutionState = false;
DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
// Pass the value of '_importJobID' as parameter 'ImportJobID' of the stored procedure.
oDatabaseHelper.AddParameter("@ImportJobID", ImportJobID);
// Pass the value of '_staus' as parameter 'Staus' of the stored procedure.
oDatabaseHelper.AddParameter("@Staus", Staus);
// Pass the value of '_statusMessage' as parameter 'StatusMessage' of the stored procedure.
oDatabaseHelper.AddParameter("@StatusMessage", StatusMessage);
// Pass the value of '_updatedCount' as parameter 'UpdatedCount' of the stored procedure.
oDatabaseHelper.AddParameter("@UpdatedCount", UpdatedCount);
// Pass the value of '_insertedCount' as parameter 'InsertedCount' of the stored procedure.
oDatabaseHelper.AddParameter("@InsertedCount", InsertedCount);
// Pass the value of '_duplicateCount' as parameter 'DuplicateCount' of the stored procedure.
oDatabaseHelper.AddParameter("@DuplicateCount", DuplicateCount);
// Pass the value of '_invalidCount' as parameter 'InvalidCount' of the stored procedure.
oDatabaseHelper.AddParameter("@InvalidCount", InvalidCount);
// Pass the value of '_startTime' as parameter 'StartTime' of the stored procedure.
oDatabaseHelper.AddParameter("@StartTime", StartTime);
// Pass the value of '_endTime' as parameter 'EndTime' of the stored procedure.
oDatabaseHelper.AddParameter("@EndTime", EndTime);
// 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.ExecuteScalar("sp_ImportHistory_Insert_ReturnId", ref ExecutionState);
JobId = Convert.ToInt32(oDatabaseHelper.GetParameterValue("@Id"));
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例2: GetTop5AutomationJobs
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;
}
示例3: BindAllContactsTargetedByAssignCamp_Unsub_Search
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;
}
}
示例4: SearchDomainLookup
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;
}
}
示例5: GetContactStatusByEmailIdsWithActiveStatus
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];
}
示例6: GetAllBounceAndUnsubDetailsByType
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];
}
示例7: GetAllRecipientsByListMasterIds
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];
}
示例8: getSegmentDetails
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];
}
示例9: getSuppressDomain
//This method will get contact(s) of a particulat list from listcontactmaster table
//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;
// }
//}
//This method will get contact(s) of a particulat list from listcontactmaster table
public DataTable getSuppressDomain(Int64 CampaignID)
{
bool ExecutionState = false;
using (DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString))
{
string qryStr = "select * from DomineSupress where CampaignId = " + CampaignID;
DataSet dataSet = oDatabaseHelper.ExecuteDataSet(qryStr, CommandType.Text, ref ExecutionState);
return dataSet.Tables[0];
}
}
示例10: GetCommonFieldsFromTwoTables
public static DataTable GetCommonFieldsFromTwoTables(string ConnectionString, string tbl1, string tbl2)
{
DatabaseHelper oDatabaseHelper = new DatabaseHelper(ConnectionString);
bool ExecutionState = false;
// The parameter '@ErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@tbl1Name", tbl1);
oDatabaseHelper.AddParameter("@tbl2Name", tbl2);
DataSet ds = oDatabaseHelper.ExecuteDataSet("sp_GetAllCommonColumnsBetweenTables", ref ExecutionState);
oDatabaseHelper.Dispose();
return ds.Tables[0];
}
示例11: SelectEmailCount
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]);
}
示例12: SelectAllTemplateNames
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];
}
示例13: SelectAllByToday
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;
}
示例14: SearchSegmentSelect
public static DataTable SearchSegmentSelect(string ConnectionString, string ListName, DateTime CreatedDate, bool IsSegment)
{
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 (CreatedDate != DateTime.MinValue)
{
string dt = CreatedDate.ToString("yyyy-MM-dd");
if (whereCondition.Length > 0)
whereCondition.Append(" OR convert(char(10),CreatedDate,120) LIKE '" + dt + "'");
else whereCondition.Append(" convert(char(10),CreatedDate,120) LIKE '" + dt + "'");
}
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_SegmentMaster_SearchSelect", ref ExecutionState);
return dataSet.Tables[0];
}
}
catch (Exception ex)
{
throw ex;
}
}
示例15: SelectAllByDays
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;
}