Ejemplo n.º 1
0
        /// <summary>
        /// 反射+配置文件
        /// </summary>
        /// <returns></returns>
        public static AbstractAudit Builder(ApplyContext context)
        {
            AbstractAudit dev = new DevManagerAudit(context)
            {
                ID = "01", Name = "开发经理王"
            };
            AbstractAudit charge = new ChargeAudit(context)
            {
                ID = "02", Name = "主管李"
            };
            AbstractAudit dep = new DepManagerAudit(context)
            {
                ID = "03", Name = "部门经理赵"
            };
            AbstractAudit major = new MajordomoAudit(context)
            {
                ID = "04", Name = "总监孙"
            };
            AbstractAudit ceo = new CEOAudit(context)
            {
                ID = "05", Name = "CEO"
            };

            dev.SetNextAudit(charge);
            charge.SetNextAudit(dep);
            dep.SetNextAudit(major);
            return(dev);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 高级开发
        /// 流程可随意调整
        /// </summary>
        /// <param name="context"></param>
        private static void Invoke3(ApplyContext context)
        {
            AbstractAudit dev = new DevManagerAudit(context)
            {
                ID = "01", Name = "开发经理王"
            };
            AbstractAudit charge = new ChargeAudit(context)
            {
                ID = "02", Name = "主管李"
            };
            AbstractAudit dep = new DepManagerAudit(context)
            {
                ID = "03", Name = "部门经理赵"
            };
            AbstractAudit major = new MajordomoAudit(context)
            {
                ID = "04", Name = "总监孙"
            };
            AbstractAudit ceo = new CEOAudit(context)
            {
                ID = "05", Name = "CEO"
            };

            dev.SetNextAudit(charge);
            charge.SetNextAudit(dep);
            dep.SetNextAudit(major);
            ceo.SetNextAudit(ceo);
            dev.Audit();
        }