public IEnumerable <R> List(IProcess <R, D> proc, params object[] param) { using (db = getContextInstance()) { using (seguranca_db = new SecurityContext()) { proc.Create(db, seguranca_db); return(proc.List(param)); } } }
public R Run(IProcess <R, D> proc, Repository value = null, params object[] param) { using (db = getContextInstance()) { using (seguranca_db = new SecurityContext()) { proc.Create(db, seguranca_db); return(proc.Run(value)); } } }
public override R Execute(IProcess <R, D> proc, Repository value = null) { using (db = getContextInstance()) { using (seguranca_db = new SecurityContext()) { proc.Create(db, seguranca_db); R r = proc.Run(value); if (r != null && r.mensagem.Code == 0) { db.SaveChanges(); seguranca_db.SaveChanges(); } Mensagem = r != null ? r.mensagem : null; return(r); } } }
/// <summary> /// 创建收款单 /// </summary> /// <param name="entity"></param> /// <returns></returns> public virtual PayItemInfo Create(PayItemInfo entity) { IProcess processor = PayItemProcessFactory.Get(entity.OrderType.Value); return(processor.Create(entity)); }