using CallCenterApi.Common;
using CallCenterApi.Interface.Controllers.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CallCenterApi.Interface.Controllers.tel
{
    public class SeatMonitoringController : BaseController
    {
        /// <summary>
        /// 获取坐席列表
        /// </summary>
        /// <returns></returns>
        public ActionResult GetList()
        {
            ActionResult res = NoToken("未知错误，请重新登录");
            if (Request.IsAuthenticated)
            {
                DataTable dt = new DataTable();
                int deptid = CurrentUser.UserData.F_DeptId;
                int roleid = CurrentUser.UserData.F_RoleId;
                BLL.T_Sys_UserAccount bll = new BLL.T_Sys_UserAccount();

                string sql = "";
                //if (roleid != 17)
                //{
                //    sql = " and F_DeptId=" + deptid;
                //}

                dt = bll.GetList(" f_seatflag=1 and F_DeleteFlag=0 " + sql + " order by f_userid desc ").Tables[0];

                if (dt.Rows.Count > 0)
                {
                    res = Success("坐席列表加载成功", dt);
                }
                else
                {
                    res = Error("坐席列表加载失败");
                }
            }
            return res;
        }
    }
}