| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Data;
- namespace HySoft.BaseCallCenter.Web.reportmanage.operationdata
- {
- public partial class YearContrastPic : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!this.IsPostBack)
- {
- for (int i = 2013; i < 2055; i++)
- {
- this.dptBgn.Items.Add(new ListItem(i.ToString()));
- this.dptEnd.Items.Add(new ListItem(i.ToString()));
- }
- this.dptBgn.SelectedValue = (System.DateTime.Now.Year - 1).ToString();
- this.dptEnd.SelectedValue = System.DateTime.Now.Year.ToString();
- }
- }
- //客户呼叫数
- public string GetKhCall(string strtime)
- {
- DataTable dt = new DataTable();
- string str = "";
- for (int i = 1; i <= 12; i++)
- {
- string sqltimeCallRecords = "";
- string strmm = i.ToString();
- if (i <= 9)
- {
- strmm = "0" + i;
- }
- if (strtime != "")
- {
- sqltimeCallRecords += " and CONVERT(varchar , timecallin, 120)>=CONVERT(varchar , '" + strtime + "-" + strmm + "-01 00:00:01', 120) ";
- sqltimeCallRecords += " and CONVERT(varchar , timecallin, 120)<=CONVERT(varchar , '" + strtime + "-" + strmm + "-31 23:59:59', 120) ";
- }
- dt = DBUtility.DbHelperSQL.Query("select COUNT(*) as ct from rep_trunk_call_in where 1=1 " + sqltimeCallRecords).Tables[0];
- if (dt != null && dt.Rows.Count > 0)
- {
- if (dt.Rows[0]["ct"].ToString() != "")
- {
- str += dt.Rows[0]["ct"].ToString() + ",";
- }
- else
- {
- str += "0,";
- }
- }
- else
- {
- str += "0,";
- }
- }
- if (str != "")
- {
- str.Remove(str.Length - 1);
- }
- return str;
- }
- //坐席接听数
- public string GetZxJt(string strtime)
- {
- DataTable dt = new DataTable();
- string str = "";
- for (int i = 1; i <= 12; i++)
- {
- string sqltimeCallRecords = "";
- string strmm = i.ToString();
- if (i <= 9)
- {
- strmm = "0" + i;
- }
- if (strtime != "")
- {
- sqltimeCallRecords += " and CONVERT(varchar , timecallin, 120)>=CONVERT(varchar , '" + strtime + "-" + strmm + "-01 00:00:01', 120) ";
- sqltimeCallRecords += " and CONVERT(varchar , timecallin, 120)<=CONVERT(varchar , '" + strtime + "-" + strmm + "-31 23:59:59', 120) ";
- }
- dt = DBUtility.DbHelperSQL.Query("select COUNT(*) as ct from rep_trunk_call_in where PeriodTalking>0 " + sqltimeCallRecords).Tables[0];
- if (dt != null && dt.Rows.Count > 0)
- {
- if (dt.Rows[0]["ct"].ToString() != "")
- {
- str += dt.Rows[0]["ct"].ToString() + ",";
- }
- else
- {
- str += "0,";
- }
- }
- else
- {
- str += "0,";
- }
- }
- if (str != "")
- {
- str.Remove(str.Length - 1);
- }
- return str;
- }
- //坐席接听率
- public string GetJTL(string strtime)
- {
- DataTable dt = new DataTable();
- string str = "";
- for (int i = 1; i <= 12; i++)
- {
- string sqltimeCallRecords = "";
- string strmm = i.ToString();
- if (i <= 9)
- {
- strmm = "0" + i;
- }
- if (strtime != "")
- {
- sqltimeCallRecords += " and CONVERT(varchar , timecallin, 120)>=CONVERT(varchar , '" + strtime + "-" + strmm + "-01 00:00:01', 120) ";
- sqltimeCallRecords += " and CONVERT(varchar , timecallin, 120)<=CONVERT(varchar , '" + strtime + "-" + strmm + "-31 23:59:59', 120) ";
- }
- dt = DBUtility.DbHelperSQL.Query("select COUNT(*) as ct,(select COUNT(*) from rep_trunk_call_in where PeriodTalking>0 " + sqltimeCallRecords + ") as jt from rep_trunk_call_in where 1=1 " + sqltimeCallRecords).Tables[0];
- int ibgnjt = 0;
- double ibgnjtl = 0.00;
-
- if (dt != null && dt.Rows.Count > 0)
- {
- if (dt.Rows[0]["jt"].ToString() != "")
- {
- ibgnjt = int.Parse(dt.Rows[0]["jt"].ToString());
- }
- if (dt.Rows[0]["ct"].ToString() != "" && dt.Rows[0]["ct"].ToString() != "0")
- {
- ibgnjtl = ibgnjt / Convert.ToDouble(dt.Rows[0]["ct"].ToString());
- str += (ibgnjtl * 100).ToString("0.00") + ",";
- }
- else
- {
- str += "0.00,";
- }
- }
- else
- {
- str += "0.00,";
- }
- }
- if (str != "")
- {
- str.Remove(str.Length - 1);
- }
- return str;
- }
- }
- }
|