using EMIS.ViewModel.CacheManage;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
namespace EMIS.ViewModel.TeachingMaterial
{
[Serializable]
public class StockInView
{
///
/// 教材入库ID
///
[DisplayName("教材入库ID")]
public Guid StockInID { get; set; }
///
/// 教材信息ID
///
[DisplayName("教材信息ID")]
public Guid TeachingMaterialPoolID { get; set; }
///
/// 入库明细ID
///
[DisplayName("入库明细ID")]
public Guid StockInDetailID { get; set; }
///
/// 学年学期
///
[DisplayName("学年学期")]
[Required]
public Guid? SchoolyearID { get; set; }
///
/// 学年学期
///
[DisplayName("学年学期")]
[Required]
public string SchoolyearName { get; set; }
///
/// 入库单据号
///
/// [Required]
[DisplayName("入库单据号")]
[Required]
public string StockInDocumentNo { get; set; }
///
/// 入库编号
///
/// [Required]
[DisplayName("入库编号")]
public string StockInNumber { get; set; }
///
/// 订单号
///
[DisplayName("订单号")]
public string OrdersNo { get; set; }
///
/// 入库单据时间
///
[DisplayName("入库单据时间")]
[Required]
public DateTime? StockInDJTime { get; set; }
///
/// 入库总金额
///
[DisplayName("入库总金额")]
public decimal? StockInSumMoney { get; set; }
///
/// 书库ID
///
[DisplayName("书库ID")]
public Guid LibraryID { get; set; }
///
/// 书库编号
///
[DisplayName("书库编号")]
public string RoomNumber { get; set; }
///
/// 书库名称
///
[DisplayName("书库名称")]
public string LibraryName { get; set; }
///
/// 教材编号
///
[DisplayName("教材编号")]
public string TeachingMaterialCode { get; set; }
///
/// 教材名称
///
[DisplayName("教材名称")]
public string TeachingMaterialName { get; set; }
///
///教材类型
///
[DisplayName("教材类型")]
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();
}
}
///
/// ISBN
///
[DisplayName("ISBN")]
public string ISBN { get; set; }
///
/// 出版单位ID
///
[Required]
[DisplayName("出版单位ID")]
public Guid? PublishID { get; set; }
///
/// 出版单位
///
[DisplayName("出版单位")]
public string PublishName { get; set; }
///
/// 供应商
///
[DisplayName("供应商")]
[Required]
public Guid? SupplierID { get; set; }
///
/// 供应商
///
[DisplayName("供应商")]
public string SupplierName { get; set; }
///
/// 版本时间
///
[DisplayName("版本时间")]
public string PublishTime { get; set; }
///
/// 作者
///
[DisplayName("作者")]
[Required]
public string Author { get; set; }
///
/// 数量
///
[DisplayName("数量")]
[RegularExpression(@"^[1-9]\d*$", ErrorMessage = "必须填写整数")]
public int? Quantity { get; set; }
///
/// 单价
///
[DisplayName("单价")]
[DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
public decimal? Price { get; set; }
///
/// 折合价
///
[DisplayName("折合价")]
[DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
public decimal? DiscountPrice { get; set; }
///
/// 折扣率
///
[DisplayName("折扣率")]
[Required]
[DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
[RegularExpression(@"[\d]?(\.[\d]{0,2})?", ErrorMessage = "必须填写小数值")]
public decimal? Discount { get; set; }
///
/// 码洋
///
[DisplayName("码洋")]
[DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
public decimal? TotalPrice { get; set; }
///
/// 总价(实洋)
///
[DisplayName("总价(实洋)")]
public decimal? TotalDollar { get; set; }
///
/// 经手人
///
[DisplayName("经手人")]
public string HandlerUserName { get; set; }
///
/// 入库时间
///
[DisplayName("入库时间")]
public DateTime? StockInTime { get; set; }
///
/// 入库人
///
[DisplayName("入库人")]
public string StockInUserName { get; set; }
///
/// 入库类型
///
[DisplayName("入库类型")]
public int? StockInType { get; set; }
///
/// 操作状态
///
[DisplayName("操作状态ID")]
public int? RecordStatus { get; set; }
///
/// 操作状态
///
[DisplayName("操作状态")]
public string RecordStatusName { get; set; }
[DisplayName("是否入库")]
public bool isLate { get; set; }
///
/// 备注
///
[DisplayName("备注")]
public string Desc { get; set; }
[DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
public decimal? DiscountStr
{
get
{
if (this.Discount == null)
return 0;
return Math.Round((decimal)Discount, 2);
}
}
[DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
public decimal? DiscountPriceStr
{
get
{
if (this.DiscountPrice == null)
return 0;
return Math.Round((decimal)DiscountPrice, 2);
}
}
[DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
public decimal? TotalDollarStr
{
get
{
if (this.TotalDollar == null)
return 0;
return Math.Round((decimal)TotalDollar, 2);
}
}
[DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
public decimal? TotalPriceStr
{
get
{
if (this.TotalPrice == null)
return 0;
return Math.Round((decimal)TotalPrice, 2);
}
}
[DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
public decimal? StockInSumMoneyStr
{
get
{
if (this.StockInSumMoney == null)
return 0;
return Math.Round((decimal)StockInSumMoney, 2);
}
}
}
}