Ejemplo n.º 1
0
    private void ShowChart(DateTime date)
    {
        string             nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value);
        List <TalkContent> list = (List <TalkContent>) new TalkRecodService().GetTalkTotalHour(nick, date, date.AddDays(1));

        SeriseText = "[{name:'接待人次', data:[";
        DateText   = "[";
        int nowhour = 23;

        if (date.ToShortDateString() == DateTime.Now.ToShortDateString())
        {
            nowhour = date.Hour;
        }
        for (int h = 0; h <= nowhour; h++)
        {
            DateText += "'" + h + "',";
            List <TalkContent> mylist = list.Where(o => o.time == h.ToString()).ToList();

            SeriseText += mylist.Count + ",";
        }

        SeriseText = SeriseText.Substring(0, SeriseText.Length - 1) + "]}]";

        DateText  = DateText.Substring(0, DateText.Length - 1);
        DateText += "]";
    }
Ejemplo n.º 2
0
    private void ShowChart(DateTime date)
    {
        string nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value);
        List <TopKefuTotalInfo> list = (List <TopKefuTotalInfo>) new TopKefuTotalService().GetNickCountTotal(date.ToString("yyyyMMdd"), nick);

        SeriseText = "[{name:'接待人次', data:[";
        DateText   = "[";

        if (list.Count == 0)
        {
            DateText   += "0,";
            SeriseText += "0,";
        }
        else
        {
            for (int h = 0; h < list.Count; h++)
            {
                DateText += "'" + (list[h].Nick.IndexOf(':') >= 0 ? list[h].Nick.Substring(list[h].Nick.IndexOf(':') + 1) : "主旺旺") + "',";

                SeriseText += list[h].CustomerCount + ",";
            }
        }
        SeriseText = SeriseText.Substring(0, SeriseText.Length - 1) + "]}]";

        DateText      = DateText.Substring(0, DateText.Length - 1);
        DateText     += "]";
        TB_Start.Text = date.ToString("yyyy-MM-dd");
    }
Ejemplo n.º 3
0
    private void ShowChart(DateTime start, DateTime end)
    {
        //两个时间差
        if (start > end)
        {
            Page.RegisterStartupScript("error", "<script>alert('时间选择有误!');</script>");
            return;
        }
        TaoBaoGoodsOrderService orderDal = new TaoBaoGoodsOrderService();
        IList <BackTotalInfo>   list     = orderDal.GetAllBackTotalList(start, end, HttpUtility.UrlDecode(Request.Cookies["nick"].Value));

        SeriseText = "[{name:'完成订单量', data:[";
        string iptotal = ",{name:'回头客数量',data:[";
        string avg     = ",{name:'回头客占比',data:[";

        DateText = "[";
        for (DateTime i = start; i <= end; i = i.AddDays(1))
        {
            DateText += "'" + i.ToString("yyyyMMdd").Substring(6, 2) + "',";
            IList <BackTotalInfo> mylist = list.Where(o => o.PDate == i.ToString("yyyyMMdd")).ToList();
            if (mylist.Count > 0)
            {
                BackTotalInfo info = mylist[0];
                iptotal    += info.PCount + ",";
                SeriseText += info.AllCount + ",";
                if (info.AllCount == 0)
                {
                    avg += "0,";
                }
                else
                {
                    avg += ((double)info.PCount / info.AllCount).ToString(".00") + ",";
                }
            }
            else
            {
                iptotal    += "0,";
                SeriseText += "0,";
                avg        += "0,";
            }
        }
        SeriseText  = SeriseText.Substring(0, SeriseText.Length - 1);
        SeriseText += "]}";
        iptotal     = iptotal.Substring(0, iptotal.Length - 1);
        iptotal    += "]}";
        avg         = iptotal + avg.Substring(0, avg.Length - 1);
        SeriseText += avg + "]}]";

        DateText      = DateText.Substring(0, DateText.Length - 1);
        DateText     += "]";
        TB_Start.Text = start.ToShortDateString();
        TB_End.Text   = end.ToShortDateString();
    }
Ejemplo n.º 4
0
    private void ShowChart(DateTime start, DateTime end)
    {
        //两个时间差
        if (start > end)
        {
            Page.RegisterStartupScript("error", "<script>alert('时间选择有误!');</script>");
            return;
        }
        SiteTotalService         stDal = new SiteTotalService();
        IList <TopSiteTotalInfo> list  = stDal.GetNickOrderTotal(start, end, HttpUtility.UrlDecode(Request.Cookies["nick"].Value));

        SeriseText = "[{name:'订单量', data:[";
        string orderPay = ",{name:'订单金额',data:[";
        string cusPay   = ",{name:'每单均价',data:[";

        DateText = "[";
        for (DateTime i = start; i <= end; i = i.AddDays(1))
        {
            DateText += "'" + i.ToString("yyyyMMdd").Substring(6, 2) + "',";
            IList <TopSiteTotalInfo> mylist = list.Where(o => o.SiteTotalDate == i.ToString("yyyyMMdd")).ToList();

            if (mylist.Count > 0)
            {
                SeriseText += mylist[0].SiteOrderCount + ",";
                orderPay   += mylist[0].SiteOrderPay + ",";
                if (mylist[0].SiteOrderCount == 0)
                {
                    cusPay += "0,";
                }
                else
                {
                    cusPay += ((double)mylist[0].SiteOrderPay / mylist[0].SiteOrderCount).ToString(".00") + ",";
                }
            }
            else
            {
                orderPay   += "0,";
                SeriseText += "0,";
                cusPay     += "0,";
            }
        }
        SeriseText  = SeriseText.Substring(0, SeriseText.Length - 1);
        SeriseText += "]}";
        orderPay    = orderPay.Substring(0, orderPay.Length - 1);
        orderPay   += "]}";
        cusPay      = orderPay + cusPay.Substring(0, cusPay.Length - 1);
        SeriseText += cusPay + "]}]";

        DateText      = DateText.Substring(0, DateText.Length - 1);
        DateText     += "]";
        TB_Start.Text = start.ToShortDateString();
        TB_End.Text   = end.ToShortDateString();
    }
Ejemplo n.º 5
0
    private void ShowChart(DateTime start, DateTime end)
    {
        //两个时间差
        if (start > end)
        {
            Page.RegisterStartupScript("error", "<script>alert('时间选择有误!');</script>");
            return;
        }

        string nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value);
        IList <TopSiteTotalInfo> list = new SiteTotalService().GetCustomerTotal(start.ToString("yyyyMMdd"), end.ToString("yyyyMMdd"), nick);

        SeriseText = "[{name:'客户数', data:[";
        string sucss   = ",{name:'订单金额', data:[";
        string onesell = ",{name:'客单价',data:[";

        DateText = "[";

        for (DateTime i = start; i <= end; i = i.AddDays(1))
        {
            DateText += "'" + i.ToString("yyyyMMdd").Substring(6, 2) + "',";
            IList <TopSiteTotalInfo> mylist = list.Where(o => o.SiteTotalDate == i.ToString("yyyyMMdd")).ToList();
            if (mylist.Count == 0)
            {
                SeriseText += "0,";
                sucss      += "0,";
                onesell    += "0,";
            }
            else
            {
                SeriseText += mylist.Sum(o => o.SiteBuyCustomTotal) + ",";
                sucss      += mylist.Sum(o => o.SiteOrderPay) + ",";
                if (mylist.Sum(o => o.SiteBuyCustomTotal) == 0)
                {
                    onesell += "0,";
                }
                else
                {
                    onesell += Math.Round(mylist.Sum(o => o.SiteOrderPay) / mylist.Sum(o => o.SiteBuyCustomTotal), 2).ToString() + ",";
                }
            }
        }

        SeriseText = SeriseText.Substring(0, SeriseText.Length - 1) + "]}";
        onesell    = onesell.Substring(0, onesell.Length - 1) + "]}";
        SeriseText = SeriseText + onesell + sucss.Substring(0, sucss.Length - 1) + "]}]";

        DateText      = DateText.Substring(0, DateText.Length - 1);
        DateText     += "]";
        TB_Start.Text = start.ToString("yyyy-MM-dd");
        TB_End.Text   = end.ToString("yyyy-MM-dd");
    }
Ejemplo n.º 6
0
    private void ShowChart(DateTime start, DateTime end)
    {
        //两个时间差
        if (start > end)
        {
            Page.RegisterStartupScript("error", "<script>alert('时间选择有误!');</script>");
            return;
        }

        string nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value);
        IList <TopKefuTotalInfo> list   = new TopKefuTotalService().GetKefuTotalDay(start, end, nick);
        IList <TopSiteTotalInfo> stlist = new SiteTotalService().GetNickOrderTotal(start, end, nick);

        SeriseText = "[{name:'询单数', data:[";
        string sucss = ",{name:'成功下单数', data:[";

        DateText = "[";

        for (DateTime i = start; i <= end; i = i.AddDays(1))
        {
            DateText += "'" + i.ToString("yyyyMMdd").Substring(6, 2) + "',";
            IList <TopKefuTotalInfo> mylist = list.Where(o => o.NickDate == i.ToString("yyyyMMdd")).ToList();
            if (mylist.Count == 0)
            {
                SeriseText += "0,";
                sucss      += "0,";
            }
            else
            {
                List <TopSiteTotalInfo> mystlist = stlist.Where(o => o.SiteTotalDate == i.ToString("yyyyMMdd")).ToList();
                if (mylist.Count == 0)
                {
                    SeriseText += "0,";
                }
                else
                {
                    SeriseText += mystlist[0].AskOrder + ",";
                }
                sucss += mylist.Sum(o => o.OrderCount) + ",";
            }
        }

        SeriseText = SeriseText.Substring(0, SeriseText.Length - 1) + "]}";
        SeriseText = SeriseText + sucss.Substring(0, sucss.Length - 1) + "]}]";

        DateText      = DateText.Substring(0, DateText.Length - 1);
        DateText     += "]";
        TB_Start.Text = start.ToString("yyyy-MM-dd");
        TB_End.Text   = end.ToString("yyyy-MM-dd");
    }
Ejemplo n.º 7
0
    private void ShowChart(string start, string end, UserAdsInfo info)
    {
        string            id   = Request.QueryString["id"];
        IList <ClickInfo> list = new ClickService().SelectAllClickCount(new Guid(id), start, end);

        SeriseText = "[{name:'点击量', data:[";
        DateText   = "[";
        for (DateTime h = DateTime.Parse(DateTime.Now.AddDays(-14).ToShortDateString()); h <= DateTime.Parse(DateTime.Now.ToShortDateString()); h = h.AddDays(1))
        {
            DateText += "'" + h.Day + "',";
            IList <ClickInfo> thisInfo = list.Where(o => o.ClickDate == h.ToString("yyyyMMdd")).ToList();


            if (thisInfo.Count == 0)
            {
                if (DateTime.Parse(info.AddTime.ToShortDateString()) <= h)
                {
                    SeriseText += "1,";
                }
                else
                {
                    SeriseText += "0,";
                }
            }
            else
            {
                if (thisInfo[0].ClickCount == 0)
                {
                    if (DateTime.Parse(info.AddTime.ToShortDateString()) <= h)
                    {
                        SeriseText += "1,";
                    }
                    else
                    {
                        SeriseText += thisInfo[0].ClickCount + ",";
                    }
                }
                else
                {
                    SeriseText += thisInfo[0].ClickCount + ",";
                }
            }
        }
        SeriseText  = SeriseText.Substring(0, SeriseText.Length - 1);
        SeriseText += "]}]";

        DateText  = DateText.Substring(0, DateText.Length - 1);
        DateText += "]";
    }
Ejemplo n.º 8
0
    private void ShowChart(DateTime start, DateTime end)
    {
        //两个时间差
        if (start > end)
        {
            Page.RegisterStartupScript("error", "<script>alert('时间选择有误!');</script>");
            return;
        }
        SiteTotalService         stDal = new SiteTotalService();
        IList <TopSiteTotalInfo> list  = stDal.GetNickOrderTotal(start, end, HttpUtility.UrlDecode(Request.Cookies["nick"].Value));

        SeriseText = "[{name:'PV量', data:[";
        string uvtotal   = ",{name:'UV量',data:[";
        string backtotal = ",{name:'浏览回头客',data:[";

        DateText = "[";
        for (DateTime i = start; i <= end; i = i.AddDays(1))
        {
            DateText += "'" + i.ToString("yyyyMMdd").Substring(6, 2) + "',";
            IList <TopSiteTotalInfo> mylist = list.Where(o => o.SiteTotalDate == i.ToString("yyyyMMdd")).ToList();

            if (mylist.Count > 0)
            {
                SeriseText += mylist[0].SitePVCount + ",";
                uvtotal    += mylist[0].SiteUVCount + ",";
                backtotal  += mylist[0].SiteUVBack + ",";
            }
            else
            {
                uvtotal    += "0,";
                SeriseText += "0,";
                backtotal  += "0,";
            }
        }
        SeriseText  = SeriseText.Substring(0, SeriseText.Length - 1);
        SeriseText += "]}";
        uvtotal     = uvtotal.Substring(0, uvtotal.Length - 1);
        uvtotal    += "]}";
        backtotal   = uvtotal + backtotal.Substring(0, backtotal.Length - 1);
        SeriseText += backtotal + "]}]";

        DateText      = DateText.Substring(0, DateText.Length - 1);
        DateText     += "]";
        TB_Start.Text = start.ToShortDateString();
        TB_End.Text   = end.ToShortDateString();
    }
    private void ShowChart(DateTime date)
    {
        if (date.ToShortDateString() != DateTime.Now.ToShortDateString())
        {
            Btn_Totay.Visible = true;
        }
        //大于今天
        if (DateTime.Parse(date.ToShortDateString()) > DateTime.Parse(DateTime.Now.ToShortDateString()))
        {
            TB_Start.Text = HF_Date.Value;
            return;
        }
        TaoBaoGoodsOrderService orderDal = new TaoBaoGoodsOrderService();
        IList <GoodsOrderInfo>  list     = orderDal.GetHourOrderTotal(DateTime.Parse(date.ToShortDateString()), DateTime.Parse(date.AddDays(1).ToShortDateString()), HttpUtility.UrlDecode(Request.Cookies["nick"].Value));

        SeriseText = "[{name:'订单量', data:[";
        DateText   = "[";
        int nowhour = 23;

        if (date.ToShortDateString() == DateTime.Now.ToShortDateString())
        {
            nowhour = date.Hour;
        }
        for (int h = 0; h <= nowhour; h++)
        {
            DateText += "'" + h + "',";
            IList <GoodsOrderInfo> thisInfo = list.Where(o => o.OrderTotal == h).ToList();

            if (thisInfo.Count == 0)
            {
                SeriseText += "0,";
            }
            else
            {
                SeriseText += (int)thisInfo[0].payment + ",";
            }
        }
        SeriseText  = SeriseText.Substring(0, SeriseText.Length - 1);
        SeriseText += "]}]";

        DateText      = DateText.Substring(0, DateText.Length - 1);
        DateText     += "]";
        TB_Start.Text = date.ToShortDateString();
        HF_Date.Value = date.ToShortDateString();
    }
Ejemplo n.º 10
0
    private void ShowChart(DateTime start, DateTime end)
    {
        //两个时间差
        if (start > end)
        {
            Page.RegisterStartupScript("error", "<script>alert('时间选择有误!');</script>");
            return;
        }

        string nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value);
        List <TopSiteTotalInfo> list = new SiteTotalService().GetZuanZhanTotal(start.ToString("yyyyMMdd"), end.ToString("yyyyMMdd"), nick);

        SeriseText = "[{name:'钻展流量', data:[";
        DateText   = "[";

        for (DateTime i = start; i <= end; i = i.AddDays(1))
        {
            DateText += "'" + i.ToString("yyyyMMdd").Substring(6, 2) + "',";
            IList <TopSiteTotalInfo> mylist = list.Where(o => o.SiteTotalDate == i.ToString("yyyyMMdd")).ToList();
            if (mylist.Count == 0)
            {
                SeriseText += "0,";
            }
            else
            {
                SeriseText += mylist[0].SiteZuanZhan + ",";
            }
        }

        SeriseText = SeriseText.Substring(0, SeriseText.Length - 1) + "]}]";

        DateText      = DateText.Substring(0, DateText.Length - 1);
        DateText     += "]";
        TB_Start.Text = start.ToString("yyyy-MM-dd");
        TB_End.Text   = end.ToString("yyyy-MM-dd");
    }
Ejemplo n.º 11
0
    private void ShowChart(DateTime date)
    {
        if (date.ToShortDateString() != DateTime.Now.ToShortDateString())
        {
            Btn_Totay.Visible = true;
        }
        //大于今天
        if (DateTime.Parse(date.ToShortDateString()) > DateTime.Parse(DateTime.Now.ToShortDateString()))
        {
            TB_Start.Text = HF_Date.Value;
            return;
        }
        VisitService          visitDal = new VisitService();
        IList <HourTotalInfo> list     = visitDal.GetHourZhiTongOrZuanZhanPVTotal(DataHelper.Encrypt(HttpUtility.UrlDecode(Request.Cookies["nick"].Value)), date, true);

        IList <HourTotalInfo> zuanlist = visitDal.GetHourZhiTongOrZuanZhanPVTotal(DataHelper.Encrypt(HttpUtility.UrlDecode(Request.Cookies["nick"].Value)), date, false);


        SeriseText = "[{name:'直通车量', data:[";
        string iptotal = ",{name:'钻展流量',data:[";

        DateText = "[";
        int nowhour = 23;

        if (date.ToShortDateString() == DateTime.Now.ToShortDateString())
        {
            nowhour = date.Hour;
        }
        for (int h = 0; h <= nowhour; h++)
        {
            DateText += "'" + h + "',";
            IList <HourTotalInfo> thisInfo     = list.Where(o => o.Hour == h).ToList();
            IList <HourTotalInfo> thiszuanInfo = zuanlist.Where(o => o.Hour == h).ToList();

            if (thisInfo.Count == 0)
            {
                SeriseText += "0,";
            }
            else
            {
                SeriseText += thisInfo[0].PVCount + ",";
            }

            if (thiszuanInfo.Count == 0)
            {
                iptotal += "0,";
            }
            else
            {
                iptotal += thiszuanInfo[0].PVCount + ",";
            }
        }
        SeriseText = SeriseText.Substring(0, SeriseText.Length - 1) + "]}";
        iptotal    = iptotal.Substring(0, iptotal.Length - 1) + "]}";
        SeriseText = SeriseText + iptotal + "]";

        DateText      = DateText.Substring(0, DateText.Length - 1);
        DateText     += "]";
        TB_Start.Text = date.ToShortDateString();
        HF_Date.Value = date.ToShortDateString();
    }
Ejemplo n.º 12
0
    private void ShowChart(DateTime date)
    {
        if (date.ToShortDateString() != DateTime.Now.ToShortDateString())
        {
            Btn_Totay.Visible = true;
        }
        //大于今天
        if (DateTime.Parse(date.ToShortDateString()) > DateTime.Parse(DateTime.Now.ToShortDateString()))
        {
            TB_Start.Text = HF_Date.Value;
            return;
        }
        VisitService          visitDal = new VisitService();
        IList <HourTotalInfo> list     = visitDal.GetHourPVTotal(Encrypt(HttpUtility.UrlDecode(Request.Cookies["nick"].Value)), date);
        IList <HourTotalInfo> ipList   = visitDal.GetHourIPTotal(Encrypt(HttpUtility.UrlDecode(Request.Cookies["nick"].Value)), date);

        SeriseText = "[{name:'PV量', data:[";
        string iptotal = ",{name:'IP量',data:[";
        string avg     = ",{name:'人均浏览次数',data:[";

        DateText = "[";
        int nowhour = 23;

        if (date.ToShortDateString() == DateTime.Now.ToShortDateString())
        {
            nowhour = date.Hour;
        }
        for (int h = 0; h <= nowhour; h++)
        {
            DateText += "'" + h + "',";
            IList <HourTotalInfo> thisInfo   = list.Where(o => o.Hour == h).ToList();
            IList <HourTotalInfo> thisIpInfo = ipList.Where(o => o.Hour == h).ToList();

            if (thisIpInfo.Count == 0)
            {
                iptotal += "0,";
            }
            else
            {
                iptotal += thisIpInfo[0].PVCount + ",";
            }

            if (thisInfo.Count == 0)
            {
                SeriseText += "0,";
            }
            else
            {
                SeriseText += thisInfo[0].PVCount + ",";
            }

            if (thisIpInfo.Count == 0)
            {
                avg += "0,";
            }
            else
            {
                avg += ((double)thisInfo[0].PVCount / thisIpInfo[0].PVCount).ToString(".00") + ",";
            }
        }
        SeriseText  = SeriseText.Substring(0, SeriseText.Length - 1);
        SeriseText += "]}";
        iptotal     = iptotal.Substring(0, iptotal.Length - 1);
        iptotal    += "]}";
        avg         = iptotal + avg.Substring(0, avg.Length - 1);
        SeriseText += avg + "]}]";

        DateText      = DateText.Substring(0, DateText.Length - 1);
        DateText     += "]";
        TB_Start.Text = date.ToShortDateString();
        HF_Date.Value = date.ToShortDateString();
    }
Ejemplo n.º 13
0
    private void ShowChart(DateTime start, DateTime end)
    {
        //两个时间差
        if (start > end)
        {
            Page.RegisterStartupScript("error", "<script>alert('时间选择有误!');</script>");
            return;
        }
        TaoBaoGoodsOrderService tboDal = new TaoBaoGoodsOrderService();
        IList <PingJiaInfo>     list   = tboDal.GetPingjiaTotal(start, end, HttpUtility.UrlDecode(Request.Cookies["nick"].Value));

        SeriseText = "[{name:'好评', data:[";
        string zhong = ",{name:'中评',data:[";
        string cha   = ",{name:'差评',data:[";
        string nop   = ",{name:'尚未评价',data:[";

        DateText = "[";
        for (DateTime i = start; i <= end; i = i.AddDays(1))
        {
            DateText += "'" + i.ToString("yyyyMMdd").Substring(6, 2) + "',";
            IList <PingJiaInfo> mylist = list.Where(o => o.pdate == i.ToString("yyyyMMdd")).ToList();

            if (mylist.Count > 0)
            {
                if (mylist.Where(o => o.result == "good").ToList().Count > 0)
                {
                    SeriseText += mylist.Where(o => o.result == "good").ToList()[0].pcount + ",";
                }
                else
                {
                    SeriseText += "0,";
                }
                if (mylist.Where(o => o.result == "neutral").ToList().Count > 0)
                {
                    zhong += mylist.Where(o => o.result == "neutral").ToList()[0].pcount + ",";
                }
                else
                {
                    zhong += "0,";
                }
                if (mylist.Where(o => o.result == "bad").ToList().Count > 0)
                {
                    cha += mylist.Where(o => o.result == "bad").ToList()[0].pcount + ",";
                }
                else
                {
                    cha += "0,";
                }
                if (mylist.Where(o => o.result == "").ToList().Count > 0)
                {
                    nop += mylist.Where(o => o.result == "").ToList()[0].pcount + ",";
                }
                else
                {
                    nop += "0,";
                }
            }
            else
            {
                zhong      += "0,";
                SeriseText += "0,";
                cha        += "0,";
                nop        += "0,";
            }
        }
        SeriseText  = SeriseText.Substring(0, SeriseText.Length - 1);
        SeriseText += "]}";
        zhong       = zhong.Substring(0, zhong.Length - 1);
        zhong      += "]}";
        cha         = zhong + cha.Substring(0, cha.Length - 1);
        cha        += "]}";
        nop         = cha + nop.Substring(0, nop.Length - 1);
        SeriseText += nop + "]}]";

        DateText      = DateText.Substring(0, DateText.Length - 1);
        DateText     += "]";
        TB_Start.Text = start.ToString("yyyy-MM-dd");
        TB_End.Text   = end.ToString("yyyy-MM-dd");
    }