首页 技术 正文
技术 2022年11月8日
0 收藏 427 点赞 1,664 浏览 5302 个字

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Framework;
using WebApp.Common;
using Contract.Domain;
using System.Collections;

namespace HraWeb
{
public partial class Report : JQEntityManage<MktPriceMarketData>
{
protected override void Page_Load(object sender, EventArgs e)
{
bool hasData = true;
string factorId = “”;
string startTime, endTime;
startTime = endTime = string.Empty;
IList list = null;
if (Request[“_method”] == “GetReport”)
{

startTime = Request[“txt_stratTime_”].ToString();
endTime = Request[“txt_endTime_”].ToString();
factorId = Request[“txt_select_”].ToString();
//if (string.IsNullOrEmpty(startTime) || string.IsNullOrEmpty(endTime))
//{
// hasData = false;
// string s =
// “<script>$.messager.alert(‘消息提示框’,’查询起止时间均不可为空’)</script>”;
// ClientScript.RegisterStartupScript(GetType(), “message”, s);

//}
//if (string.IsNullOrEmpty(factorId))
//{
// hasData = false;
// string s =
// “<script>$.messager.alert(‘消息提示框’,’必须选择查询的价格因子’)</script>”;
// ClientScript.RegisterStartupScript(GetType(), “message”, s);

//}

if (hasData != false)
{
Framework.QueryInfo info = new Framework.QueryInfo();

//info.QueryObject = “MktPriceMarketData”;
//if(!string.IsNullOrEmpty(startTime))
//info.AddParam(“CloseDate”, DateTime.Parse(startTime), ” and CloseDate>=:CloseDate”);
//if(!string.IsNullOrEmpty(endTime))
//info.AddParam(“CloseDate1″, DateTime.Parse(endTime), ” and CloseDate<=:CloseDate1″);
//if (!string.IsNullOrEmpty(factorId))
//{
// info.AddParam(“IndexPriceFactorId”, factorId);
//}

//info.OrderBy.Add(“CloseDate ASC”);
//list = Dao.FindByQueryInfo(info).List;
//if (list == null || list.Count <= 0)
//{
// string s = “没有查找到相关数据”;

// Response.Write(s);
// Response.End();
// //hasData = false;
// //string s =
// // “<script>$.messager.alert(‘消息提示框’,’当前报表查询不到数据请尝试换个时间段’)</script>”;
// //ClientScript.RegisterStartupScript(GetType(), “message”, s);

//}
string outputtext = “<script language=’javascript’ type=’text/javascript’>”;
//outputtext += “var vChart = new Visifire2(‘SL.Visifire.Charts.xap’, 800, 500);”;
var dataXml = “”;
dataXml += “<vc:Chart xmlns:vc=’clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts’ Width=’800′ Height=’500′ Theme=’Theme1′ BorderThickness=’0.5′ View3D=’False’ Watermark=’False’ ScrollingEnabled=’False’>”;
dataXml += “<vc:Chart.Titles><vc:Title Text=’分析图1’/></vc:Chart.Titles>”; //图形名称
dataXml += “<vc:Chart.AxesX><vc:Axis Title=’交易日期’></vc:Axis></vc:Chart.AxesX>”;//x轴名称
dataXml += “<vc:Chart.AxesY><vc:Axis Title=’中间价’ /></vc:Chart.AxesY>”;//y轴名称
dataXml += “<vc:Chart.Series>”;
//Width=’800′ Height=’500′
dataXml += “<vc:DataSeries LegendText=” RenderAs=’Line’ LabelEnabled=’true’ LabelStyle=’OutSide’ Cursor=’Hand’ LineThickness=’3′ LightingEnabled=’False’ >”;//LineThickness:线的粗细
dataXml += “<vc:DataSeries.DataPoints>”;
//to_date(‘2015/5/21′,’yyyy/mm/dd’)
info=new QueryInfo();
info.CustomSQL = @”select SimulationNumber, VarResultValue from RskBookResult
where ComputeDate =:ComputeDate
and RiskBookId = 4518
and ConfidenceLevel = ‘95%’
order by SimulationNumber”;
info.Parameters.Add(“ComputeDate”,new DateTime(2015,5,21));
IList lines = Dao.FindList(info);

Dictionary<decimal,decimal> lineDictionary=new Dictionary<decimal, decimal>();
foreach (var line in lines)
{
Object[] objs = line as Object[];
lineDictionary.Add(Decimal.Parse(objs[0].ToString()),Decimal.Parse(objs[1].ToString()));
}
foreach (var key in lineDictionary.Keys)
{
dataXml += string.Format(“<vc:DataPoint AxisXLabel='{0}’ YValue='{1}’/>”,key, lineDictionary[key]);//循环每个点 触发鼠标停留在某个点上时显示x轴和y轴的值
}
//for (int i = 0; i < list.Count; i++)
//{
// MktPriceMarketData entity = list[i] as MktPriceMarketData;
// dataXml += “<vc:DataPoint AxisXLabel='” + ((DateTime)entity.CloseDate).ToString(“yyyy-MM-dd”) + “‘ YValue='” + entity.MiddlePriceValue.ToString() + “‘/>”;//循环每个点 触发鼠标停留在某个点上时显示x轴和y轴的值

//}
dataXml += “</vc:DataSeries.DataPoints>”;
dataXml += “</vc:DataSeries>”;

dataXml += “</vc:Chart.Series>”;
dataXml += “</vc:Chart>”;
Response.Write(dataXml);
Response.End();

//outputtext += “var dataXml = \”” + dataXml + “\”;”;
//outputtext += “</script>”;
//json.InnerHtml = outputtext;

}
if (!string.IsNullOrEmpty(startTime))
{
txt_stratTime_.Value = startTime;
// txt_endTime_.Value = endTime;
// txt_select_.SelectedValue = factorId;
}
if (!string.IsNullOrEmpty(endTime))
{

txt_endTime_.Value = endTime;
// txt_select_.SelectedValue = factorId;
}
if (!string.IsNullOrEmpty(factorId))
{

txt_select_.SelectedValue = factorId;
}
}

base.Page_Load(sender, e);

}

public IList GetReportJson(string stratTime, string endTime)
{
Framework.QueryInfo info = new Framework.QueryInfo();
info.CustomSQL = string.Format(“select ResetDate,MiddlePriceValue from {0} where to_char(ResetDate,’yyyy-mm-dd’)>='{1}’ and to_char(ResetDate,’yyyy-mm-dd’)<='{2}'”, typeof(MktPriceMarketData).Name, stratTime, endTime);
IList list = Dao.FindByQueryInfo(info).List;
return list;
}

/// <summary>
/// 设置查询条件或者语句
/// </summary>
/// <returns></returns>
protected override Framework.QueryInfo SetInfo()
{
info = base.SetInfo();
return info;
}
/// <summary>
/// 初始化页面控件
/// </summary>
protected override void InitPage()
{
this.txt_stratTime_.Value = DateTime.Now.AddDays(-1).ToString(“yyyy-MM-dd”);
this.txt_endTime_.Value = DateTime.Now.ToString(“yyyy-MM-dd”);
base.InitPage();
BindDrop(“Id”, “IndexPriceFactorName”, “MktIndexPriceFactor”, txt_select_, “”);
// BindDrop(drp_Unit, “SPSW”, true);
}
//private Contract.IService.IMktPriceMarketDataService psvc;
///// <summary>
///// 初始化
///// </summary>
//Contract.IService.IMktPriceMarketDataService Psvc
//{
// get
// {
// if (psvc == null)
// {
// psvc = ctx.GetObject(“MktPriceMarketDataService”) as Contract.IService.IMktPriceMarketDataService;
// }
// return psvc;

// }
//}
}
}

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,075
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,551
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,399
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,176
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,811
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,893