public DataTable GetAllStateStatisticsFromDB(QueryAgentState query, string order, int currentPage, int pageSize, out int totalCount) { totalCount = 0; string where = string.Empty; #region 数据权限判断 if (query.LoginID != Constant.INT_INVALID_VALUE) { string whereDataRight = ""; whereDataRight = Dal.UserGroupDataRigth.Instance.GetSqlRightstr("ea", "ca", "BGID", "AgentID", query.LoginID); where += whereDataRight; } #endregion SqlParameter[] parameters = { new SqlParameter("@where", SqlDbType.NVarChar, 4000), 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; DataSet ds = SqlHelper.ExecuteDataset(CONNECTIONSTRINGS, CommandType.StoredProcedure, "p_AgentState_SelectStatistics", parameters); totalCount = (int)(parameters[4].Value); if (ds != null && ds.Tables.Count > 0) { return(ds.Tables[0]); } else { return(null); } }
private void BindData() { int _loginID = -2; string _ownGroup = string.Empty; string _oneSelf = string.Empty; _loginID = userID; Entities.QueryAgentState query = new QueryAgentState(); query.LoginID = _loginID; query.BGID = RequestBGID; int totalCount = 0; DataTable dt = BLL.AgentTimeState.Instance.GetAllStateStatisticsFromDB(query, " Name asc ", 1, 99999, out totalCount);//BLL.CallRecordInfo.Instance.GetCallPhoneReport(query, "StatisticsTime DESC,AgentName ", BLL.PageCommon.Instance.PageIndex, PageSize, out RecordCount); if (dt != null) { repeaterTableList.DataSource = dt; repeaterTableList.DataBind(); } }
public DataTable GetAllStateStatisticsFromDB(QueryAgentState query, string order, int currentPage, int pageSize, out int totalCount) { return(Dal.AgentTimeState.Instance.GetAllStateStatisticsFromDB(query, order, currentPage, pageSize, out totalCount)); }
/// <summary> /// 查询坐席实时状态 /// </summary> /// <param name="query"></param> /// <param name="order"></param> /// <param name="currentPage"></param> /// <param name="pageSize"></param> /// <param name="totalCount"></param> /// <returns></returns> public DataTable GetAllStateFromDB(QueryAgentState query, string order, int currentPage, int pageSize, out int totalCount) { totalCount = 0; string where = string.Empty; #region 数据权限判断 if (query.LoginID != Constant.INT_INVALID_VALUE) { string whereDataRight = ""; whereDataRight = Dal.UserGroupDataRigth.Instance.GetSqlRightstr("ea", "ea", "BGID", "UserID", query.LoginID); where += whereDataRight; } #endregion if (!string.IsNullOrEmpty(query.AgentName)) { where += " and c.AgentName='" + StringHelper.SqlFilter(query.AgentName) + "'"; } if (query.AgentAuxState != Constant.INT_INVALID_VALUE) { where += " and c.AgentAuxState=" + query.AgentAuxState; } if (query.AgentNum != Constant.STRING_EMPTY_VALUE) { where += " and ea.AgentNum='" + StringHelper.SqlFilter(query.AgentNum) + "'"; } if (query.UserID != Constant.INT_INVALID_VALUE) { where += " and c.AgentID=" + query.UserID; } if (query.BGID != Constant.INT_INVALID_VALUE) { where += " and ea.BGID=" + query.BGID; } if (query.ExtensionNum != Constant.STRING_EMPTY_VALUE) { where += " and c.ExtensionNum='" + StringHelper.SqlFilter(query.ExtensionNum) + "'"; } if (query.GroupName != Constant.STRING_EMPTY_VALUE) { where += " and ea.GroupName='" + StringHelper.SqlFilter(query.GroupName) + "'"; } if (query.State != Constant.INT_INVALID_VALUE) { where += " and c.State=" + query.State; } SqlParameter[] parameters = { new SqlParameter("@where", SqlDbType.NVarChar, 4000), 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; DataSet ds = SqlHelper.ExecuteDataset(CONNECTIONSTRINGS, CommandType.StoredProcedure, "p_AgentState_Select", parameters); totalCount = (int)(parameters[4].Value); if (ds != null && ds.Tables.Count > 0) { return(ds.Tables[0]); } else { return(null); } }