예제 #1
0
        /// <summary>
        ///     创建活动类型
        /// </summary>
        /// <param name="id">ID</param>
        /// <param name="type">活动类型</param>
        /// <param name="name">活动名称</param>
        /// <param name="needRequest">是否需要申请</param>
        /// <returns></returns>
        public static ActionCategory CreateActionCategory(Guid id, string type, string name,bool needRequest)
        {
            var actionCategory = new ActionCategory
            {
                ActionType = type,
                ActionName = name,
                NeedRequest = needRequest,
            };
            actionCategory.ChangeCurrentIdentity(id);

            return actionCategory;
        }
예제 #2
0
파일: PlanHistory.cs 프로젝트: unicloud/FRP
        /// <summary>
        ///     设置活动类型
        /// </summary>
        /// <param name="actionCategory">活动类型</param>
        /// <param name="targetCategory">目标类别</param>
        public void SetActionCategory(ActionCategory actionCategory, ActionCategory targetCategory)
        {
            if (actionCategory == null || actionCategory.IsTransient())
            {
                throw new ArgumentException("活动类型参数为空!");
            }

            ActionCategory = actionCategory;
            ActionCategoryId = actionCategory.Id;

            if (targetCategory == null || targetCategory.IsTransient())
            {
                throw new ArgumentException("目标类别参数为空!");
            }

            TargetCategory = targetCategory;
            TargetCategoryId = targetCategory.Id;
        }
예제 #3
0
        /// <summary>
        ///     设置引进方式
        /// </summary>
        /// <param name="importCategory">引进方式</param>
        public void SetImportCategory(ActionCategory importCategory)
        {
            if (importCategory == null || importCategory.IsTransient())
            {
                throw new ArgumentException("引进方式参数为空!");
            }

            ImportCategory = importCategory;
            ImportCategoryId = importCategory.Id;
        }
예제 #4
0
 /// <summary>
 ///     设置实际退出方式
 /// </summary>
 /// <param name="exportCategory">实际退出方式</param>
 public void SetExportCategoryID(ActionCategory exportCategory)
 {
     if (exportCategory != null)
     {
         ExportCategory = exportCategory;
         ExportCategoryId = exportCategory.Id;
     }
 }
예제 #5
0
 /// <summary>
 ///     设置活动类型
 /// </summary>
 /// <param name="actionCategory">活动类型</param>
 public void SetActionCategory(ActionCategory actionCategory)
 {
     if (actionCategory == null)
     {
         throw new ArgumentException("活动类型Id参数为空!");
     }
     ActionCategory = actionCategory;
     ActionCategoryId = actionCategory.Id;
 }