using Models;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Text.RegularExpressions;
using System.Management;
using System.Web.UI.HtmlControls;
namespace DAL
{
///
/// 客户资料 操作记录
///
public class NewClientBrowsingHistoryService
{
List excuteSql(string sql, params SqlParameter[] param)
{
return ServiceBase.excuteSql(new NewClientBrowsingHistory(), "NewClientBrowsingHistory", sql, CommandType.Text, param);
}
NewClientBrowsingHistory excuteType(string sql, params SqlParameter[] param)
{
//查询结果放入对象集合
List hdList = excuteSql(sql, param);
NewClientBrowsingHistory air = new NewClientBrowsingHistory();
//判断集合是否为空
if (hdList == null || hdList.Count == 0)
{
return air;
}
//返回单个对象
return hdList[0];
}
public bool Add(NewClientBrowsingHistory ncbh)
{
string sql = "insert into NewClientBrowsingHistory values(@UserId,@OperationItem,@ClientId,@OperationDt,@Address,@Device,@MacAddress,@RealIP,@IntranetIP,@Browser," +
"@BrowserType,@BrowserVersion,@Remark);SELECT @@IDENTITY";
SqlParameter[] parameter = new SqlParameter[]{
new SqlParameter("@UserId",ncbh.UserId),
new SqlParameter("@OperationItem",ncbh.OperationItem),
new SqlParameter("@ClientId",ncbh.ClientId),
new SqlParameter("@OperationDt",ncbh.OperationDt),
new SqlParameter("@Address",ncbh.Address),
new SqlParameter("@Device",ncbh.Device),
new SqlParameter("@MacAddress",ncbh.MacAddress),
new SqlParameter("@RealIP",ncbh.RealIP),
new SqlParameter("@IntranetIP",ncbh.IntranetIP),
new SqlParameter("@Browser",ncbh.Browser),
new SqlParameter("@BrowserType",ncbh.BrowserType),
new SqlParameter("@BrowserVersion",ncbh.BrowserVersion),
new SqlParameter("@Remark",ncbh.Remark)
};
if (SqlHelper.ExecuteNonQuery(sql, CommandType.Text, parameter) > 0)
return true;
return false;
}
}
}