using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using QMAPP.Common.Web.Controllers;
using QMAPP.Entity;
using QMAPP.FJC.Entity.Andon;
using QMAPP.FJC.Entity.Basic;
using QMAPP.FJC.Entity.Equipment;
using QMAPP.FJC.Web.Models.Andon;
using QMAPP.FJC.Web.Models.Basic;
using QMAPP.FJC.Web.Models.Equipment;
using QMAPP.MD.Entity;
using QMAPP.ServicesAgent;
using QMFrameWork.Common.Serialization;
using QMFrameWork.Data;
using QMFrameWork.WebUI.Attribute;
using QMFrameWork.WebUI.DataSource;
using ProcessInfo = QMAPP.FJC.Entity.Basic.ProcessInfo;
namespace QMAPP.FJC.Web.Controllers
{
public class TempCallLogController : QController
{
#region 获取列表
///
/// 加载列表
///
/// 结果
[HandleException]
public ActionResult List(bool? callBack)
{
TempCallLogModel seachModel = new TempCallLogModel();
string CALL_TYPE = Request["CALL_TYPE"];
seachModel.CALL_TYPE = CALL_TYPE;
if (callBack == true)
TryGetSelectBuffer(out seachModel);
seachModel.rownumbers = false;
seachModel.url = "/TempCallLog/GetList?CALL_TYPE=" + CALL_TYPE;
return View("TempCallLogList", seachModel);
}
//public ActionResult List()
//{
// return View();
//}
///
/// 获取列表
///
/// 是否回调
/// 列表
[HandleException]
public ActionResult GetList(bool? callBack)
{
TempCallLogModel seachModel = null;
DataPage page = null;
CallLogEntity condition = null;
DataResult pageResult = new DataResult();
ServiceAgent wcfAgent = this.GetServiceAgent();
try
{
//获取查询对象
seachModel = GetModel();
string CALL_TYPE = Request.Params["CALL_TYPE"];
string isFirst = Request.Params["isFirst"];
seachModel.CALL_TYPE = CALL_TYPE;
if (callBack != null)
{
TryGetSelectBuffer(out seachModel);
}
else
{
//保存搜索条件
SetSelectBuffer(seachModel);
}
//获取前台分页设置信息
page = this.GetDataPage(seachModel);
condition = CopyToModel(seachModel);
#region wcf服务统一接口
var callLogList = wcfAgent.InvokeServiceFunction("AndonCallBLL_GetCallLogCount", condition);
#endregion
return Content(callLogList);
}
catch (Exception ex)
{
throw ex;
}
}
[HandleException]
public ActionResult GetListNew(bool? callBack)
{
CallLogEntity condition = new CallLogEntity();
ServiceAgent wcfAgent = this.GetServiceAgent();
try
{
#region wcf服务统一接口
var callLogList = wcfAgent.InvokeServiceFunction("AndonCallBLL_GetCallLogCountNew", condition);
#endregion
return Content(callLogList);
}
catch (Exception ex)
{
throw ex;
}
}
[HandleException]
public ActionResult GetDivStyle(bool? callBack)
{
ServiceAgent wcfAgent = this.GetServiceAgent();
try
{
string type = Request.Params["type"];
#region wcf服务统一接口
var divs = wcfAgent.InvokeServiceFunction("AndonCallBLL_GetDivStyle",type);
#endregion
return Content(divs);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
///
/// 统计
///
/// 结果
[HandleException]
public ActionResult Count(bool? callBack)
{
CallLogModel seachModel = new CallLogModel();
if (callBack == true)
TryGetSelectBuffer(out seachModel);
string ids = Request.Params["PID"];
seachModel.rownumbers = false;
seachModel.url = "/TempCallLog/GetCountList?PID=" + ids;
return View("CountCallLogList", seachModel);
}
///
/// 获取统计列表
///
/// 是否回调
/// 列表
[HandleException]
public ActionResult GetCountList(bool? callBack)
{
CallLogModel seachModel = null;
DataResult pageResult = new DataResult();
DataPage page = new DataPage();
ServiceAgent wcfAgent = this.GetServiceAgent();
CallLogEntity condition = null;
try
{
//获取查询对象
seachModel = GetModel();
#region 获取缓存值
if (callBack != null)
{
TryGetSelectBuffer(out seachModel);
}
else
{
//保存搜索条件
SetSelectBuffer(seachModel);
}
#endregion
//获取前台分页设置信息
page = this.GetDataPage(seachModel);
condition = CopyToModel(seachModel);
string ids = Request.Params["PID"];
var callType = ids.Substring(0,1);
var mc = ids.Substring(1);
condition.CALL_TYPE = callType;
condition.MACHINECODDE = mc;
#region wcf服务统一接口
pageResult = wcfAgent.InvokeServiceFunction>("AndonCallBLL_GetCallLogListWeb",
condition, page);
if (pageResult.IsSuccess == false)
{
SetMessage(pageResult.Msg);
return List(true);
}
DateGridResult result = new DateGridResult();
result.Total = pageResult.Result.RecordCount;
result.Rows = JsonConvertHelper.GetDeserialize>(pageResult.Result.Result.ToString());
#endregion
return Content(result.GetJsonSource());
}
catch (Exception ex)
{
throw ex;
}
}
}
}