using System; using System.Data; using System.Data.SqlClient; namespace WX.CRM.CRMServices.SqlHelper { public class CallRecord { public DataSet GetCallRecord(decimal? RecordId) { string sql = "SELECT TOP 10000 RecordId,f.COID,ServerID,FileName,Number=case f.CallType when 1 then CalledNumber else CallerNumber end ,f.EmployeeID,CreateTime,FileLength,f.CallType, f.ExtensionNumber "; sql += "FROM dbo.AGENTRECFILE f with(nolock) where CallType <>2 and RecordId>@RecordId order by RecordId ASC"; SqlParameter[] parameters = { new SqlParameter("@RecordId", SqlDbType.Decimal){ Value = RecordId??0} }; DataSet ds = SqlHelper.GetDataSet(SqlHelper.DatabaseType.BC, sql, CommandType.Text, parameters); return ds; } public DataSet GetLevel2CallRecord(DateTime timestart) { //string sql = "GetAgentRecord"; //SqlParameter[] parameters = { // new SqlParameter("@begintime", SqlDbType.DateTime){ Value = timestart} // }; //DataSet ds = SqlHelper.GetDataSet(SqlHelper.DatabaseType.BC, sql, CommandType.StoredProcedure, parameters); //return ds; string sql = "select t1.agentsessionid,t1.recordfile,t1.callingno,t1.calledno,(case t1.CallType when 1 then t1.calledno else t1.callingno end) as number,t1.userid,t1.begintime,t1.[second],t1.calltype from dbo.v_record_remark_customer_memo t1 where t1.begintime >@timestart"; SqlParameter[] parameters = { new SqlParameter("@timestart", SqlDbType.DateTime){ Value =timestart } }; DataSet ds = SqlHelper.GetDataSet(SqlHelper.DatabaseType.IPSC, sql, CommandType.Text, parameters); return ds; } public DataSet GetServerID() { string sql = "select configvalue from dbo.t_softconfig where configname = 'dummyAddress'"; DataSet ds = SqlHelper.GetDataSet(SqlHelper.DatabaseType.IPSC, sql, CommandType.Text); return ds; } } }