//------------------------------------------------------------- // Sets the IsDeleted flag // //------------------------------------------------------------- public bool bSet_IsDeleted(Int64 iCampaignID, bool bIsDeleted) { bool bReturn = true; DBAccess dbAccess = Global.dbAccess; //---------------------------------------------------------- // Create the command and the Connection. //---------------------------------------------------------- string strConnString = WebConfigurationManager.ConnectionStrings["RainmakerMasterConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(strConnString); string strSQL = "pCampaign_Set_IsDeleted "; strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@CampaignID", iCampaignID, SqlDbType.Int, false, null); if (bIsDeleted == true) { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@IsDeleted", 1, SqlDbType.Bit, true, null); } else { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@IsDeleted", 0, SqlDbType.Bit, true, null); } try { SqlCommand cmd = new SqlCommand(strSQL, con); //------------------------------------------------------- // Open the Connection and get the DataReader. //------------------------------------------------------- con.Open(); cmd.ExecuteNonQuery(); } catch (Exception e) { //----------------------------------------------------- // For debugging purposes. //----------------------------------------------------- string strMsg = e.Message; bReturn = false; }; //--------------------------------------------------------- // Close the DataReader and the Connection. //--------------------------------------------------------- con.Close(); return(bReturn); }
//------------------------------------------------------------- // Obtains the Campaign table database based on ID. // //------------------------------------------------------------- public bool bGet(Int64 iCampaignID) { bool bReturn = true; DBAccess dbAccess = Global.dbAccess; //---------------------------------------------------------- // Create the command and the Connection. //---------------------------------------------------------- string strConnString = WebConfigurationManager.ConnectionStrings["RainmakerMasterConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(strConnString); string strSQL = "pCampaign_Get "; strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@CampaignID", iCampaignID, SqlDbType.Int, true, null); SqlCommand cmd = new SqlCommand(strSQL, con); //---------------------------------------------------------- // Open the Connection and get the DataReader. //---------------------------------------------------------- con.Open(); SqlDataReader sqlReader = cmd.ExecuteReader(); bReturn = bLoadData(sqlReader); //---------------------------------------------------------- // Close the DataReader and the Connection. //---------------------------------------------------------- sqlReader.Close(); con.Close(); return(bReturn); }
//------------------------------------------------------------- // Log out agent. // Works agents the Agent activity table, put here to save time. // Did not want to create a whole new class for one procedure. //------------------------------------------------------------- public bool bLogAgentOut(Int64 iAgentID, Int64 iAgentActivityID) { bool bReturn = true; DBAccess dbAccess = Global.dbAccess; //---------------------------------------------------------- // Create the command and the Connection. //---------------------------------------------------------- string strConnString = WebConfigurationManager.ConnectionStrings["RainmakerMasterConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(strConnString); string strSQL = "pLogAgentOut "; strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@AgentID", iAgentID, SqlDbType.Int, false, null); strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@AgentActivityID", iAgentActivityID, SqlDbType.Int, true, null); try { SqlCommand cmd = new SqlCommand(strSQL, con); //------------------------------------------------------- // Open the Connection and get the DataReader. //------------------------------------------------------- con.Open(); cmd.ExecuteNonQuery(); } catch { bReturn = false; }; //---------------------------------------------------------- // Close the DataReader and the Connection. //---------------------------------------------------------- con.Close(); return(bReturn); }
//------------------------------------------------------------- // Updates the Campaign table data. // // //------------------------------------------------------------- public bool bUpdate(DBCampaignData dbCampaignData) { bool bReturn = true; DBAccess dbAccess = Global.dbAccess; //---------------------------------------------------------- // Create the Command and the Connection. //---------------------------------------------------------- string strConnString = WebConfigurationManager.ConnectionStrings["RainmakerMasterConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(strConnString); string strSQL = "pCampaign_Update "; strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@CampaignDBConnString ", dbCampaignData.strCampaignDBConnString, SqlDbType.VarChar, false, null); strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@Description ", dbCampaignData.strDescription, SqlDbType.VarChar, false, null); strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@DuplicateRule ", dbCampaignData.strDuplicateRule, SqlDbType.VarChar, false, null); strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@OutboundCallerID ", dbCampaignData.strOutboundCallerID, SqlDbType.VarChar, false, null); strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@ShortDescription ", dbCampaignData.strShortDescription, SqlDbType.VarChar, false, null); strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@iCampaignID ", dbCampaignData.iCampaignID, SqlDbType.Int, false, null); strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@iStatusID ", dbCampaignData.iStatusID, SqlDbType.Int, false, null); if (dbCampaignData.bAllow7DigitNums == false) { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@Allow7DigitNums ", 1, SqlDbType.Bit, false, null); } else { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@Allow7DigitNums ", 0, SqlDbType.Bit, false, null); } if (dbCampaignData.bAllowDuplicatePhones == false) { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@AllowDuplicatePhones ", 1, SqlDbType.Bit, false, null); } else { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@AllowDuplicatePhones ", 0, SqlDbType.Bit, false, null); } if (dbCampaignData.bDialAllNumbers == false) { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@DialAllNumbers ", 1, SqlDbType.Bit, false, null); } else { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@DialAllNumbers ", 0, SqlDbType.Bit, false, null); } if (dbCampaignData.bEnableAgentTraining == false) { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@EnableAgentTraining ", 1, SqlDbType.Bit, false, null); } else { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@EnableAgentTraining ", 0, SqlDbType.Bit, false, null); } if (dbCampaignData.bFlushCallQueueOnIdle == false) { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@FlushCallQueueOnIdle ", 1, SqlDbType.Bit, false, null); } else { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@FlushCallQueueOnIdle ", 0, SqlDbType.Bit, false, null); } if (dbCampaignData.bFundRaiserDataTracking == false) { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@FundRaiserDataTracking ", 1, SqlDbType.Bit, false, null); } else { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@FundRaiserDataTracking ", 0, SqlDbType.Bit, false, null); } if (dbCampaignData.bIsDeleted == false) { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@IsDeleted ", 1, SqlDbType.Bit, false, null); } else { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@IsDeleted ", 0, SqlDbType.Bit, false, null); } if (dbCampaignData.bOnsiteTransfer == false) { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@OnsiteTransfer ", 1, SqlDbType.Bit, false, null); } else { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@OnsiteTransfer ", 0, SqlDbType.Bit, false, null); } if (dbCampaignData.bRecordLevelCallHistory == false) { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@RecordLevelCallHistory ", 1, SqlDbType.Bit, false, null); } else { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@RecordLevelCallHistory ", 0, SqlDbType.Bit, false, null); } if (dbCampaignData.bAllow10DigitNums == false) { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@Allow10DigitNums ", 1, SqlDbType.Bit, false, null); } else { strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@Allow10DigitNums ", 0, SqlDbType.Bit, false, null); } strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@DateCreated", dbCampaignData.dtDateCreated, SqlDbType.DateTime, false, null); strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@DateModified", dbCampaignData.dtDateModified, SqlDbType.DateTime, false, null); strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@StartTime", dbCampaignData.dtStartTime, SqlDbType.DateTime, false, null); strSQL = dbAccess.AddParamToSQLCmd(strSQL, "@StopTime", dbCampaignData.dtStopTime, SqlDbType.DateTime, true, null); try { SqlCommand cmd = new SqlCommand(strSQL, con); //------------------------------------------------------- // Open the Connection and get the DataReader. //------------------------------------------------------- con.Open(); cmd.ExecuteNonQuery(); } catch { bReturn = false; }; con.Close(); return(bReturn); }