private void BindScoreData()
        {
            QueryQS_ScoreStat query = new QueryQS_ScoreStat();

            query.RequestUserID          = RequestUserID;
            query.RequestGroupID         = RequestGroupID;
            query.RequestRecordBeginTime = RequestRecordBeginTime;
            query.RequestRecordEndTime   = RequestRecordEndTime;

            int totalCount = 0;

            string    tableEndName = "_QS";//查询质检话务冗余表
            DataTable dt           = BLL.QS_Result.Instance.GetQS_ResultScoreStat(query, "", BLL.PageCommon.Instance.PageIndex, pageSize, tableEndName, out totalCount);

            repeaterTableList.DataSource = dt;
            repeaterTableList.DataBind();
            AjaxPager.PageSize = pageSize;
            AjaxPager.InitPager(totalCount);
        }
Exemplo n.º 2
0
        private string GetQS_ResultScoreStat_Where(QueryQS_ScoreStat query)
        {
            string where = "";
            int userId = 0;

            if (int.TryParse(query.RequestUserID, out userId) && userId > 0)
            {
                where += " And cri.CreateUserID=" + userId;
            }
            int groupId = 0;

            if (int.TryParse(query.RequestGroupID, out groupId) && groupId > 0)
            {
                where += " AND cri.BGID=" + groupId;
            }

            DateTime recordBeginTime;
            DateTime recordEndTime;

            if (DateTime.TryParse(query.RequestRecordBeginTime, out recordBeginTime))
            {
                where += " And cri.CreateTime>='" + recordBeginTime.ToString() + "'";
            }
            if (DateTime.TryParse(query.RequestRecordEndTime, out recordEndTime))
            {
                where += " And cri.CreateTime<='" + recordEndTime.Add(new TimeSpan(23, 59, 59)).ToString() + "'";
            }

            // 数据权限判断
            int    loginUserId    = BLL.Util.GetLoginUserID();
            string whereDataRight = "";

            whereDataRight = BLL.UserGroupDataRigth.Instance.GetSqlRightstr("cri", "BGID", "CreateUserID", loginUserId);
            where         += whereDataRight;
            return(where);
        }
Exemplo n.º 3
0
 /// 成绩统计查询
 /// <summary>
 /// 成绩统计查询
 /// </summary>
 /// <param name="where"></param>
 /// <param name="order"></param>
 /// <param name="currentPage"></param>
 /// <param name="pageSize"></param>
 /// <param name="tableEndName"></param>
 /// <param name="totalCount"></param>
 /// <returns></returns>
 public DataTable GetQS_ResultScoreStat(QueryQS_ScoreStat query, string order, int currentPage, int pageSize, string tableEndName, out int totalCount)
 {
     string where = GetQS_ResultScoreStat_Where(query);
     return(Dal.QS_Result.Instance.GetQS_ResultScoreStat(where, order, currentPage, pageSize, tableEndName, out totalCount));
 }
Exemplo n.º 4
0
        private void BindScoreData()
        {
            QueryQS_ScoreStat query = new QueryQS_ScoreStat();

            query.RequestUserID  = RequestUserID;
            query.RequestGroupID = RequestGroupID;

            query.RequestRecordBeginTime = RequestRecordBeginTime;
            query.RequestRecordEndTime   = RequestRecordEndTime;

            int       totalCount   = 0;
            string    tableEndName = "_QS";//查询质检话务冗余表
            DataTable dt           = BLL.QS_Result.Instance.GetQS_ResultScoreStat(query, "", 1, -1, tableEndName, out totalCount);

            DataTable  dtNew          = new DataTable();
            DataColumn dcEmployeeName = new DataColumn("坐席");
            DataColumn dcRulesTable   = new DataColumn("评分表");
            DataColumn dcSumCount     = new DataColumn("质检次数");
            DataColumn dcStatCount    = new DataColumn("合格量");
            DataColumn dcRate         = new DataColumn("合格率");
            DataColumn dcAvg          = new DataColumn("平均分");

            dtNew.Columns.Add(dcEmployeeName);
            dtNew.Columns.Add(dcRulesTable);
            dtNew.Columns.Add(dcSumCount);
            dtNew.Columns.Add(dcStatCount);
            dtNew.Columns.Add(dcRate);
            dtNew.Columns.Add(dcAvg);
            if (dt != null)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    DataRow drNew = dtNew.NewRow();
                    //坐席名称
                    drNew[0] = dr["TrueName"].ToString();
                    //评分表名称
                    drNew[1] = dr["Name"].ToString();
                    //质检次数
                    drNew[2] = dr["SumCount"].ToString();

                    //质检评分
                    if (dr["ScoreType"].ToString() != "2")
                    {
                        //float result = float.Parse(dr["statCount"].ToString()) / float.Parse(dr["sumCount"].ToString());
                        drNew[3] = "-";
                        drNew[4] = "-";
                        if (dr["totScore"].ToString() != null && dr["totScore"] != null && dr["sumCount"].ToString() != "0")
                        {
                            drNew[5] = (float.Parse(dr["totScore"].ToString()) / float.Parse(dr["sumCount"].ToString())).ToString("0.00");
                        }
                        else
                        {
                            drNew[5] = "0.00";
                        }
                    }
                    else
                    {
                        drNew[3] = dr["statCount"].ToString();
                        float result = float.Parse(dr["statCount"].ToString()) * 100 / float.Parse(dr["sumCount"].ToString());
                        drNew[4] = result.ToString("0.00") + "%";
                        drNew[5] = "-";
                    }

                    dtNew.Rows.Add(drNew);
                }
            }

            BLL.Util.ExportToCSV("坐席成绩统计", dtNew);
        }