65 lines
2.1 KiB
C#
65 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.OracleClient;
|
|
using WX.CRM.Common;
|
|
|
|
namespace WX.CRM.DAL.Base
|
|
{
|
|
public class ACTIONLOG_DAL
|
|
{
|
|
public DataSet CountActionLog(string stime, string etime)
|
|
{
|
|
var conn = new OracleConnection(OracleHelper.AYCRMConn);
|
|
if (conn.State == ConnectionState.Closed)
|
|
{
|
|
conn.Open();
|
|
}
|
|
try
|
|
{
|
|
var startTime = DateTime.Now.Date;
|
|
var endTime = DateTime.Now.AddDays(1).Date;
|
|
DateTime dt = DateTime.Now.Date;
|
|
if (!string.IsNullOrWhiteSpace(stime))
|
|
{
|
|
if (DateTime.TryParse(stime, out dt))
|
|
{
|
|
startTime = dt;
|
|
}
|
|
}
|
|
if (!string.IsNullOrWhiteSpace(etime))
|
|
{
|
|
if (DateTime.TryParse(etime, out dt))
|
|
{
|
|
endTime = dt.AddDays(1);
|
|
}
|
|
}
|
|
|
|
using (var trans = conn.BeginTransaction())
|
|
{
|
|
var parms = new List<OracleParameter>()
|
|
{
|
|
new OracleParameter() { ParameterName="v_stime",OracleType= OracleType.DateTime,Value=startTime},
|
|
new OracleParameter() {ParameterName="v_etime",OracleType = OracleType.DateTime,Value=endTime },
|
|
new OracleParameter() {ParameterName="v_data1",OracleType = OracleType.Cursor,Direction=ParameterDirection.Output }
|
|
};
|
|
DataSet ds = OracleHelper.DataQueray(trans, CommandType.StoredProcedure, "PACK_BASE_ACTIONLOG.countActionLog", parms.ToArray());
|
|
trans.Commit();
|
|
|
|
return ds;
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Error(ex);
|
|
return null;
|
|
}
|
|
finally
|
|
{
|
|
conn.Close();
|
|
}
|
|
}
|
|
}
|
|
}
|