using GalaSoft.MvvmLight;
using Muchinfo.MTPClient.Data.Enums;
using Muchinfo.MTPClient.Resources;
using System;
using System.Collections.Generic;
namespace Muchinfo.MTPClient.Data.Model
{
public class Announcement : ObservableObject
{
private bool sendType;
///
/// 响应类型:用户登录true,公告推送false
///
public bool SendType
{
get { return sendType; }
set { sendType = value; }
}
private int _readStatus;
///
/// 阅读状态
///
public int ReadStatus
{
get { return _readStatus; }
set
{
Set(() => ReadStatus, ref _readStatus, value);
RaisePropertyChanged(() => ReadStatusString);
}
}
public string ReadStatusString
{
get
{
switch (ReadStatus)
{
case 0:
return Client_Resource.Announcement_UnRead;
// break;
case 1:
return Client_Resource.Announcement_Read;
// break;
}
return "--";
}
}
///
/// 内容
///
public string Content { get; set; }
///
/// 消息号
///
public int MsgID { get; set; }
///
/// 公告或通知类型
///
public MsgTypeEnum MsgType { get; set; }
///
/// 发布者交易账号
///
public string PubAccountCode { get; set; }
///
/// 发布者账户类型
///
public eAccountType PubAccountType { get; set; }
///
/// 发布主体
///
public string PubExchName { get; set; }
///
/// 消息发布时间
///
public DateTime PublishDate { get; set; }
public string PublishDateString
{
get
{
return PublishDate.ToString("yyyy-MM-dd HH:mm:ss");
}
}
///
/// 接收账号类型
///
public eAccountType RecvAccountType { get; set; }
///
/// 标题
///
public string Title { get; set; }
///
/// 消息有效日期
///
public DateTime ValidDate { get; set; }
public string ValidDateString
{
get
{
return ValidDate.ToString("yyyy-MM-dd HH:mm:ss");
}
}
public int RiskLevel
{
get;
set;
}
public string RiskLevelString
{
get
{
switch (RiskLevel)
{
case 0:
return Client_Resource.Announcement_Normal; //无风险
// break;
case 1:
return Client_Resource.Announcement_Prompt;//提示
// break;
case 2:
return Client_Resource.Announcement_Additional;//追加
// break;
case 3:
return Client_Resource.Announcement_Liquidation;//斩仓
// break;
case 4:
return Client_Resource.Announcement_Recover;//恢复正常
// break;
}
return "--";
}
}
///
/// 目标会员ID数组
///
public List MemberIds
{
get;
set;
}
///
/// 目标交易所ID数组
///
public List ExchID
{
get; set;
}
///
/// 消息有效日期开始
///
public string ValidDateBegin
{
get; set;
}
///
/// 消息有效日期结束
///
public string ValidDateEnd
{
get;
set;
}
}
}