コード例 #1
0
 /// <summary>
 /// 冻结规则管理器
 /// </summary>
 /// <param name="manager"></param>
 public static void FreezeOrderSpecificationManagerObject(OrderSpecificationManage manager)
 {
     using (Stream stream = File.Open(SpecificationFileName, FileMode.Create))
     {
         BinaryFormatter format = new BinaryFormatter();
         format.Serialize(stream, manager);
     }
 }
コード例 #2
0
        /// <summary>
        /// 创建第一个用于检查提交订单相关的规则管理器
        /// </summary>
        /// <returns></returns>
        public static OrderSpecificationManage CreateNewOrderSpecificationManager()
        {
            OrderSpecificationManage result = new OrderSpecificationManage()
            {
                Specification = new Dictionary <CustomerTypeEnum, OrderSpecifcationIndex>()
            };
            SubmitOrderSpecification submitOrderSpec = new SubmitOrderSpecification();

            result.Specification.Add(CustomerTypeEnum.Vip, submitOrderSpec.CheckSubmitVipOrder);
            result.Specification.Add(CustomerTypeEnum.Normal, submitOrderSpec.CheckSubmitNormalOrder);
            return(result);
        }
コード例 #3
0
 public OrderBusiness(OrderSpecificationManage orderSpceManager)
 {
     this.OrderSpecManager = orderSpceManager;
 }