| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- //----------------------------------------------------------------
- //Module Name: $safeprojectname$
- //Purpose:
- //CopyRight: Muchinfo
- //History:
- //----------------------------------------------------------------
- //DateTime 2016/11/3 18:02:43
- //Author
- //Description Create
- //----------------------------------------------------------------
- using System.Windows.Documents;
- using Muchinfo.MTPClient.Data.Enums;
- using Muchinfo.MTPClient.Data.Helper;
- namespace Muchinfo.MTPClient.Data.Model.Account
- {
- /// <summary>
- /// 协议平仓
- /// </summary>
- public class DealCloseModel
- {
- // d.AUTOID , // 协议单号
- //d.TRADEMODE, // 交易模式
- //d.BUYACCOUNTID, //买方账号
- //d.SELLACCOUNTID , //卖方账号
- //sellconfirmtime 卖方确认时间
- //BuyConfirmTime 买方确认时间
- // BuyAccountCode买方账号
- // BuyAccountname 买方名称
- // SellAccountCode卖方账号
- //ORDERQTY 委托数量
- // ORDERPRICE 委托价格
- //ORDERQTY 委托数量
- // STATUS 状态
- // 商品名称
- //d.ORDERQTY ,
- //d.ORDERPRICE,
- //d.CREATETIME,
- //d.STATUS,
- //d.CREATORID,
- //d.CHECKTIME ,
- //d.CHECKID,
- //d.DEALCLOSETIME
- // d.DEALCLOSEMODE ,
- //d.ACCOUNTSURE ,
- /// <summary>
- /// 协议单号
- /// </summary>
- [PropertyDisc("AUTOID")]
- public uint DealNum { get; set; }
- /// <summary>
- /// 交易模式
- /// </summary>
- [PropertyDisc("TRADEMODE")]
- public eTradeMode TRADEMODE { get; set; }
- /// <summary>
- /// 买方账号
- /// </summary>
- [PropertyDisc("BUYACCOUNTID")]
- public long BuyAccountId { get; set; }
- /// <summary>
- /// 卖方账号
- /// </summary>
- [PropertyDisc("SELLACCOUNTID")]
- public ulong SellAccountId { get; set; }
- /// <summary>
- /// 商品ID
- /// </summary>
- [PropertyDisc("GOODSID")]
- public long GoodsId { get; set; }
- /// <summary>
- /// 商品名称
- /// </summary>
- [PropertyDisc("GoodsName")]
- public string GoodsName { get; set; }
-
- /// <summary>
- /// 商品代码
- /// </summary>
- [PropertyDisc("GoodsCode")]
- public string GoodsCode { get; set; }
-
- /// <summary>
- /// BuyAccountname 买方名称
- /// </summary>
- [PropertyDisc("BuyAccountname")]
- public string BuyAccountName { get; set; }
-
- /// <summary>
- /// BuyAccountCode买方账号
- /// </summary>
- [PropertyDisc("BuyAccountCode")]
- public string BuyAccountCode { get; set; }
-
- /// <summary>
- /// SellAccountName卖方名称
- /// </summary>
- [PropertyDisc("SellAccountName")]
- public string SellAccountName { get; set; }
-
- /// <summary>
- /// SellAccountCode卖方账号
- /// </summary>
- [PropertyDisc("SellAccountCode")]
- public string SellAccountCode { get; set; }
-
- /// <summary>
- ///ORDERQTY 委托数量
- /// </summary>
- [PropertyDisc("ORDERQTY")]
- public long OrderQty { get; set; }
- /// <summary>
- /// ORDERPRICE 委托价格
- /// </summary>
- [PropertyDisc("ORDERPRICE")]
- public decimal OrderPrice { get; set; }
- /// <summary>
- /// STATUS 状态
- /// </summary>
- [PropertyDisc("STATUS")]
- public DealCloseStatus Status { get; set; }
- /// <summary>
- ///
- /// </summary>
- [PropertyDisc("ACCOUNTSURE")]
- public NeedComfrim AccountSure { get; set; }
- /// <summary>
- ///DEALCLOSETIME 平仓时间
- /// </summary>
- [PropertyDisc("DEALCLOSETIME")]
- public DateTime DealCloseTime
- {
- get; set;
- }
- /// <summary>
- ///BuyConfirmTime 买方确认时间
- /// </summary>
- [PropertyDisc("BuyConfirmTime")]
- public DateTime BuyConfirmTime { get; set; }
- /// <summary>
- ///sellconfirmtime 卖方确认时间
- /// </summary>
- [PropertyDisc("sellconfirmtime")]
- public DateTime SellConfirmTime { get; set; }
- /// <summary>
- /// 审核状态
- /// </summary>
- [PropertyDisc("AuditStatus")]
- public eAuditStatus AuditStatus { get; set; }
- /// <summary>
- /// 己方ID
- /// </summary>
- public ulong SelfAccountId { get; set; }
- /// <summary>
- /// 状态
- /// </summary>
- public string StatusDisplay
- {
- get
- {
- return Status.Discription();
- //if (IsShowComfrim)
- //{
- // return Status.Discription();
- //}
- //return "--";
- }
- }
- /// <summary>
- /// 对方Code
- /// </summary>
- public string PartnerCode
- {
- get
- {
- if (SelfAccountId == SellAccountId)
- {
- return BuyAccountCode;
- }
- else
- {
- return SellAccountCode;
- }
- }
- }
- /// <summary>
- /// 对方名称
- /// </summary>
- public string PartnerName
- {
- get
- {
- if (SelfAccountId == SellAccountId)
- {
- return BuyAccountName;
- }
- else
- {
- return SellAccountName;
- }
- }
- }
- public Direction Direction
- {
- get
- {
- if (SelfAccountId == SellAccountId)
- {
- return Direction.Ask;
- }
- else
- {
- return Direction.Bid;
- }
- }
- }
- /// <summary>
- /// 显示方向
- /// </summary>
- public string DirectionDisplay
- {
- get
- {
- return Direction.Discription();
- }
- }
- /// <summary>
- /// 是否可平仓
- /// </summary>
- public bool CanComfrim
- {
- get
- {
- if (AuditStatus != eAuditStatus.AUDITSTATUS_SUCCESS)
- {
- return false;
- }
- switch (Status)
- {
- case DealCloseStatus.AllComfirmed:
- case DealCloseStatus.AllTraded:
- case DealCloseStatus.Dealing:
- case DealCloseStatus.CloseFail:
- case DealCloseStatus.SysCancel:
- case DealCloseStatus.SelfCanel: ////不可确认的状态
- return false;
- }
- if (Direction == Direction.Ask) ////其他状态看对应方向的确认时间是否有值判断是否可确认
- {
- return SellConfirmTime == DateTime.MinValue;
- }
- else
- {
- return BuyConfirmTime == DateTime.MinValue;
- }
- }
- }
- /// <summary>
- /// /是否显示确认
- /// </summary>
- public bool IsShowComfrim
- {
- get
- {
- return AccountSure == NeedComfrim.Yes;
- }
- }
- }
- }
|