| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- //----------------------------------------------------------------
- //Module Name: $safeprojectname$
- //Purpose:
- //CopyRight: Muchinfo
- //History:
- //----------------------------------------------------------------
- //DateTime 2016/6/21 17:06:59
- //Author
- //Description Create
- //----------------------------------------------------------------
- using Muchinfo.MTPClient.Data.Helper;
- namespace Muchinfo.MTPClient.Data.Quote
- {
- public class WeekPlanDetail
- {
- /// <summary>
- /// 周计划id
- /// </summary>
- [PropertyDisc("WeekPlanDetailId")]
- public long WeekPlanDetailId { get; set; }
- /// <summary>
- /// 周结算计划ID
- /// </summary>
- [PropertyDisc("WeekPlanId")]
- public long WeekPlanId { get; set; }
- /// <summary>
- /// 运行阶段
- /// </summary>
- [PropertyDisc("RunStep")]
- public int RunStep { get; set; }
- /// <summary>
- /// 起始周几
- /// </summary>
- [PropertyDisc("StartWeekDay")]
- public int StartWeekDay { get; set; }
- /// <summary>
- /// 结束周几
- /// </summary>
- [PropertyDisc("EndWeekDay")]
- public int EndWeekDay { get; set; }
- /// <summary>
- /// 开始时间 HH:mm
- /// </summary>
- [PropertyDisc("Starttime")]
- public string Starttime { get; set; }
- /// <summary>
- /// 结束时间 HH:mm
- /// </summary>
- [PropertyDisc("EndTime")]
- public string EndTime { get; set; }
- /// <summary>
- /// 交易日
- /// </summary>
- [PropertyDisc("Tradeday")]
- public DateTime Tradeday { get; set; }
- /// <summary>
- /// 获取开始时间
- /// </summary>
- /// <returns></returns>
- public DateTime GetStartTime()
- {
- if (this.Tradeday == DateTime.MinValue)
- {
- throw new Exception("traday is not valid !" + Tradeday);
- }
- var start = StartWeekDay - (int) Tradeday.DayOfWeek;
- var startTime = this.Tradeday.AddDays(start);
- if (!DateTime.TryParse(startTime.ToString("yyyy-MM-dd ") + Starttime, out startTime))
- {
- throw new Exception("traday is not valid !:"+startTime.ToString("yyyy-MM-dd ") + Starttime);
- }
- return startTime;
- }
- /// <summary>
- /// 获取结束时间
- /// </summary>
- /// <returns></returns>
- public DateTime GetEndTime()
- {
- if (this.Tradeday == DateTime.MinValue)
- {
- throw new Exception("traday is not valid !" + Tradeday);
- }
- var end = EndWeekDay - (int)Tradeday.DayOfWeek;
- var endTime = this.Tradeday.AddDays(end);
- if (!DateTime.TryParse(endTime.ToString("yyyy-MM-dd ") + EndTime, out endTime))
- {
- throw new Exception("traday is not valid !:" + endTime.ToString("yyyy-MM-dd ") + EndTime);
- }
- return endTime;
- }
- }
- }
|