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. spring-security-4 (2)spring security 基于Java配置的搭建

    一.spring security的模块 搭建spring security首先我们要导入必须的jar,即maven的依赖.spring security按模块划分,一个模块对应一个jar. spri ...

  2. 捕捉过滤器(CaptureFilters)和显示过滤器(DisplayFilters)--Wireshark

    Wireshark的基本使用——过滤器 前言 网络上关于Wireshark的教程已有不少,博主就简单介绍一下Wireshark分析数据包时最重要的技巧之一的过滤器..一次性嗅探到的数据包有很多,想要高 ...

  3. 关于 unable to load shared object 'C:\Program Files\R\R-3.0.3\library\stats\libs\i386\stats.dll'

    其实这个问题很简单就是,在R目录下的:C:\Program Files\R\R-3.0.3\library\stats\libs\i386这个目录下,拷贝一份:这个目录下的文件:C:\Program ...

  4. Javascript-自己定义对象转换成JSon后怎样再转换回自己定义对象

    man是自己定义的对象,使用var tim = JSON.stringify(man); var newman=JSON.parse(tim)后newman的类型是"object" ...

  5. A Newbie’s Install of Keras & Tensorflow on Windows 10 with R

    This weekend, I decided it was time: I was going to update my Python environment and get Keras and T ...

  6. javascript系列--Object.assign实现浅拷贝的原理以及实现

    一.前言 之前在前面一篇学习了赋值,浅拷贝和深拷贝.介绍了这三者的相关知识和区别. 传送门:https://www.mwcxs.top/page/592.html 本文会介绍浅拷贝Object.ass ...

  7. springMvc上传文件、读取zip/rar文件

    参考文章: http://www.cnblogs.com/interdrp/p/6734033.html 方法一: 1)没有配置org.springframework.web.multipart.co ...

  8. eclipse调试时增加jvm参数

    下面的程中我们限制Java 堆的大小为20MB,不可扩展(将堆的最小值-Xms 参数与最大值-Xmx 参数设置为一样即可避免堆自动扩展),通过参数-XX:+HeapDumpOnOutOfMemoryE ...

  9. 二货Mysql中设置字段的默认值问题

    Mysql设置字段的默认值的确很落伍 1.不支持函数 2.只支持固定常量. 经常用到的日期类型,因为不支持getdate或者now函数,所以只能设置timestamp类型 而且还必须在默认值那个地方写 ...

  10. ThreadPoolExecutor – Java Thread Pool Example

    https://www.journaldev.com/1069/threadpoolexecutor-java-thread-pool-example-executorservice   Java t ...