void ReleaseDesignerOutlets() { if (DateText != null) { DateText.Dispose(); DateText = null; } if (HeadlineText != null) { HeadlineText.Dispose(); HeadlineText = null; } if (NewsImage != null) { NewsImage.Dispose(); NewsImage = null; } if (PreambleText != null) { PreambleText.Dispose(); PreambleText = null; } if (SourceLable != null) { SourceLable.Dispose(); SourceLable = null; } }
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"); }
public IActionResult Index(DateText dt) { try { if (ModelState.IsValid) { if (dt.Date == null) { dt.Date = FindDate(dt.Text); } db.dateTexts.Add(dt); db.SaveChanges(); } else { throw new Exception("Текстовое сообщение не может быть пустым"); } } catch (Exception ex) { ModelState.AddModelError("Text", ex.Message); } finally { var recs = db.dateTexts.OrderByDescending(x => x.Id).Take(3).ToList(); ViewBag.Records = recs; } return(View());// BadRequest(ex.Message); }
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 += "]"; }
private void SubmitSaleButton_Click(object sender, RoutedEventArgs e) { string[] Data = new string[5]; Data[0] = VehicleText.GetLineText(0); Data[1] = CustomerText.GetLineText(0); Data[2] = EmployeeText.GetLineText(0); Data[3] = DateText.GetLineText(0); Data[4] = PriceText.GetLineText(0); MakeSale S = new MakeSale(Data, cn); try { S.CreateSale(); } catch (OleDbException ex) { ErrorWindow Error = new ErrorWindow(ex.Message); Error.ShowDialog(); return; } VehicleText.Clear(); CustomerText.Clear(); EmployeeText.Clear(); DateText.Clear(); PriceText.Clear(); }
void ReleaseDesignerOutlets() { if (DateText != null) { DateText.Dispose(); DateText = null; } if (LoadButton != null) { LoadButton.Dispose(); LoadButton = null; } if (MemoText != null) { MemoText.Dispose(); MemoText = null; } if (SaveButton != null) { SaveButton.Dispose(); SaveButton = null; } if (SubjectText != null) { SubjectText.Dispose(); SubjectText = null; } }
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(); }
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(); }
protected void Btn_Month_Click(object sender, EventArgs e) { SiteTotalService stDal = new SiteTotalService(); IList <TopSiteTotalInfo> list = stDal.GetMonthOrderTotalInfoList(HttpUtility.UrlDecode(Request.Cookies["nick"].Value), DateTime.Now.Year.ToString()); SeriseText = "[{name:'订单量', data:["; string orderPay = ",{name:'订单金额',data:["; DateText = "["; for (int i = 1; i <= DateTime.Now.Month; i++) { DateText += "'" + i + "',"; bool notfind = true; foreach (TopSiteTotalInfo info in list) { if (info.SiteTotalDate.Substring(4, 1) == "0") { if (i.ToString() == info.SiteTotalDate.Substring(5)) { SeriseText += info.SiteOrderCount + ","; orderPay += info.SiteOrderPay + ","; notfind = false; break; } } else { if (i.ToString() == info.SiteTotalDate.Substring(4)) { SeriseText += info.SiteOrderCount + ","; orderPay += info.SiteOrderPay + ","; notfind = false; break; } } } if (notfind) { orderPay += "0,"; SeriseText += "0,"; } } SeriseText = SeriseText.Substring(0, SeriseText.Length - 1); SeriseText += "]}"; orderPay = orderPay.Substring(0, orderPay.Length - 1); orderPay += "]}"; SeriseText += orderPay + "]"; DateText = DateText.Substring(0, DateText.Length - 1); DateText += "]"; }
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"); }
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"); }
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 += "]"; }
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(); }
private void SetupDatePicker() { // close button var doneButton = new UIBarButtonItem("close", UIBarButtonItemStyle.Done, (s, e) => { // Close DatePicker DateText.ResignFirstResponder(); }); // toolbar var toolbar = new UIToolbar() { BarStyle = UIBarStyle.Default, Translucent = true, TintColor = null, }; // add closebutton and space on Toolbar toolbar.SizeToFit(); toolbar.SetItems(new [] { // space adjust , flexiblespace leads to right align for done button. new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), doneButton, }, true); // datepicker var datePicker = new UIDatePicker() { Mode = UIDatePickerMode.Date, }; // datepicker event datePicker.ValueChanged += (s, e) => { MemoHolder.Current.Memo.Date = (DateTime)datePicker.Date; DisplayMemo(); }; // set toolbar and datepicker set DateText.InputAccessoryView = toolbar; DateText.InputView = datePicker; }
private void SetupDatePicker() { var doneButton = new UIBarButtonItem("閉じる", UIBarButtonItemStyle.Done, (s, e) => { //DateTextのDatePickerを閉じる DateText.ResignFirstResponder(); }); //閉じるボタンを乗せるツールバー var toolbar = new UIToolbar() { BarStyle = UIBarStyle.Default, Translucent = true, TintColor = null, }; toolbar.SizeToFit(); toolbar.SetItems(new[] { new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), doneButton, }, true); //DatePicker var datePicker = new UIDatePicker() { Mode = UIDatePickerMode.Date, Locale = new NSLocale("ja_JP"), }; datePicker.ValueChanged += (s, e) => { MemoHolder.Current.Memo.Date = (DateTime)datePicker.Date; DisplayMemo(); }; //DateTextに作成したツールバーとDatePickerをセットする DateText.InputAccessoryView = toolbar; DateText.InputView = datePicker; }
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"); }
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"); }
private void InitFields() { var context = new PSOConnect(); var team = context.team.FirstOrDefault(teams => teams.idTeam == Login.CurrentUser.idTeam); foreach (var disaster in context.disaster) { SelectDisasterField.Items.Add($"{ disaster.idDisaster}-СТРАНА: { disaster.country} ГОРОД: { disaster.city} ДАТА: { disaster.date.Value.ToLongDateString()}"); if (team.idDisaster == null || team.idDisaster != disaster.idDisaster) { continue; } SelectDisasterField.SelectedItem = SelectDisasterField.Items[SelectDisasterField.Items.Count - 1]; _disaster = disaster; CountyResultText.Text = disaster.country.ToString(); CityResultText.Text = disaster.city.ToString(); DateResultText.Text = disaster.date.Value.ToShortDateString(); ReasonText.Text = disaster.reason.Count > 1 ? "Причины" : "Причина"; foreach (var reason in disaster.reason) { ListInfo.Items.Add($"ТИП: {reason.typeReason} ПРИЧИНА: {reason.reason1}"); } } NoFoundDisasterText.Hide(); if (team.idDisaster == null) { ListInfo.Hide(); ReasonText.Hide(); DateResultText.Hide(); DateText.Hide(); CountryText.Hide(); CountyResultText.Hide(); CityResultText.Hide(); CityText.Hide(); SelectDisasterField.Show(); SelectDisasterText.Show(); SelectedButton.Show(); CompletedButton.Hide(); if (SelectDisasterField.Items.Count > 0) { SelectDisasterField.SelectedIndex = 0; } else { SelectedButton.Hide(); NoFoundDisasterText.Show(); SelectDisasterField.Hide(); } } else { ListInfo.Show(); ReasonText.Show(); DateResultText.Show(); DateText.Show(); CountryText.Show(); CountyResultText.Show(); CityResultText.Show(); CityText.Show(); SelectDisasterField.Hide(); SelectDisasterText.Hide(); SelectedButton.Hide(); CompletedButton.Show(); } if (SelectDisasterField.Items.Count == 0) { SelectDisasterField.Hide(); NoFoundDisasterText.Show(); CompletedButton.Hide(); } }
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(); }
public DateEntry() : base() { CanFocus = true; Spacing = 2; int width, height; Icon.SizeLookup(icon_size, out width, out height); IconTheme theme = IconTheme.GetForScreen(Screen); entrycontents = new DrawingCellHBox(); entrycontents.PackStart(new DrawingCellNull(), true); entrycontents.Spacing = 0; string mask = GetShortMask(); labelcontents = new DrawingCellHBox(); entrycontents.PackEnd(labelcontents, false); labels[0] = new DateText(this, ResolveMode(mask[0])); labels[1] = new DateText(this, DataPart.Separator); labels[2] = new DateText(this, ResolveMode(mask[1])); labels[3] = new DateText(this, DataPart.Separator); labels[4] = new DateText(this, ResolveMode(mask[2])); foreach (DateText t in labels) { labelcontents.PackEnd(t, false); } clearimg = new DrawingCellActivePixbuf(this.RenderIcon(Stock.Clear, IconSize.Menu, "")); clearimg.Activated += delegate { OnClearData(); }; entrycontents.PackStart(clearimg, false); addimg = new DrawingCellActivePixbuf(this.RenderIcon(Stock.Add, IconSize.Menu, "")); addimg.Activated += delegate { OnStartCalculator(); }; entrycontents.PackStart(addimg, false); entry = new DrawingCellEntry(entrycontents); entry.SideCut = SideCut.Right; PackStart(entry, true); dropdown = new DrawingCellButton(new DrawingCellComboArrow()); dropdown.SideCut = SideCut.Left; dropdown.Activated += delegate { OnDropDown(); }; PackEnd(dropdown, false); Gtk.Drag.DestSet(this, DestDefaults.All, ValidTargets, Gdk.DragAction.Copy); DragDataReceived += HandleDragDataReceived; Gtk.Drag.SourceSet(this, Gdk.ModifierType.Button1Mask, ValidTargets, DragAction.Copy); DragBegin += HandleDragBegin; DragDataGet += HandleDragDataGet; }
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(); }
public DateEntry() : base() { CanFocus = true; Spacing = 2; int width, height; Icon.SizeLookup(icon_size, out width, out height); IconTheme theme = IconTheme.GetForScreen(Screen); entrycontents = new DrawingCellHBox(); entrycontents.PackStart (new DrawingCellNull(), true); entrycontents.Spacing = 0; string mask = GetShortMask(); labelcontents = new DrawingCellHBox(); entrycontents.PackEnd (labelcontents, false); labels[0] = new DateText (this, ResolveMode(mask[0])); labels[1] = new DateText (this, DataPart.Separator); labels[2] = new DateText (this, ResolveMode(mask[1])); labels[3] = new DateText (this, DataPart.Separator); labels[4] = new DateText (this, ResolveMode(mask[2])); foreach (DateText t in labels) labelcontents.PackEnd (t, false); clearimg = new DrawingCellActivePixbuf (this.RenderIcon(Stock.Clear, IconSize.Menu, "")); clearimg.Activated += delegate { OnClearData(); }; entrycontents.PackStart (clearimg, false); addimg = new DrawingCellActivePixbuf (this.RenderIcon(Stock.Add, IconSize.Menu, "")); addimg.Activated += delegate { OnStartCalculator(); }; entrycontents.PackStart (addimg, false); entry = new DrawingCellEntry (entrycontents); entry.SideCut = SideCut.Right; PackStart (entry, true); dropdown = new DrawingCellButton (new DrawingCellComboArrow()); dropdown.SideCut = SideCut.Left; dropdown.Activated += delegate { OnDropDown(); }; PackEnd (dropdown, false); Gtk.Drag.DestSet (this, DestDefaults.All, ValidTargets, Gdk.DragAction.Copy); DragDataReceived += HandleDragDataReceived; Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask, ValidTargets, DragAction.Copy); DragBegin += HandleDragBegin; DragDataGet += HandleDragDataGet; }