using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using EMIS.ViewModel.CacheManage;
using Bowin.Common.Utility;
using EMIS.Entities;
namespace EMIS.ViewModel.SupervisionManage
{
public class ProjectRecordView
{
///
/// ProjectRecordID
///
public System.Guid ProjectRecordID { get; set; }
///
/// 学年学期
///
[Required]
[DisplayName("学年学期")]
public Guid? SchoolyearID { get; set; }
///
/// 学年学期
///
[DisplayName("学年学期")]
public string SchoolyearCode { get; set; }
[Required]
[DisplayName("督导时间")]
public Nullable ProjectDate { get; set; }
public string ProjectDateDesc {
get {
return ProjectDate == null ? "" : ProjectDate.Value.ToShortDateString();
}
}
[Required]
[DisplayName("督导地点")]
public string Location { get; set; }
[DisplayName("院系所")]
public Guid? CollegeID { get; set; }
public string CollegeName { get; set; }
[Required]
[DisplayName("督导院系")]
public Nullable SupervisionCollegeID { get; set; }
public string SupervisionCollegeName { get; set; }
[Required]
[DisplayName("督导类型")]
public Nullable SupervisionTypeID { get; set; }
public string SupervisionTypeDesc
{
get
{
return IdNameExt.GetDictionaryItem(DictionaryItem.SUP_SupervisionType.ToString())
.Where(x => x.Value == SupervisionTypeID)
.Select(x => x.Name).FirstOrDefault();
}
}
[DisplayName("督导对象")]
public Guid? UserID { get; set; }
public string UserName { get;set; }
[DisplayName("课程")]
public Guid? CoursematerialID { get; set; }
public string CoursematerialName { get; set; }
[DisplayName("其他督导对象")]
public string OtherTarget { get; set; }
public string SupervisionTarget
{
get {
if (UserID.HasValue)
{
return UserName;
}
if (OtherTarget != null)
{
return OtherTarget;
}
return "";
}
}
[DisplayName("督导组成员")]
public IEnumerable staffList { get; set; }
public IEnumerable userList { get; set; }
public List UserIDList {
get {
if (userList != null)
{
string ids = string.Join(",", userList.Select(s => s.UserID));
List UserIDList = ids.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
return UserIDList;
}
else
{
return null;
}
}
}
public string staffListDesc {
get {
string name = string.Empty;
if (userList != null)
name = string.Join(",", userList.Select(s => s.Name));
if (string.IsNullOrEmpty(name))
{
return "";
}
else
{
return name;
}
}
}
[Required]
[DisplayName("星期")]
public Nullable Weekday { get; set; }
public string WeekdayDesc
{
get
{
if (Weekday.HasValue)
{
return WeekHelper.WeekDictionary[Weekday.Value];
}
else
{
return "";
}
}
}
[Required]
[DisplayName("节次")]
public Nullable CoursesTimeID { get; set; }
public Nullable StartTimes { get; set; }
public Nullable EndTimes { get; set; }
public string CoursesTimeDesc
{
get
{
return string.Format("第{0}-{1}节", StartTimes.HasValue ? StartTimes.Value.ToString() : "", EndTimes.HasValue ? EndTimes.Value.ToString() : "");
}
}
public string DateWeekTimeDesc {
get {
return ProjectDateDesc + " " + WeekdayDesc + " " + CoursesTimeDesc;
}
}
[DisplayName("综合评分")]
public decimal? TotalScore { get; set; }
[DisplayName("说明")]
public string Description { get; set; }
[Required]
[DisplayName("督导情况记录")]
public string Content { get; set; }
[Required]
[DisplayName("督导评价建议")]
public string Advise { get; set; }
[Required]
[DisplayName("创建人(督导)")]
public Nullable CreateUserID { get; set; }
public string CreateUserName { get; set; }
[DisplayName("创建时间(督导)")]
public DateTime? CreateTime { get; set; }
public string CreateTimeDesc
{
get
{
return CreateTime == null ? "" : CreateTime.Value.ToShortDateString();
}
}
public IEnumerable ProjectRecordAttachmentList { get; set; }
public string ProjectRecordAttachmentIDString
{
get
{
if (ProjectRecordAttachmentList.Count() > 0)
{
return string.Join(",", ProjectRecordAttachmentList.Select(x => x.ProjectRecordAttachmentID));
}
else
{
return "";
}
}
}
///
/// 附件名称
///
[DisplayName("附件名称")]
public string AttachmentName
{
get
{
if (ProjectRecordAttachmentList != null)
{
if (ProjectRecordAttachmentList.Count() > 0)
{
return string.Join(",", ProjectRecordAttachmentList.Select(x => x.Name));
}
else
{
return "";
}
}
else
{
return "";
}
}
}
///
/// 附件状态
///
public int? IsChangeAttachment { get; set; }
}
}