Пример #1
0
 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));
         }
     }
 }
Пример #2
0
 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));
         }
     }
 }
Пример #3
0
        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);
                }
            }
        }
Пример #4
0
        /// <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));
        }