예제 #1
0
        /// <summary>
        /// 查询专属坐席
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <param name="order">排序</param>
        /// <param name="currentPage">页号,-1不分页</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="totalCount">总行数</param>
        /// <returns>集合</returns>
        public DataTable GetEmployeeAgentExclusive(QueryEmployeeAgentExclusive query, string order, int currentPage, int pageSize, out int totalCount)
        {
            string where = string.Empty;

            #region 数据权限判断
            if (query.LoginID != Constant.INT_INVALID_VALUE)
            {
                string whereDataRight = "";
                whereDataRight = Dal.UserGroupDataRigth.Instance.GetSqlRightstr("EmployeeAgent", "EmployeeAgent", "BGID", "UserID", query.LoginID);

                where += whereDataRight;
            }
            #endregion

            #region 部门条件
            where += " and v_userinfo.Status=0 ";
            string PartIDs  = BitAuto.Utils.Config.ConfigurationUtil.GetAppSettingValue("YichePartID");
            int    DepCount = PartIDs.Split(',').Length;
            if (DepCount > 0)
            {
                where += " and (";
                for (int i = 0; i < DepCount; i++)
                {
                    if (i != 0)
                    {
                        where += " or ";
                    }
                    where += " DepartID in (select ID from SysRightsManager.dbo.f_Cid('" + PartIDs.Split(',')[i] + "')) ";
                }
                where += " )";
            }
            #endregion

            if (!string.IsNullOrEmpty(query.TrueName))
            {
                where += " and v_userinfo.TrueName like'%" + query.TrueName + "%'";
            }
            if (!string.IsNullOrEmpty(query.AgentNum))
            {
                where += " and AgentNum='" + Utils.StringHelper.SqlFilter(query.AgentNum) + "'";
            }
            if (query.UserID != Constant.INT_INVALID_VALUE)
            {
                where += " and UserID=" + query.UserID.ToString() + "";
            }
            if (query.BGID != Constant.INT_INVALID_VALUE)
            {
                where += " and BGID=" + query.BGID.ToString() + "";
            }
            if (!string.IsNullOrEmpty(query.IsExclusive))
            {
                where += " and ";
                where += "( IsExclusive in (" + query.IsExclusive.ToString() + ")";

                if (query.IsExclusive.Contains("0"))//否
                {
                    where += " or IsExclusive is null or IsExclusive='' ";
                }


                where += " )";
            }
            //工号不能为空
            where += " and AgentNum is not null and AgentNum<>''";

            DataSet ds;

            SqlParameter[] parameters =
            {
                new SqlParameter("@where",         SqlDbType.NVarChar, 40000),
                new SqlParameter("@order",         SqlDbType.NVarChar,   200),
                new SqlParameter("@pagesize",      SqlDbType.Int,          4),
                new SqlParameter("@indexpage",     SqlDbType.Int,          4),
                new SqlParameter("@totalRecorder", SqlDbType.Int, 4)
            };

            parameters[0].Value     = where;
            parameters[1].Value     = order;
            parameters[2].Value     = pageSize;
            parameters[3].Value     = currentPage;
            parameters[4].Direction = ParameterDirection.Output;

            ds         = SqlHelper.ExecuteDataset(CONNECTIONSTRINGS, CommandType.StoredProcedure, P_EMPLOYEEAGENT_SELECTEXCLUSIVE, parameters);
            totalCount = (int)(parameters[4].Value);
            return(ds.Tables[0]);
        }
예제 #2
0
 /// <summary>
 /// 查询专属坐席
 /// </summary>
 /// <param name="query">查询条件</param>
 /// <param name="order">排序</param>
 /// <param name="currentPage">页号,-1不分页</param>
 /// <param name="pageSize">每页记录数</param>
 /// <param name="totalCount">总行数</param>
 /// <returns>集合</returns>
 public DataTable GetEmployeeAgentExclusive(QueryEmployeeAgentExclusive query, string order, int currentPage, int pageSize, out int totalCount)
 {
     return(Dal.EmployeeAgent.Instance.GetEmployeeAgentExclusive(query, order, currentPage, pageSize, out totalCount));
 }