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 直线的更多相关文章

  1. MFC中如何画带实心箭头的直线

    工作中遇到话流程图的项目,需要画带箭头的直线,经过摸索,解决:思路如下: (1) 两个点(p1,p2)确定一个直线,以直线的一个端点(假设p2)为原点,设定一个角度 (2)以P2为原点得到向量P2P1 ...

  2. 水平可见直线 bzoj 1007

    水平可见直线 (1s 128M) lines [问题描述] 在xoy直角坐标平面上有n条直线L1,L2,...Ln,若在y值为正无穷大处往下看,能见到Li的某个子线段,则称Li为可见的,否则Li为被覆 ...

  3. SVG:linearGradient渐变在直线上失效的问题解决方案

    SVG开发里有个较为少见的问题. 对x1=x2或者y1=y2的直线(line以及path),比如: <path d="M200,10 200,100" stroke=&quo ...

  4. 封装 用canvas绘制直线的函数--面向对象

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. [bzoj1007][HNOI2008][水平可见直线] (斜率不等式)

    Description 在xoy直角坐标平面上有n条直线L1,L2,...Ln,若在y值为正无穷大处往下看,能见到Li的某个子线段,则称Li为 可见的,否则Li为被覆盖的. 例如,对于直线: L1:y ...

  6. [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 ...

  7. 点(x3,y3)到经过点(x1,y1)和点(x2,y2)的直线的最短距离

    /// <summary> /// 点(x3,y3)到经过点(x1,y1)和点(x2,y2)的直线的最短距离 /// </summary> /// <param name ...

  8. CoreGraphics-基本图形绘制-直线、三角形、矩形、椭圆形、弧形

    框架:CoreGraphics 步骤: 1."获取"图形上下文     let cxtRef = UIGraphicsGetCurrentContext()! 2.添加路径 3.渲 ...

  9. 直线的参数方程ABC

    直线的参数方程的来源 如图所示, 直线\(l\)的倾斜角为\(\theta\),经过定点\(P_0(x_0,y_0)\),在直线上有一动点\(P(x,y)\),如果我们取直线的单位方向向量\(\vec ...

随机推荐

  1. 【传输协议】发送https请求,由于客户端jdk版本过高,服务端版本低。导致异常:javax.net.ssl.SSLHandshakeException: Server chose SSLv3, but that protocol version is not enabled or not supported by the client.

    本地环境jdk为1.8,服务器使用jdk版本未知.但发送https请求,抛出如下异常,解决方案. 一:发送异常内容如下 javax.net.ssl.SSLHandshakeException: Ser ...

  2. ES6必知必会 (九)—— Module

    Module 1.ES6在语言标准的层面上,实现了模块功能,成为浏览器和服务器通用的模块解决方案,完全可以取代 CommonJS 和 AMD 规范,基本特点如下: 每一个模块只加载一次, 每一个JS只 ...

  3. fusionjs 学习一 基本试用

    参考demo 项目 https://github.com/rongfengliang/fusionjs-docker-demo 安装 create startkit yarn global add c ...

  4. python删除x天前文件及文件夹

    #!/usr/bin/env python # -*- coding:utf-8 -*- import os, time, sys, shutil def delFiles(beforeSec, di ...

  5. PLSQL在64位 win7/WIN8上运行(绿色版plsql、无需安装oracle客户端)

    一.准备需要的文件: 1.plsql文件绿色压缩包 2.oracle客户端文件绿色压缩包 二.设置PLSQL 运行plsql,不登陆进入plsql点“工具”-“首选项” 按照如图设置“ oracle主 ...

  6. ELF文件和BIN文件

    文件的内容:1. BIN文件是 raw binary 文件,这种文件只包含机器码.2. ELF文件除了机器码外,还包含其它额外的信息,如段的加载地址,运行地址,重定位表,符号表等. 所以ELF文件的体 ...

  7. java正则表达式实战例子,持续更新,记下来后面就不用重新写了。。。

    1.去掉HTML标签: /** * 去掉HTML外面的标签 * @author CY * */ public class TrimHTML { public static void main(Stri ...

  8. 峰Spring4学习(6)spring AOP的应用例子

    一.AOP简介: 二.AOP实例: 三.使用的例子 需求:在student添加的前后,打印日志信息: 0)spring AOP需要引用的jar包: 1)StudentService.java接口: p ...

  9. find 和 find_all 用法

    soup = BeautifulSoup(requests.get(url).text, 'html.parser') soup.find('span', class_='item_hot_topic ...

  10. Java File文件操作 创建文件\目录,删除文件\目录

    Java手册 java.io 类 File java.lang.Object java.io.File 所有已实现的接口: Serializable, Comparable<File> p ...