public int DeleteByTrans2(CauseObject_V_MCE_ASSET_OUTSTOCK_BACK cause, IDbTransaction transaction)
 {
     if (LocalMode)
     {
         return(HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Delete(cause, transaction));
         //平台自动生成代码
     }
     else
     {
         throw new InvalidConstraintException();
     }
 }
 public BizLogicMsg CommitUpdate(EntityObject_V_MCE_ASSET_OUTSTOCK_BACK[] saveEntities, EntityObject_V_MCE_ASSET_OUTSTOCK_BACK[] updateEntities, EntityObject_V_MCE_ASSET_OUTSTOCK_BACK[] deleteEntities)
 {
     if (LocalMode)
     {
         BizLogicMsg msg = new BizLogicMsg();
         using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
         {
             using (IDbTransaction transaction = connection.BeginTransaction())
             {
                 try
                 {
                     //平台自动生成代码
                     foreach (EntityObject_V_MCE_ASSET_OUTSTOCK_BACK obj in saveEntities)
                     {
                         SystemLogic.Proxy.AuditAdd(obj);
                         HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Save(obj, transaction);
                     }
                     foreach (EntityObject_V_MCE_ASSET_OUTSTOCK_BACK obj in updateEntities)
                     {
                         SystemLogic.Proxy.AuditEdit(obj);
                         HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Update(obj, transaction);
                     }
                     foreach (EntityObject_V_MCE_ASSET_OUTSTOCK_BACK obj in deleteEntities)
                     {
                         HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Delete(obj, transaction);
                     }
                     transaction.Commit();
                 }
                 catch (Exception expt)
                 {
                     transaction.Rollback();
                     msg = new BizLogicMsg(false, expt.Message);
                     Error(expt);
                 }
                 finally
                 {
                     IDALProvider.IDAL.PushConnection(connection);
                 }
             }
         }
         return(msg);
     }
     else
     {
         using (ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK> smgr = new ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK>(ServiceUri))
         {
             return(smgr.Service.CommitUpdate(saveEntities, updateEntities, deleteEntities));
         }
     }
 }
        public BizLogicMsg BatchDelete(EntityObject_V_MCE_ASSET_OUTSTOCK_BACK[] objs)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            int amount = 0;

                            //平台自动生成代码
                            foreach (EntityObject_V_MCE_ASSET_OUTSTOCK_BACK obj in objs)
                            {
                                amount += HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Delete(obj, transaction);
                            }
                            transaction.Commit();
                        }
                        catch (Exception expt)
                        {
                            transaction.Rollback();
                            msg = new BizLogicMsg(false, expt.Message);
                            Error(expt);
                        }
                        finally
                        {
                            IDALProvider.IDAL.PushConnection(connection);
                        }
                    }
                }
                return(msg);
            }
            else
            {
                using (ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK> smgr = new ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK>(ServiceUri))
                {
                    return(smgr.Service.BatchDelete(objs));
                }
            }
        }
 public BizLogicMsg CommitDelete(EntityObject_V_MCE_ASSET_OUTSTOCK_BACK deleteBaseEntity)
 {
     if (LocalMode)
     {
         BizLogicMsg msg = new BizLogicMsg();
         using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
         {
             using (IDbTransaction transaction = connection.BeginTransaction())
             {
                 try
                 {
                     //平台自动生成代码
                     CauseObject_ p = new CauseObject_();
                     p. = deleteBaseEntity.ASSETS_CODE;
                     HelperObject_.Delete(p, transaction);
                     HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Delete(deleteBaseEntity, transaction);
                     transaction.Commit();
                 }
                 catch (Exception expt)
                 {
                     transaction.Rollback();
                     msg = new BizLogicMsg(false, expt.Message);
                     Error(expt);
                 }
                 finally
                 {
                     IDALProvider.IDAL.PushConnection(connection);
                 }
             }
         }
         return(msg);
     }
     else
     {
         using (ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK> smgr = new ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK>(ServiceUri))
         {
             return(smgr.Service.CommitDelete(deleteBaseEntity));
         }
     }
 }