using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using YTSoft.BaseCallCenter.Model;
using YTSoft.BaseCallCenter.MVCWeb.Models;
///
/// 客服快捷回复
///
namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
{
public class LogActionController : BaseController
{
BLL.T_Com_LogAction busLogAction = new BLL.T_Com_LogAction();
#region 纯视图
///
/// 回复列表
///
///
public ActionResult GetList()
{
return View();
}
#endregion
[ActionName("GetListData")]
public string GetListData(string Table = "", string id = "", int page = 0, int limit = 20)
{
string strWhere = " 1=1 ";
if (!string.IsNullOrEmpty(Table))
{
strWhere += string.Format(" and TableName = '{0}'", Table);
}
if (!string.IsNullOrEmpty(id))
{
strWhere += string.Format(" and TableId ={0}", id);
}
DataTable dt = busLogAction.GetListByPage(strWhere, " atime desc ", (page - 1) * limit, limit).Tables[0];
int count = busLogAction.GetRecordCount(strWhere);
return Success("成功", dt, count);
}
[ActionName("GetData")]
public string GettData(string id)
{
if (string.IsNullOrEmpty(id))
return Error("请输入ID");
Model.T_Com_LogAction model = busLogAction.GetModel(id);
return Success("成功", model, 1);
}
[ActionName("deletedata")]
public string DeleteData(string id)
{
if (string.IsNullOrEmpty(id))
return Error("请输入ID");
Model.T_Com_LogAction model = busLogAction.GetModel(id);
if (busLogAction.Delete(id))
{
AddLog("T_Com_LogAction", model.Id, "删除消息", JsonConvert.SerializeObject(model), "");
return Success("删除成功");
}
else
return Error("失败");
}
}
}