using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using EMIS.ViewModel.Cultureplan;
using EMIS.Entities;
using EMIS.ViewModel.CacheManage;
namespace EMIS.ViewModel.TeachingMaterial
{
[Serializable]
public class InventoryView
{
///
/// 教材ID
///
[DisplayName("教材ID")]
public Guid TeachingMaterialPoolID { get; set; }
///
/// 库存ID
///
[DisplayName("库存ID")]
public Guid TeachingMateriaInventoryID { get; set; }
///
/// 出库ID
///
[DisplayName("出库ID")]
public Guid StockOutID { get; set; }
///
/// 入库ID
///
[DisplayName("入库ID")]
public Guid StockInID { get; set; }
///
/// 教材编号
///
/// [Required]
[DisplayName("教材编号")]
[Required]
public string TeachingMaterialCode { get; set; }
///
/// 教材名称
///
[DisplayName("教材名称")]
[Required]
public string TeachingMaterialName { get; set; }
///
/// 书库编号
///
public string LibraryCode { get; set; }
///
/// 书库名称
///
public string LibraryName { get; set; }
///
/// 教材名称
///
[DisplayName("教材简称")]
[Required]
public string TeachingMaterialShorName { get; set; }
///
/// 学年学期
///
[DisplayName("学年学期")]
public string SchoolYearName { get; set; }
///
/// 学年学期ID
///
[DisplayName("学年学期ID")]
public Guid SchoolYearID { get; set; }
///
/// 课程ID
///
[DisplayName("课程")]
public HashSet CoursematerialEntityList { get; set; }
///
/// 课程名称
///
[DisplayName("课程名称")]
[Required]
public string CoursematerialName
{
get
{
return string.Join(",", CoursematerialEntityList.Select(x => x.CourseName));
}
}
///
/// 课程代码
///
[DisplayName("课程代码")]
public string CoursematerialCode
{
get
{
return string.Join(",", CoursematerialEntityList.Select(x => x.CourseCode));
}
}
///
/// ISBN
///
[DisplayName("ISBN")]
[Required]
public string ISBN { get; set; }
///
///教材类型
///
[DisplayName("教材类型")]
[Required]
public int? TeachingMaterialTypeID { get; set; }
///
///教材类型
///
[DisplayName("教材类型")]
public string TeachingMaterialTypeName
{
get
{
return IdNameExt.GetDictionaryItem(DictionaryItem.CF_TeachingMaterialType.ToString())
.Where(x => x.Value == TeachingMaterialTypeID)
.Select(x => x.Name).FirstOrDefault();
}
}
///
/// 获奖级别
///
[DisplayName("获奖级别")]
[Required]
public int? WnningLevel { get; set; }
///
/// 获奖级别
///
[DisplayName("获奖级别")]
public string WnningLevelName { get; set; }
///
/// 版本时间
///
[DisplayName("版本时间")]
[Required]
public string PublishTime { get; set; }
///
/// 出版单位ID
///
[DisplayName("出版单位ID")]
public Guid? PublishID { get; set; }
///
/// 出版单位
///
[DisplayName("出版单位")]
public string PublishName { get; set; }
///
/// 作者
///
[DisplayName("作者")]
[Required]
public string Author { get; set; }
///
/// 单价
///
[DisplayName("单价")]
[Required]
public decimal? Price { get; set; }
///
/// 是否过期
///
[DisplayName("是否过期")]
[Required]
public bool IsLate { get; set; }
///
/// 是否过期
///
public string IsLateName { get; set; }
///
/// 备注
///
[DisplayName("备注")]
public string Desc { get; set; }
///
/// 创建时间
///
[DisplayName("创建时间")]
public DateTime? CreateTime { get; set; }
///
/// 创建人
///
[DisplayName("创建人")]
public string CreateUserName { get; set; }
///
/// 修改时间
///
[DisplayName("修改时间")]
public DateTime? ModifyTime { get; set; }
///
/// 修改人
///
[DisplayName("修改人")]
public string ModifyUserName { get; set; }
///
/// 征订数量(用于教师征订)
///
[DisplayName("征订数量")]
public int? OrderQty { get; set; }
///
/// 课程级别(用于学生征订)
///
[DisplayName("课程级别")]
public string CourseLevelName { get; set; }
///
/// 课程科类(用于学生征订)
///
[DisplayName("课程科类")]
public string CourseScienceName { get; set; }
///
/// 最小库存量
///
[DisplayName("最小库存量")]
public int? MinInventory { get; set; }
///
/// 当前库存量
///
[DisplayName("当前库存量")]
public int? PresentInventory { get; set; }
///
/// 库存编号
///
[DisplayName("库存编号(出库入库编号)")]
public string InventoryCode { get; set; }
///
/// 折扣率
///
[DisplayName("折扣率")]
[Required]
[RegularExpression(@"[\d]?(\.[\d]{0,2})?", ErrorMessage = "必须填写小数值")]
public decimal? Discount { get; set; }
///
/// 折合价
///
[DisplayName("折合价")]
public decimal? DiscountPrice { get; set; }
///
/// 码洋
///
[DisplayName("码洋")]
public decimal? Total { get; set; }
///
/// 实洋
///
[DisplayName("实洋")]
public decimal? TotalDollar { get; set; }
///
/// 入库数量
///
[DisplayName("入库数量")]
public int? StockInQty { get; set; }
///
/// 出库数量
///
[DisplayName("出库数量")]
public int? StockOutQty { get; set; }
///
/// 下半年出库数量
///
[DisplayName("下半年出库数量")]
public int? TopStockOutQty { get; set; }
///
/// 下半年入库数量
///
[DisplayName("下半年入库数量")]
public int? TopStockInQty { get; set; }
///
/// 原库存量
///
[DisplayName("原库存量")]
public int? InventoryCollectQty { get; set; }
///
/// 原库存数量
///
[DisplayName("原库存数量")]
public int? InventoryCollectQtyStr
{
get
{
if (InventoryCollectQty < 0 || InventoryCollectQty == null)
{
return 0;
}
return InventoryCollectQty == null ? 0 : InventoryCollectQty;
}
}
}
}