hra 直线
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;
// }
//}
}
}
hra 直线的更多相关文章
- MFC中如何画带实心箭头的直线
工作中遇到话流程图的项目,需要画带箭头的直线,经过摸索,解决:思路如下: (1) 两个点(p1,p2)确定一个直线,以直线的一个端点(假设p2)为原点,设定一个角度 (2)以P2为原点得到向量P2P1 ...
- 水平可见直线 bzoj 1007
水平可见直线 (1s 128M) lines [问题描述] 在xoy直角坐标平面上有n条直线L1,L2,...Ln,若在y值为正无穷大处往下看,能见到Li的某个子线段,则称Li为可见的,否则Li为被覆 ...
- SVG:linearGradient渐变在直线上失效的问题解决方案
SVG开发里有个较为少见的问题. 对x1=x2或者y1=y2的直线(line以及path),比如: <path d="M200,10 200,100" stroke=&quo ...
- 封装 用canvas绘制直线的函数--面向对象
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- [bzoj1007][HNOI2008][水平可见直线] (斜率不等式)
Description 在xoy直角坐标平面上有n条直线L1,L2,...Ln,若在y值为正无穷大处往下看,能见到Li的某个子线段,则称Li为 可见的,否则Li为被覆盖的. 例如,对于直线: L1:y ...
- [LeetCode] Line Reflection 直线对称
Given n points on a 2D plane, find if there is such a line parallel to y-axis that reflect the given ...
- 点(x3,y3)到经过点(x1,y1)和点(x2,y2)的直线的最短距离
/// <summary> /// 点(x3,y3)到经过点(x1,y1)和点(x2,y2)的直线的最短距离 /// </summary> /// <param name ...
- CoreGraphics-基本图形绘制-直线、三角形、矩形、椭圆形、弧形
框架:CoreGraphics 步骤: 1."获取"图形上下文 let cxtRef = UIGraphicsGetCurrentContext()! 2.添加路径 3.渲 ...
- 直线的参数方程ABC
直线的参数方程的来源 如图所示, 直线\(l\)的倾斜角为\(\theta\),经过定点\(P_0(x_0,y_0)\),在直线上有一动点\(P(x,y)\),如果我们取直线的单位方向向量\(\vec ...
随机推荐
- cocostudio 使用教程
项目配置 http://blog.csdn.net/chinahaerbin/article/details/21559351 项目配置如下: 还要引入命名空间之类的: #include " ...
- curl查询公网出口IP
liuzhizhi@lzz-rmbp|logs # curl ipinfo.io { "ip": "114.110.1.38", "hostname& ...
- docker默认配置文件不存在问题解决
Docker默认的配置文件/etc/default/docker或者/etc/sysconfig/docker都不起作用,查看了一下/lib/systemd/system/docker.service ...
- zipkin:mysql做存储,kafka做接收器,以及如何找到配置名称
mysql设定 1. 创建表结构: (源码路径)\zipkin-storage\mysql\src\main\resources\mysql.sql 2. zipkin的存储设置为mysql(coll ...
- jeecms一些经典标签
http://www.121ask.com/thread-5512-1.html [@cms_channel_list]标签详细介绍 http://www.jeecmstheme.com/2014/0 ...
- C#多线程编程之:Timer(定时器)使用示例
Timer类:设置一个定时器,定时执行用户指定的函数.定时器启动后,系统将自动建立一个新的线程,执行用户指定的函数. 构造函数:Timer(TimerCallback callback, object ...
- erlang和ruby互相调用
erlang调用ruby https://github.com/mojombo/erlectricity ruby调用erlang https://github.com/davebryson/rint ...
- unity代码添加动画,并传参数
测试界面 button一个 sprite一个 测试代码 public class BgObject : MonoBehaviour { void Start() { List<string> ...
- C# 如何捕获一个USB设备发送到PC的数据
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using Sy ...
- [html][javascript]父子窗体传值
父窗体 <script type="text/javascript"> newwindow = window.open("b1.html",&quo ...