using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using EMIS.ViewModel.CacheManage;
namespace EMIS.ViewModel.RetakeManage
{
public class RetakePlanStudentApplyView : RetakePlanTaskView
{
///
/// 开课学年
///
[DisplayName("开课学年")]
public int? SchoolyearNumID { get; set; }
///
/// 开课学年
///
[DisplayName("开课学年")]
public string SchoolyearNumName
{
get
{
return IdNameExt.GetDictionaryItem(DictionaryItem.CF_SchoolyearNum.ToString())
.Where(x => x.Value == SchoolyearNumID)
.Select(x => x.Name).FirstOrDefault();
}
}
///
/// 开课学期
///
[DisplayName("开课学期")]
public int? StarttermID { get; set; }
///
/// 开课学期
///
[DisplayName("开课学期")]
public string StarttermName
{
get
{
return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Startterm.ToString())
.Where(x => x.Value == StarttermID)
.Select(x => x.Name).FirstOrDefault();
}
}
///
/// 重修控制信息ID
///
[DisplayName("重修控制信息ID")]
public Guid? RetakeOpenControlID { get; set; }
///
/// 开始时间
///
[DisplayName("开始时间")]
public DateTime? StartDate { get; set; }
///
/// 结束时间
///
[DisplayName("结束时间")]
public DateTime? EndDate { get; set; }
///
/// 报名状态
///
[DisplayName("报名状态")]
public bool? ApplyStatus { get; set; }
///
/// 报名状态
///
[DisplayName("报名状态")]
public string ApplyStatusName
{
get
{
return ApplyStatus == true ? "是" : "否";
}
}
///
/// 操作状态
///
[DisplayName("操作状态")]
public bool? CanSelect { get; set; }
///
/// 操作状态
///
public string OperateText
{
get
{
if (RetakeOpenControlID == null || RetakeOpenControlID == Guid.Empty)
{
return "未开放";
}
else if (RetakeOpenControlID.HasValue && StartDate > DateTime.Now)
{
return "即将开始";
}
else if (RetakeOpenControlID.HasValue && EndDate < DateTime.Now)
{
return "已结束";
}
else
{
if (PeopleNumlimit != null && PeopleNumlimit != 0 && ApplyNumber.Value >= PeopleNumlimit.Value
&& ApplyStatus.Value == false)
{
return "已报满";
}
else
{
return !(this.ApplyStatus ?? false) ? "立即报名" : "取消报名";
}
}
}
}
}
}