/// <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); } }
/// <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); }
public OrderBusiness(OrderSpecificationManage orderSpceManager) { this.OrderSpecManager = orderSpceManager; }