12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using SCC.Models;
- namespace SCC.Crawler.DT
- {
- /// <summary>
- /// 走势图帮助类
- /// </summary>
- public class TrendChartItemHelper<TEntity> where TEntity : LotteryOpenCode
- {
- /// <summary>
- /// 初始化走势图的各项
- /// </summary>
- /// <param name="chartCssConfigs">走势图样式配置列表</param>
- /// <param name="trendChartItems">走势图的项的列表</param>
- /// <returns></returns>
- public List<TrendChartItem<TEntity>> InitTrendChartItem(List<ChartCssConfigInfo> chartCssConfigs, List<TrendChartItemInfo> trendChartItems)
- {
- List<TrendChartItem<TEntity>> result = new List<TrendChartItem<TEntity>>(trendChartItems.Count);
- TrendChartItem<TEntity> item = null;
- for (var i = 0; i < trendChartItems.Count; i++)
- {
- if (trendChartItems[i].ClassName == ChartItemClassName.SingleValue)
- item = new SingleValueTrendChartItem<TEntity>();
- else if (trendChartItems[i].ClassName == ChartItemClassName.MultiValue)
- item = new MultiValueTrendChartItem<TEntity>();
- else if (trendChartItems[i].ClassName == ChartItemClassName.SpecialValue)
- item = new SpecialValueTrendChartItem<TEntity>();
- var cssItem = chartCssConfigs.Where(C => C.Id == trendChartItems[i].ChartCssId && C.FuntionTypeCss == (int)trendChartItems[i].FuntionType).FirstOrDefault();
- item.Init(cssItem, trendChartItems[i]);
- result.Add(item);
- }
- return result;
- }
- }
- /// <summary>
- /// 走势图的项的帮助类
- /// </summary>
- public abstract class TrendChartItem<TEntity> where TEntity : LotteryOpenCode
- {
- #region TrendChartItem 成员
- public abstract bool SetItemValue(TEntity entity);
- public abstract bool SetItemValue(TEntity entity, TEntity lastentity);
- public abstract string GetFomartString(string fomart, ChartCssConfigInfo cssConfig = null);
- #endregion
- /// <summary>
- /// 初始化走势图基本帮助类
- /// </summary>
- /// <param name="cssConfig"></param>
- /// <param name="itemConfig"></param>
- public void Init(ChartCssConfigInfo cssConfig, TrendChartItemInfo itemConfig)
- {
- this._itemConfig = itemConfig;
- this._localMiss = new int[this._itemConfig.ItemCount];
- this._cssConfig = cssConfig;
- }
- /// <summary>
- /// 初使化遗漏
- /// </summary>
- /// <param name="TrendChartCofig">遗漏数据(参考项,一般为前一期的遗漏数据)</param>
- /// <param name="i">项索引</param>
- public void InitMissData(TrendChartData TrendChartCofig, int i)
- {
- if (1 >= this._itemConfig.ItemCount)
- return;
- this._maxMiss = new int[this._itemConfig.ItemCount];
- this._avgMiss = new int[this._itemConfig.ItemCount];
- this._localMiss = new int[this._itemConfig.ItemCount];
- this._lastMiss = new int[this._itemConfig.ItemCount];
- this._times = new int[this._itemConfig.ItemCount];
- if (null == TrendChartCofig)
- return;
- this._recordCount = TrendChartCofig.RecordCount;
- //初使化上期遗漏
- string[] array = TrendChartCofig.LastMiss[i].Split(',');
- for (int j = array.Length - 1; j >= 0; j--)
- {
- this._lastMiss[j] = Convert.ToInt32(array[j]);
- }
- //初使化本期遗漏
- array = TrendChartCofig.LocalMiss[i].Split(',');
- for (int j = array.Length - 1; j >= 0; j--)
- {
- this._localMiss[j] = Convert.ToInt32(array[j]);
- }
- //初使化出现次数
- array = TrendChartCofig.AllTimes[i].Split(',');
- for (int j = array.Length - 1; j >= 0; j--)
- {
- this._times[j] = Convert.ToInt32(array[j]);
- }
- //初使化最大遗漏
- array = TrendChartCofig.AllMaxMiss[i].Split(',');
- for (int j = array.Length - 1; j >= 0; j--)
- {
- this._maxMiss[j] = Convert.ToInt32(array[j]);
- }
- //初使化平均遗漏
- array = TrendChartCofig.AllAvgMiss[i].Split(',');
- for (int j = array.Length - 1; j >= 0; j--)
- {
- this._avgMiss[j] = Convert.ToInt32(array[j]);
- }
- }
- /// <summary>
- /// 获取遗漏数据
- /// </summary>
- /// <param name="missDataType"></param>
- /// <returns></returns>
- public string GetMissData(MissDataType missDataType)
- {
- if (1 >= this._itemConfig.ItemCount)
- return "-1";
- switch (missDataType)
- {
- case MissDataType.AllAvgMiss:
- return GetMissDataString(this._avgMiss);
- case MissDataType.AllMaxMiss:
- return GetMissDataString(this._maxMiss);
- case MissDataType.AllTimes:
- return GetMissDataString(this._times);
- case MissDataType.LastMiss:
- return GetMissDataString(this._lastMiss);
- case MissDataType.LocalMiss:
- return GetMissDataString(this._localMiss);
- default:
- return "";
- }
- }
- /// <summary>
- /// 字符串返回遗漏数据(已逗号分隔)
- /// </summary>
- /// <param name="missDataArray">遗漏数据</param>
- /// <returns></returns>
- private string GetMissDataString(int[] missDataArray)
- {
- StringBuilder sb = new StringBuilder(missDataArray.Length * 5);
- for (int i = 0; i < missDataArray.Length; i++)
- {
- sb.Append(missDataArray[i].ToString() + ",");
- }
- return sb.ToString().TrimEnd(',');
- }
- /// <summary>
- /// 通用获取HTML部分的结构和样式
- /// </summary>
- /// <param name="fomart"></param>
- /// <param name="cssConfig"></param>
- /// <returns></returns>
- protected Tuple<string, string, string, string> GetFomartHTML(string fomart, ChartCssConfigInfo cssConfig = null)
- {
- string _fomart = fomart;
- string _cssNumber = "", _cssMiss = "", _lineColor = "";
- if (string.IsNullOrEmpty(_fomart))
- _fomart = "<td {0}>{1}</td>";
- _fomart = string.Format(_fomart, "class=\"{0}\"{1}", "{2}");
- var css = this._cssConfig;
- if (null != cssConfig)
- css = cssConfig;
- if (null != css)
- {
- _cssNumber = css.NumberCssName;
- _cssMiss = css.MissCssName;
- _lineColor = css.LineColor;
- }
- return new Tuple<string, string, string, string>(_fomart, _cssNumber, _cssMiss, _lineColor);
- }
- /// <summary>
- /// 根据是否画线和是否是项值判断画线(只有项值才画线)
- /// </summary>
- /// <param name="isValue">是否是项值</param>
- /// <param name="color">画线颜色(有默认值)</param>
- /// <returns></returns>
- protected string GetlgroupAndColor(bool isValue, string color)
- {
- if (this._itemConfig.DrawLine && isValue)
- {
- return " lgroup=\"" + this._cssConfig.Id + "\" lcolor=\"" + color + "\"";
- }
- return "";
- }
- #region 样式设置
- public string GetHtml(bool isValue, string fomart, string attr, string itemValue, int index)
- {
- string value = "";
- switch (this._itemConfig.FuntionType)
- {
- #region 多值
- case ChartItemType.MultiValue_ZheHaoNumber:
- value = CssValueFunction.MultiValue_ZheHaoNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.MultiValue_XieLianHaoNumber:
- value = CssValueFunction.MultiValue_XieLianHaoNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.MultiValue_XieTiaoHaoNumber:
- value = CssValueFunction.MultiValue_XieTiaoHaoNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.MultiValue_ShuSanLianHaoNumber:
- value = CssValueFunction.MultiValue_ShuSanLianHaoNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.MultiValue_OpenCodeItem:
- //多值多值开奖号
- value = CssValueFunction.MultiValue_OpenCodeItem(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.MultiValue_LinkNumber:
- //多值多列重号
- value = CssValueFunction.MultiValue_LinkNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.MultiValue_ShuTiaoHaoNumber:
- //多值多列坚跳号
- value = CssValueFunction.MultiValue_ShuTiaoHaoNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //多值多列重号分布
- case ChartItemType.MultiValue_RepeatNumber:
- value = CssValueFunction.MultiValue_RepeatNumber(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.MultiValue_K3ebt:
- value = CssValueFunction.SetK3ebtItemValue(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.MultiValue_Ebtxt:
- value = CssValueFunction.SetEbtxtItemValue(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.MultiValue_Sbtxt:
- value = CssValueFunction.SetSbtxtItemValue(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- #endregion
- #region 单值
- //单值单列期号
- case ChartItemType.Term_TermItem:
- value = CssValueFunction.SingleCell_TermItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列和尾
- case ChartItemType.SingleCell_HeWeiItem:
- value = CssValueFunction.SingleCell_HeWeiItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列开奖号码
- case ChartItemType.SingleCell_OpenCodeItem:
- value = CssValueFunction.SingleCell_OpenCodeItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列012比
- case ChartItemType.SingleCell_ProportionOf012Item:
- value = CssValueFunction.SingleCell_ProportionOf012Item(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列奇偶比例
- case ChartItemType.SingleCell_ProportionOfJoItem:
- value = CssValueFunction.SingleCell_ProportionOfJoItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列大小比例
- case ChartItemType.SingleCell_ProportionOfDxItem:
- value = CssValueFunction.SingleCell_ProportionOfDxItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列质合比例
- case ChartItemType.SingleCell_ProportionOfZhItem:
- value = CssValueFunction.SingleCell_ProportionOfZhItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列跨度
- case ChartItemType.SingleCell_SpanItem:
- value = CssValueFunction.SingleCell_SpanItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列组三跨度
- case ChartItemType.SingleCell_ZSSpanItem:
- value = CssValueFunction.SingleCell_ZSSpanItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列和值
- case ChartItemType.SingleCell_SumItem:
- value = CssValueFunction.SingleCell_SumItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列开奖号码和值奇偶分布
- case ChartItemType.SingleValue_HzJoStatusItem:
- value = CssValueFunction.SingleValue_HzJoStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列开奖号码和值大小分布
- case ChartItemType.SingleValue_HzDxStatusItem:
- value = CssValueFunction.SingleValue_HzDxStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleValue_DxStatusItem:
- break;
- case ChartItemType.SingleValue_JoStatusItem:
- break;
- //单值单列期试机号
- case ChartItemType.SingleCell_ShiJiHao:
- value = CssValueFunction.SingleCell_ShiJiHaoItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列试机号分布
- case ChartItemType.SingleValue_ShiJiHao:
- value = CssValueFunction.SingleValue_ShiJiHao(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列组三形态
- case ChartItemType.SingleValue_ZsStatusItem:
- value = CssValueFunction.SingleValue_ZsStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列组三奇偶形态
- case ChartItemType.SingleValue_ZsJoStatusItem:
- value = CssValueFunction.SingleValue_ZsJoStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列开奖号012路值
- case ChartItemType.SingleCell_012StatusItem:
- value = CssValueFunction.SingleCell_012StatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列和尾分布项
- case ChartItemType.SingleValue_HeWeiItem:
- value = CssValueFunction.SingleValue_HeWeiItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列奇偶状态项
- case ChartItemType.SingleValue_JiOuStatusItem:
- value = CssValueFunction.SingleValue_JiOuStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列大小状态项
- case ChartItemType.SingleValue_DaXiaoStatusItem:
- value = CssValueFunction.SingleValue_DaXiaoStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列012分布项
- case ChartItemType.SingleValue_Number012StatusItem:
- value = CssValueFunction.SingleValue_Number012StatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列号码项
- case ChartItemType.SingleValue_NumberItem:
- value = CssValueFunction.SingleValue_NumberItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列多于两个号码跨度
- case ChartItemType.SingleValue_SpanItem:
- value = CssValueFunction.SingleValue_SpanItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列两个号码跨度
- case ChartItemType.SingleValue_SpanNumberItem:
- value = CssValueFunction.SingleValue_SpanNumberItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列开奖号码和值分布
- case ChartItemType.SingleValue_SumItem:
- value = CssValueFunction.SingleValue_SumItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列开奖号码质合项
- case ChartItemType.SingleCell_ZhiHeStatusItem:
- value = CssValueFunction.SingleCell_ZhiHeStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列开奖号码质合分布项
- case ChartItemType.SingleValue_ZhiHeStatusItem:
- value = CssValueFunction.SingleValue_ZhiHeStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列组三类型
- case ChartItemType.SingleValue_ZuHeStatusItem:
- value = CssValueFunction.SingleValue_ZuHeStatusItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列AC值
- case ChartItemType.SingleCell_Ac:
- value = CssValueFunction.SingleCell_Ac(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列双色球三区比
- case ChartItemType.SingleCell_SanQu:
- value = CssValueFunction.SingleCell_SanQu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列福建31选7三区比
- case ChartItemType.SingleCell_FJ31X7SanQu:
- value = CssValueFunction.SingleCell_FJ31X7SanQu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列福建36选7三区比
- case ChartItemType.SingleCell_FJ36X7SanQu:
- value = CssValueFunction.SingleCell_FJ36X7SanQu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列华东15选5三区比
- case ChartItemType.SingleCell_Hd15x5SanQU:
- value = CssValueFunction.SingleCell_HD15X5SanQu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列南粤36选7三区比
- case ChartItemType.SingleCell_NY36x7Sanqu:
- value = CssValueFunction.SingleCell_NY36x7SanQu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列AC值奇偶值
- case ChartItemType.SingleCell_AcJiOu:
- value = CssValueFunction.SingleCell_AcJiOu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列AC值质合值
- case ChartItemType.SingleCell_AcZhiHe:
- value = CssValueFunction.SingleCell_AcZhiHe(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列AC值012路
- case ChartItemType.SingleCell_Ac012Lu:
- value = CssValueFunction.SingleCell_Ac012Lu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleValue_QuJianFenBu:
- break;
- //和尾奇偶状态
- case ChartItemType.SingleValue_HeWeiJiOu:
- value = CssValueFunction.SingleValue_HeWeiJiOu(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleValue_HeWeiDx:
- value = CssValueFunction.SingleValue_HeWeiDx(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列试机号和值项
- case ChartItemType.SingleCell_ShiJiHaoHzItem:
- value = CssValueFunction.SingleCell_ShiJiHaoHzItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列试机号跨度项
- case ChartItemType.SingleCell_ShiJiHaoSpanItem:
- value = CssValueFunction.SingleCell_ShiJiHaoSpanItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列试机号奇偶比项
- case ChartItemType.SingleCell_ProportionOfShiJiHaoJoItem:
- value = CssValueFunction.SingleCell_ProportionOfShiJiHaoJoItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列试机号大小比项
- case ChartItemType.SingleCell_ProportionOfShiJiHaoDxItem:
- value = CssValueFunction.SingleCell_ProportionOfShiJiHaoDxItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列试机号大小比项
- case ChartItemType.SingleValue_ShiJiHaoTypeItem:
- value = CssValueFunction.SingleValue_ShiJiHaoTypeItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列组三遗漏
- case ChartItemType.SingleCell_ZsMissItem:
- value = CssValueFunction.SingleCell_ZsMissItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列组三号码
- case ChartItemType.SingleCell_ZsHaoMaItem:
- value = CssValueFunction.SingleCell_ZsHaoMaItem(this._LocalEntity, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列组三大小形态
- case ChartItemType.SingleValue_ZsDxStatusItem:
- value = CssValueFunction.SingleValue_ZsDxStatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列组三012形态
- case ChartItemType.SingleValue_Zs012StatusItem:
- value = CssValueFunction.SingleValue_Zs012StatusItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- // 单值单列后区号码
- case ChartItemType.SingleCell_HqItem:
- value = CssValueFunction.SingleCell_HqItem(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列重号
- case ChartItemType.SingleCell_RepeatedNumber:
- value = CssValueFunction.SingleCell_RepeatedNumber(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值单列连号
- case ChartItemType.SingleCell_LinkNumber:
- value = CssValueFunction.SingleCell_LinkNumber(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //和值(区间)分布
- case ChartItemType.SingleValue_SumItemGroup:
- value = CssValueFunction.SingleValue_SumItemGroup(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //和值正幅
- case ChartItemType.SingleCell_ZF:
- value = CssValueFunction.SingleCell_ZF(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //生肖
- case ChartItemType.SingleValue_ShengXiao:
- value = CssValueFunction.SingleValue_ShengXiao(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleValue_Hd11x5Yq:
- value = CssValueFunction.SingleValue_Hd11x5Yq(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleValue_Hd11x5Eq:
- value = CssValueFunction.SingleValue_Hd11x5Eq(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleValue_Hd11x5Sq:
- value = CssValueFunction.SingleValue_Hd11x5Sq(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleCell_Hz012:
- value = CssValueFunction.SingleCell_Hz012(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleValue_K3sbt:
- value = CssValueFunction.SingleCell_K3sbt(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleCell_K3ebt:
- value = CssValueFunction.SingleCell_K3ebt(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleValue_JoValue:
- case ChartItemType.SingleValue_OsValue:
- value = CssValueFunction.SingleValue_JoValue(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleValue_DxValue:
- value = CssValueFunction.SingleValue_DxValue(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleValue_XsValue:
- value = CssValueFunction.SingleValue_DxValue(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleValue_ZhValue:
- case ChartItemType.SingleValue_HsValue:
- value = CssValueFunction.SingleValue_ZhValue(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SingleValue_DxjoValue:
- value = CssValueFunction.SingleValue_DxJoValue(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- #endregion
- #region 特殊
- case ChartItemType.SpecialValue_FC3D012_4:
- value = CssValueFunction.SpecialValue_FC3D012_4(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SpecialValue_TCP3012_4:
- value = CssValueFunction.SpecialValue_TCP3012_4(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- case ChartItemType.SpecialValue_FCSSQ_ChuHaoPL:
- value = CssValueFunction.SpecialValue_FCSSQ_ChuHaoPL(this._LocalEntity, this._itemConfig, this._cssConfig, this._ItemIndex, fomart);
- break;
- #endregion
- #region 高频
- case ChartItemType.MultiValue_KL12:
- value = CssValueFunction.MultiValue_KL12(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- //单值多列回摆
- case ChartItemType.SingleValue_HB:
- value = CssValueFunction.SingleValue_HB(this._LocalEntity, this._itemConfig, isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- #endregion
- default: //没有以默认样式显示
- value = CssValueFunction.GetCssValue(isValue, fomart, attr, this._cssConfig, itemValue, index);
- break;
- }
- return value;
- }
- #endregion
- #region 属性
- /// <summary>
- /// 最大遗漏
- /// </summary>
- protected int[] _maxMiss;
- /// <summary>
- /// 开奖记录
- /// </summary>
- protected int _recordCount;
- /// <summary>
- /// 平均遗漏
- /// </summary>
- protected int[] _avgMiss;
- /// <summary>
- /// 出现次数
- /// </summary>
- protected int[] _times;
- /// <summary>
- /// 上期遗漏
- /// </summary>
- protected int[] _lastMiss;
- /// <summary>
- /// 当前遗漏数据
- /// </summary>
- protected int[] _localMiss;
- /// <summary>
- /// 项配置
- /// </summary>
- protected TrendChartItemInfo _itemConfig;
- /// <summary>
- /// 样式配置
- /// </summary>
- protected ChartCssConfigInfo _cssConfig;
- /// <summary>
- /// 是否画线
- /// </summary>
- protected bool _drawLine { get; set; }
- /// <summary>
- /// 项值
- /// </summary>
- public string _itemValue;
- /// <summary>
- /// 项值索引号
- /// </summary>
- public int _itemIndex;
- /// <summary>
- /// 上期项值索引值
- /// </summary>
- public int[] _lastItemIndex;
- /// <summary>
- /// 上期期号
- /// </summary>
- public long _lastTerm;
- /// <summary>
- /// 本期数据实体
- /// </summary>
- protected TEntity _LocalEntity;
- /// <summary>
- /// 上期开奖号码(根据配置取出)
- /// </summary>
- protected IList<int> _LastOpentCode;
- /// <summary>
- /// 本期索引值
- /// </summary>
- public int[] _ItemIndex;
- #endregion
- }
- /// <summary>
- /// 单值项(单值多列项)走势图帮助类
- /// </summary>
- /// <typeparam name="TEntity"></typeparam>
- public class SingleValueTrendChartItem<TEntity> : TrendChartItem<TEntity> where TEntity : LotteryOpenCode
- {
- /// <summary>
- /// 设置走势图某一项的值
- /// </summary>
- /// <param name="entity"></param>
- /// <returns></returns>
- public override bool SetItemValue(TEntity entity, TEntity nextentity)
- {
- return SetSingleValueAndMiss(entity, nextentity);
- }
- /// <summary>
- /// 设置走势图某一项的值
- /// </summary>
- /// <param name="entity"></param>
- /// <returns></returns>
- public override bool SetItemValue(TEntity entity)
- {
- return SetSingleValueAndMiss(entity, null);
- }
- /// <summary>
- /// 单列项计算项值
- /// </summary>
- /// <param name="entity"></param>
- /// <returns></returns>
- protected bool SetSingleValueAndMiss(TEntity entity, TEntity nextentity)
- {
- if (!SetSingleValue(entity, nextentity))
- return false;
- //求遗漏
- if (1 < this._itemConfig.ItemCount)
- switch (this._itemConfig.FuntionType)
- {
- case ChartItemType.SingleValue_SumItemGroup:
- for (var i = this._itemConfig.ItemCount - 1; i >= 0; i--)
- {
- this._localMiss[i]++;
- if (Convert.ToInt32(this._itemValue) >=
- Convert.ToInt32(this._itemConfig.ItemString[i].Split('|')[0]) &&
- Convert.ToInt32(this._itemValue) <=
- Convert.ToInt32(this._itemConfig.ItemString[i].Split('|')[1]))
- {
- if (null != this._lastMiss)
- this._lastMiss[i] = this._localMiss[i];//上期遗漏
- this._localMiss[i] = 0;//重置当前遗漏
- if (null != this._times)
- this._times[i]++;//出现次数加1
- this._itemIndex = i;//设置项值索引号
- }
- //最大遗漏
- if (null != this._maxMiss)
- if (this._localMiss[i] > this._maxMiss[i])
- { this._maxMiss[i] = this._localMiss[i]; }
- //this._avgMiss[i] = this._maxMiss[i] / (this._times[i] + 1);//计算平均遗漏
- if (null != this._avgMiss && null != this._times)
- this._avgMiss[i] = (this._recordCount - this._times[i]) / (this._times[i] + 1);//计算平均遗漏
- }
- break;
- case ChartItemType.SingleValue_QuJianFenBu:
- for (var i = this._itemConfig.ItemCount - 1; i >= 0; i--)
- {
- this._localMiss[i]++;//当前遗漏
- if (Convert.ToInt32(this._itemValue) >=
- Convert.ToInt32(this._itemConfig.ItemString[i].Split('|')[0]) &&
- Convert.ToInt32(this._itemValue) <=
- Convert.ToInt32(this._itemConfig.ItemString[i].Split('|')[1]))
- {
- if (null != this._lastMiss)
- this._lastMiss[i] = this._localMiss[i];//上期遗漏
- this._localMiss[i] = 0;//重置当前遗漏
- if (null != this._times)
- this._times[i]++;//出现次数加1
- this._itemIndex = i;//设置项值索引号
- }
- //最大遗漏
- if (null != this._maxMiss)
- if (this._localMiss[i] > this._maxMiss[i])
- { this._maxMiss[i] = this._localMiss[i]; }
- //this._avgMiss[i] = this._maxMiss[i] / (this._times[i] + 1);//计算平均遗漏
- if (null != this._avgMiss && null != this._times)
- this._avgMiss[i] = (this._recordCount - this._times[i]) / (this._times[i] + 1);//计算平均遗漏
- }
- break;
- default:
- for (var i = this._itemConfig.ItemCount - 1; i >= 0; i--)
- {
- this._localMiss[i]++;
- if (this._itemValue == this._itemConfig.ItemString[i])
- {
- if (null != this._lastMiss)
- this._lastMiss[i] = this._localMiss[i];//上期遗漏
- this._localMiss[i] = 0;//重置当前遗漏
- if (null != this._times)
- this._times[i]++;//出现次数加1
- this._itemIndex = i;//设置项值索引号
- }
- //最大遗漏
- if (null != this._maxMiss)
- if (this._localMiss[i] > this._maxMiss[i])
- { this._maxMiss[i] = this._localMiss[i]; }
- //this._avgMiss[i] = this._maxMiss[i] / (this._times[i] + 1);//计算平均遗漏
- if (null != this._avgMiss && null != this._times)
- this._avgMiss[i] = (this._recordCount - this._times[i]) / (this._times[i] + 1);//计算平均遗漏
- }
- break;
- }
- return true;
- }
- /// <summary>
- /// 设置单值项 项的值
- /// </summary>
- /// <param name="entity"></param>
- /// <returns></returns>
- protected bool SetSingleValue(TEntity entity, TEntity nextentity)
- {
- bool yes = false;
- yes = !entity.OpenCode.Contains(-1);
- if (nextentity != null)
- {
- IList<int> list = new List<int>(nextentity.OpenCode);
- if (-1 != this._itemConfig.IndexEnd)
- {
- for (int i = list.Count - 1; i >= this._itemConfig.IndexEnd; i--)
- { list.RemoveAt(this._itemConfig.IndexEnd); }
- }
- for (int i = 0; i < this._itemConfig.IndexStart; i++)
- { list.RemoveAt(0); }
- _lastItemIndex = new int[list.Count];
- for (int i = 0; i < list.Count; i++)
- {
- _lastItemIndex[i] = list[i];
- }
- }
- switch (this._itemConfig.FuntionType)
- {
- case ChartItemType.Term_TermItem:
- if (entity.Term > 0)
- { this._itemValue = SingleValueFunction.GetTermItemValue(entity); yes = true; }
- break;
- case ChartItemType.SingleCell_HeWeiItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetHeWeiItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_OpenCodeItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetOpenCodeItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ProportionOf012Item:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetProportionOf012ItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ProportionOfJoItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetProportionOfJoItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ProportionOfDxItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetProportionOfDxItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd,
- this._itemConfig.ItemCount, this._itemConfig.SplitNumberOfDX);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ProportionOfZhItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetProportionOfZhItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_SpanItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetSpanItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ZSSpanItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetZSSpanItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_SumItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetSumItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_HzJoStatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetHzJoStatusValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_HzDxStatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetHzDxStatusValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.SplitNumberOfDX, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_DxStatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetDxStatusValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_JoStatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetJoStatusItem(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ShiJiHao:
- if (entity.ShiJiHao.IndexOf("-1") == -1)
- {
- this._itemValue = SingleValueFunction.GetShiJiHaoItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_ShiJiHao:
- if (entity.ShiJiHao.IndexOf("-1") == -1)
- {
- this._itemValue = SingleValueFunction.GetShiJiHaoSingleValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_ZsStatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetZsStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_ZsJoStatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetZsJoStatusValue(entity);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_012StatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.Get012StatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_HeWeiItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetHeWeiSingleValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_JiOuStatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetJiOuStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_DaXiaoStatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetDaXiaoStatusItemValue(entity,
- this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.SplitNumberOfDX);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_Number012StatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetNumber012StatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_NumberItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetNumberItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_SpanItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetSpanSingleValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_SpanNumberItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetSpanNumberItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_SumItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetSumSingleValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_ZhiHeStatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetZhiHeStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ZhiHeStatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetZhiHeItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_ZuHeStatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetZuHeStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_Ac:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetAcValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_SanQu:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetSsqsanqu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_AcJiOu:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetAcJiOu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_AcZhiHe:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetAcZhiHe(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_Ac012Lu:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetAc012Lu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_QuJianFenBu:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetQuJianStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_HeWeiJiOu:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetHeWeiJiOuFenBu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_HeWeiDx:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetHeWeiDxFenBu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.SplitNumberOfDX, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ShiJiHaoHzItem:
- if (entity.ShiJiHao.IndexOf("-1") == -1)
- {
- this._itemValue = SingleValueFunction.GetShiJiHaoHzValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ShiJiHaoSpanItem:
- if (entity.ShiJiHao.IndexOf("-1") == -1)
- {
- this._itemValue = SingleValueFunction.GetShiJiHaoSpanValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ProportionOfShiJiHaoJoItem:
- if (entity.ShiJiHao.IndexOf("-1") == -1)
- {
- this._itemValue = SingleValueFunction.GetProportionOfShiJiHaoJoItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ProportionOfShiJiHaoDxItem:
- if (entity.ShiJiHao.IndexOf("-1") == -1)
- {
- this._itemValue = SingleValueFunction.GetProportionOfShiJiHaoDxItemValue(entity,
- this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.SplitNumberOfDX);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_ShiJiHaoTypeItem:
- if (entity.ShiJiHao.IndexOf("-1") == -1)
- {
- this._itemValue = SingleValueFunction.GetShiJiHaoTyepValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ZsMissItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetZsMissItem(entity, ref _lastTerm);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ZsHaoMaItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetZsHaoMaValue(entity);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_ZsDxStatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetZsDxStatusValue(entity, this._itemConfig.SplitNumberOfDX);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_Zs012StatusItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetZs012StatusValue(entity);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_HqItem:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetHqValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_RepeatedNumber:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetRepeatNumItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref _lastItemIndex, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_LinkNumber:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetLinkNumItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_SumItemGroup:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetSumSingleValueGroup(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_SX:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetSXStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_JJ:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetJJStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_FW:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetFWStatusItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_HB:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.HBSingleValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref _lastItemIndex, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_ZF:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.ZFSingleCell(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref _lastItemIndex, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_FJ31X7SanQu:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetFj31x7sanqu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_FJ36X7SanQu:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetFj36x7sanqu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_ShengXiao:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.Getdf6j1sx(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_Hd15x5SanQU:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.Gethd15x5sanqu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_NY36x7Sanqu:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.Getny36x7sanqu(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_Hd11x5Yq:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.Gethd15x5Yq(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, 1, 5);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_Hd11x5Eq:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.Gethd15x5Eq(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, 6, 10);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_Hd11x5Sq:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.Gethd15x5Sq(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, 11, 15);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_Hz012:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetHz012Value(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_K3sbt:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetK3sbtValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemString);
- yes = true;
- }
- break;
- case ChartItemType.SingleCell_K3ebt:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetEbtValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_JoValue:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetJoValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_DxValue:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetDxValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.SplitNumberOfDX); ;
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_ZhValue:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetZhValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_DxjoValue:
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetDxjoValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.SplitNumberOfDX, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_XsValue://小数个数
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetXsValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.SplitNumberOfDX);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_HsValue://合数个数
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetHsValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- case ChartItemType.SingleValue_OsValue://偶数个数
- if (!entity.OpenCode.Contains(-1))
- {
- this._itemValue = SingleValueFunction.GetOsValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount);
- yes = true;
- }
- break;
- }
- if (yes)
- this._LocalEntity = entity;
- return yes;
- }
- /// <summary>
- /// 获取格式化后的HTML内容
- /// </summary>
- /// <param name="fomart"></param>
- /// <param name="cssConfig"></param>
- /// <returns></returns>
- public override string GetFomartString(string fomart, ChartCssConfigInfo cssConfig = null)
- {
- var html = GetFomartHTML(fomart, cssConfig);
- //var attr = "";
- //if (this._itemConfig.DrawLine)
- //{
- // attr = " lgroup=\"" + this._itemConfig.Id + "\" lcolor=\"" + html.Item4 + "\"";
- //}
- var sp = new StringBuilder((html.Item1.Length + 40) * this._itemConfig.ItemCount);
- for (int i = 0; i < this._itemConfig.ItemCount; i++)
- {
- if (_itemValue == "")
- {
- sp.Append(GetHtml(false, html.Item1, GetlgroupAndColor(false, html.Item4), _localMiss[i].ToString(), i));
- }
- else
- {
- sp.Append(this._itemIndex == i ? GetHtml(true, html.Item1, GetlgroupAndColor(true, html.Item4), _itemValue, i) : GetHtml(false, html.Item1, GetlgroupAndColor(false, html.Item4), _localMiss[i].ToString(), i));
- }
- }
- return sp.ToString();
- }
- /// <summary>
- /// 核实开奖号码中是否存在-1
- /// </summary>
- /// <param name="entity"></param>
- /// <returns></returns>
- protected bool CheckOpenCodeContainNegativeOne(TEntity entity)
- {
- var entityType = typeof(TEntity);
- var propertyOpenCode1 = entityType.GetProperty("OpenCode1");
- if (propertyOpenCode1 != null && Convert.ToInt32(propertyOpenCode1.GetValue(entity, null)) == -1)
- return true;
- var propertyOpenCode2 = entityType.GetProperty("OpenCode2");
- if (propertyOpenCode2 != null && Convert.ToInt32(propertyOpenCode2.GetValue(entity, null)) == -1)
- return true;
- var propertyOpenCode3 = entityType.GetProperty("OpenCode3");
- if (propertyOpenCode3 != null && Convert.ToInt32(propertyOpenCode3.GetValue(entity, null)) == -1)
- return true;
- var propertyOpenCode4 = entityType.GetProperty("OpenCode4");
- if (propertyOpenCode4 != null && Convert.ToInt32(propertyOpenCode4.GetValue(entity, null)) == -1)
- return true;
- var propertyOpenCode5 = entityType.GetProperty("OpenCode5");
- if (propertyOpenCode5 != null && Convert.ToInt32(propertyOpenCode5.GetValue(entity, null)) == -1)
- return true;
- var propertyOpenCode6 = entityType.GetProperty("OpenCode6");
- if (propertyOpenCode6 != null && Convert.ToInt32(propertyOpenCode6.GetValue(entity, null)) == -1)
- return true;
- var propertyOpenCode7 = entityType.GetProperty("OpenCode7");
- if (propertyOpenCode7 != null && Convert.ToInt32(propertyOpenCode7.GetValue(entity, null)) == -1)
- return true;
- var propertyOpenCode8 = entityType.GetProperty("OpenCode8");
- if (propertyOpenCode8 != null && Convert.ToInt32(propertyOpenCode8.GetValue(entity, null)) == -1)
- return true;
- return false;
- }
- }
- /// <summary>
- /// 多值项(多值多列项)走势图帮助类
- /// </summary>
- /// <typeparam name="TEntity"></typeparam>
- public class MultiValueTrendChartItem<TEntity> : TrendChartItem<TEntity> where TEntity : LotteryOpenCode
- {
- public new int[] _itemIndex;
- /// <summary>
- /// 设置走势图某一项的值
- /// </summary>
- /// <param name="entity"></param>
- /// <returns></returns>
- public override bool SetItemValue(TEntity entity, TEntity lastentity)
- {
- _itemIndex = new int[this._itemConfig.ItemCount];
- return SetMultiValueAndMiss(entity, ref _itemIndex, ref this._localMiss);
- }
- /// <summary>
- /// 设置走势图某一项的值
- /// </summary>
- /// <param name="entity"></param>
- /// <returns></returns>
- public override bool SetItemValue(TEntity entity)
- {
- _itemIndex = new int[this._itemConfig.ItemCount];
- return SetMultiValueAndMiss(entity, ref _itemIndex, ref this._localMiss);
- }
- /// <summary>
- /// 获取格式化后的HTML内容
- /// </summary>
- /// <param name="fomart"></param>
- /// <param name="cssConfig"></param>
- /// <returns></returns>
- public override string GetFomartString(string fomart, ChartCssConfigInfo cssConfig = null)
- {
- var html = GetFomartHTML(fomart, cssConfig);
- var sp = new StringBuilder((html.Item1.Length + 40) * this._itemConfig.ItemCount);
- for (int i = 0; i < this._itemConfig.ItemCount; i++)
- {
- sp.Append(0 < this._itemIndex[i] ? GetHtml(true, html.Item1, GetlgroupAndColor(true, html.Item4), this._itemConfig.ItemString[i], i) : GetHtml(false, html.Item1, GetlgroupAndColor(false, html.Item4), _localMiss[i].ToString(), i));
- }
- return sp.ToString();
- }
- /// <summary>
- /// 设置多值项 项的值
- /// </summary>
- /// <param name="entity"></param>
- /// <param name="index">项值索引</param>
- /// <param name="missNumber">遗漏</param>
- protected bool SetMultiValueAndMiss(TEntity entity, ref int[] index, ref int[] missNumber)
- {
- bool yes = false;
- yes = !entity.OpenCode.Contains(-1);
- switch (this._itemConfig.FuntionType)
- {
- #region 全国性彩种
- case ChartItemType.MultiValue_OpenCodeItem:
- MultiValueFunction.SetOpenCodeItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount);
- break;
- case ChartItemType.MultiValue_LinkNumber:
- MultiValueFunction.SetLinkNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount);
- break;
- case ChartItemType.MultiValue_RepeatNumber:
- MultiValueFunction.SetRepeatNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
- break;
- case ChartItemType.MultiValue_ZheHaoNumber:
- MultiValueFunction.SetZheHaoHaoNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
- break;
- case ChartItemType.MultiValue_XieLianHaoNumber:
- MultiValueFunction.SetXieLianHaoNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
- break;
- case ChartItemType.MultiValue_XieTiaoHaoNumber:
- MultiValueFunction.SetTiaoHaoNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
- break;
- case ChartItemType.MultiValue_ShuSanLianHaoNumber:
- MultiValueFunction.SetShuSanLianHaoNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
- break;
- case ChartItemType.MultiValue_ShuTiaoHaoNumber:
- MultiValueFunction.SetShuTiaoHaoNumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
- break;
- case ChartItemType.MultiValue_K3ebt:
- MultiValueFunction.SetK3ebtItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, this._itemConfig.ItemString);
- break;
- case ChartItemType.MultiValue_Sbtxt:
- MultiValueFunction.SetSbtxtItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, this._itemConfig.ItemString);
- break;
- case ChartItemType.MultiValue_Ebtxt:
- MultiValueFunction.SetEbtxtItemValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, this._itemConfig.ItemString);
- break;
- #endregion
- #region 高频彩种
- case ChartItemType.MultiValue_KL12:
- MultiValueFunction.SetKL12NumberValue(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref missNumber, ref this._lastMiss, ref this._maxMiss, ref this._times, ref this._avgMiss, this._recordCount, ref this._LastOpentCode, ref this._lastItemIndex);
- break;
- #endregion
- }
- if (yes)
- this._LocalEntity = entity;
- return yes;
- }
- }
- /// <summary>
- /// 特殊项走势图帮助类
- /// </summary>
- /// <typeparam name="TEntity"></typeparam>
- public class SpecialValueTrendChartItem<TEntity> : TrendChartItem<TEntity> where TEntity : LotteryOpenCode
- {
- public new int[] _itemIndex;
- /// <summary>
- /// 设置走势图某一项的值
- /// </summary>
- /// <param name="entity"></param>
- /// <returns></returns>
- public override bool SetItemValue(TEntity entity)
- {
- if (this._ItemIndex == null)
- {
- this._ItemIndex = new int[this._itemConfig.ItemCount];
- }
- _itemIndex = new int[this._itemConfig.ItemCount];
- return SetSpecialValue(entity, ref _itemIndex, ref this._ItemIndex);
- }
- /// <summary>
- /// 设置走势图某一项的值
- /// </summary>
- /// <param name="entity"></param>
- /// <returns></returns>
- public override bool SetItemValue(TEntity entity, TEntity lastentity)
- {
- if (this._ItemIndex == null)
- {
- this._ItemIndex = new int[this._itemConfig.ItemCount];
- }
- _itemIndex = new int[this._itemConfig.ItemCount];
- return SetSpecialValue(entity, ref _itemIndex, ref this._ItemIndex);
- }
- /// <summary>
- /// 获取格式化后的HTML内容
- /// </summary>
- /// <param name="fomart"></param>
- /// <param name="cssConfig"></param>
- /// <returns></returns>
- public override string GetFomartString(string fomart, ChartCssConfigInfo cssConfig = null)
- {
- var html = GetFomartHTML(fomart, cssConfig);
- var sp = new StringBuilder((html.Item1.Length + 40) * this._itemConfig.ItemCount);
- switch (this._itemConfig.FuntionType)
- {
- case ChartItemType.SpecialValue_FCSSQ_ChuHaoPL:
- sp.Append(CssValueFunction.SpecialValue_FCSSQ_ChuHaoPL(this._LocalEntity, this._itemConfig, this._cssConfig, this._ItemIndex, html.Item1));
- break;
- case ChartItemType.SpecialValue_TCDLT_ChuHaoPL:
- sp.Append(CssValueFunction.SpecialValue_TCDLT_ChuHaoPL(this._LocalEntity, this._itemConfig, this._cssConfig, this._ItemIndex, html.Item1));
- break;
- default:
- for (int i = 0; i < this._itemConfig.ItemCount; i++)
- {
- sp.Append(GetHtml(true, html.Item1, "", this._ItemIndex[i].ToString(), i));
- }
- break;
- }
- return sp.ToString();
- }
- protected bool SetSpecialValue(TEntity entity, ref int[] index, ref int[] itemIndex)
- {
- bool yes = false;
- yes = !entity.OpenCode.Contains(-1);
- switch (this._itemConfig.FuntionType)
- {
- case ChartItemType.SpecialValue_FC3D012_4:
- SpecialValueFunction.SpecialValue_FC3D012_4(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index);
- break;
- case ChartItemType.SpecialValue_TCP3012_4:
- SpecialValueFunction.SpecialValue_FC3D012_4(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index);
- break;
- case ChartItemType.SpecialValue_FCSSQ_ChuHaoPL:
- SpecialValueFunction.SpecialValue_FCSSQ_ChuHaoPL(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref itemIndex);
- break;
- case ChartItemType.SpecialValue_TCDLT_ChuHaoPL:
- SpecialValueFunction.SpecialValue_TCDLT_ChuHaoPL(entity, this._itemConfig.IndexStart, this._itemConfig.IndexEnd, this._itemConfig.ItemCount, this._itemConfig.ItemMinValue, this._itemConfig.ItemMaxValue, ref index, ref itemIndex);
- break;
- }
- if (yes)
- this._LocalEntity = entity;
- return yes;
- }
- }
- }
|