using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities.Auditing;
using ContractService.Authorization.Users;
using ContractService.Client;
using ContractService.CommonManager.States;
using ContractService.Configuration;
namespace ContractService.LegalCase
{
///
/// 法律服务项目
///
[Table("Ls_LegalCases")]
public class LegalCaseInfo :FullAuditedEntity
{
///
/// 项目编码
///
[MaxLength(50)]
public string Code { get; set; }
///
/// 项目名称
///
[MaxLength(50)]
public string Name { get; set; }
///
/// 标签
///
[MaxLength(200)]
public string Tags { get; set; }
///
/// 项目描述
///
[MaxLength(500)]
public string Description { get; set; }
///
/// 项目等级
///
public int CaseLevel { get; set; }
///
/// 项目状态
///
public int CaseState { get; set; }
///
/// 项目类型
///
[MaxLength(IwbConsts.PrimaryKey)]
public string ServiceType { get; set; }
[ForeignKey("ServiceType")]
public LegalServiceType ServiceTypeInfo { get; set; }
///
/// 启动时间
///
public DateTime? StartDateTime { get; set; }
///
/// 结束时间
///
public DateTime? EndDateTime { get; set; }
///
/// 最后一次状态变更时间
///
public DateTime? StateLastChangeTime { get; set; }
///
/// 最后一次状态变更原由
///
[MaxLength(500)]
public string StateLastChangeCause { get; set; }
[MaxLength(1000)]
public string Remark { get; set; }
[MaxLength(IwbConsts.PrimaryKey)]
public string CompanyNo { get; set; }
[ForeignKey("CompanyNo")]
public ClientCompanyInfo CompanyInfo { get; set; }
}
///
/// 项目状态定义
///
public class LegalCaseStateDefinition
{
///
/// 新建
///
public const int New = 1;
///
/// 已启动
///
public const int Running = 2;
///
/// 挂起
///
public const int Hang = 3;
///
/// 结束
///
public const int End = 4;
public static string GetName(int definition, IStatesManager statesManager)
{
//switch (definition)
//{
// case 1:
// return "新建";
// case 2:
// return "已启动";
// case 3:
// return "挂起";
// case 4:
// return "结束";
// default:
// return "";
//}
return statesManager.GetDisplayValue("LegalService", "State", definition + "");
}
}
}