using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Xml.Serialization;
using NewLife;
using NewLife.Data;
using NewLife.Log;
using NewLife.Model;
using NewLife.Reflection;
using NewLife.Threading;
using NewLife.Web;
using XCode;
using XCode.Cache;
using XCode.Configuration;
using XCode.DataAccessLayer;
using XCode.Membership;
namespace StockData.Analysis.Entity
{
/// <summary>股票分æžå…ƒæ•°æ®</summary>
public partial class StockElementInfo : Entity<StockElementInfo>
{
#region 对象æ“作
static StockElementInfo()
{
// ç´¯åŠ å—段
//Meta.Factory.AdditionalFields.Add(__.Logins);
// 过滤器 UserModuleã€TimeModuleã€IPModule
}
/// <summary>验è¯æ•°æ®ï¼Œé€šè¿‡æŠ›å‡ºå¼‚常的方å¼æ示验è¯å¤±è´¥ã€‚</summary>
/// <param name="isNew">是å¦æ’å…¥</param>
public override void Valid(Boolean isNew)
{
// 如果没有è„æ•°æ®ï¼Œåˆ™ä¸éœ€è¦è¿›è¡Œä»»ä½•å¤„ç†
if (!HasDirty) return;
// 在新æ’入数æ®æˆ–者修改了指定å—段时进行修æ£
}
///// <summary>首次连接数æ®åº“æ—¶åˆå§‹åŒ–æ•°æ®ï¼Œä»…用于实体类é‡è½½ï¼Œç”¨æˆ·ä¸åº”该调用该方法</summary>
//[EditorBrowsable(EditorBrowsableState.Never)]
//protected override void InitData()
//{
// // InitData一般用于当数æ®è¡¨æ²¡æœ‰æ•°æ®æ—¶æ·»åŠ 一些默认数æ®ï¼Œè¯¥å®žä½“类的任何第一次数æ®åº“æ“作都会触å‘该方法,默认异æ¥è°ƒç”¨
// if (Meta.Count > 0) return;
// if (XTrace.Debug) XTrace.WriteLine("开始åˆå§‹åŒ–StockElementInfo[股票分æžå…ƒæ•°æ®]æ•°æ®â€¦â€¦");
// var entity = new StockElementInfo();
// entity.Code = "abc";
// entity.Name = "abc";
// entity.MaxPrice = 0.0;
// entity.MinPrice = 0.0;
// entity.MaxRate = 0.0;
// entity.Max5year = 0.0;
// entity.Min5year = 0.0;
// entity.Max5Rate = 0.0;
// entity.UpdateDate = DateTime.Now;
// entity.Insert();
// if (XTrace.Debug) XTrace.WriteLine("完æˆåˆå§‹åŒ–StockElementInfo[股票分æžå…ƒæ•°æ®]æ•°æ®ï¼"
//}
///// <summary>å·²é‡è½½ã€‚基类先调用Valid(true)验è¯æ•°æ®ï¼Œç„¶åŽåœ¨äº‹åŠ¡ä¿æŠ¤å†…调用OnInsert</summary>
///// <returns></returns>
//public override Int32 Insert()
//{
// return base.Insert();
//}
///// <summary>å·²é‡è½½ã€‚在事务ä¿æŠ¤èŒƒå›´å†…处ç†ä¸šåŠ¡ï¼Œä½äºŽValid之åŽ</summary>
///// <returns></returns>
//protected override Int32 OnDelete()
//{
// return base.OnDelete();
//}
#endregion
#region 扩展属性
#endregion
#region 扩展查询
/// <summary>æ ¹æ®è‚¡ç¥¨ç¼–ç 查找</summary>
/// <param name="code">股票编ç </param>
/// <returns>实体对象</returns>
public static StockElementInfo FindByCode(String code)
{
if (code.IsNullOrEmpty()) return null;
// 实体缓å˜
if (Meta.Count < 1000) return Meta.Cache.Entities.FirstOrDefault(e => e.Code == code);
// å•å¯¹è±¡ç¼“å˜
//return Meta.SingleCache[code];
return Find(_.Code == code);
}
#endregion
#region 高级查询
#endregion
#region 业务æ“作
#endregion
}
}
|