public BizLogicMsg CommitUpdate(EntityObject_V_MCE_ASSET_OUTSTOCK_BACK updateBaseEntity, EntityObject_[] saveDetailEntities, EntityObject_[] updateDetailEntities, EntityObject_[] deleteDetailEntities)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            SystemLogic.Proxy.AuditEdit(updateBaseEntity);
                            HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Update(updateBaseEntity, transaction);

                            //平台自动生成代码
                            foreach (EntityObject_ obj in saveDetailEntities)
                            {
                                obj. = updateBaseEntity.ASSETS_CODE;
                                SystemLogic.Proxy.AuditAdd(obj);
                                HelperObject_.Save(obj, transaction);
                            }
                            foreach (EntityObject_ obj in updateDetailEntities)
                            {
                                SystemLogic.Proxy.AuditEdit(obj);
                                HelperObject_.Update(obj, transaction);
                            }
                            foreach (EntityObject_ obj in deleteDetailEntities)
                            {
                                HelperObject_.Delete(obj, transaction);
                            }
                            PostSave(updateBaseEntity, 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(updateBaseEntity, saveDetailEntities, updateDetailEntities, deleteDetailEntities));
                }
            }
        }
 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 int UpdateByTrans(EntityObject_V_MCE_ASSET_OUTSTOCK_BACK obj, IDbTransaction transaction)
 {
     if (LocalMode)
     {
         SystemLogic.Proxy.AuditEdit(obj);
         return(HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Update(obj, transaction));
         //平台自动生成代码
     }
     else
     {
         throw new InvalidConstraintException();
     }
 }
 public int SaveByTrans(EntityObject_V_MCE_ASSET_OUTSTOCK_BACK obj, IDbTransaction transaction)
 {
     if (LocalMode)
     {
         SystemLogic.Proxy.AuditAdd(obj);
         int amount = HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Save(obj, transaction);
         //平台自动生成代码
         return(amount);
     }
     else
     {
         throw new InvalidConstraintException();
     }
 }
 public DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK[] List()
 {
     if (LocalMode)
     {
         //平台自动生成代码
         return(HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.List());
     }
     else
     {
         using (ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK> smgr = new ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK>(ServiceUri))
         {
             return(smgr.Service.List());
         }
     }
 }
 public EntityObject_V_MCE_ASSET_OUTSTOCK_BACK Get(EntityObject_V_MCE_ASSET_OUTSTOCK_BACK obj)
 {
     if (LocalMode)
     {
         //平台自动生成代码
         return(HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Get(obj));
     }
     else
     {
         using (ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK> smgr = new ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK>(ServiceUri))
         {
             return(smgr.Service.Get(obj));
         }
     }
 }
 public BizLogicMsg UndoAudit(EntityObject_V_MCE_ASSET_OUTSTOCK_BACK obj)
 {
     if (LocalMode)
     {
         BizLogicMsg msg = new BizLogicMsg();
         using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
         {
             using (IDbTransaction transaction = connection.BeginTransaction())
             {
                 try
                 {
                     SystemLogic.Proxy.AuditUndoAudit(obj);
                     int amount = HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Update(obj, transaction);
                     //平台自动生成代码
                     PostUndoAudit(obj, transaction);
                     //执行撤回操作
                     msg = SystemLogic.Proxy.BillUndoAudit(obj, transaction);
                     if (!msg.Succeed)
                     {
                         throw new Exception(msg.Message);
                     }
                     transaction.Commit();
                 }
                 catch (Exception expt)
                 {
                     SystemLogic.Proxy.AuditState(obj, Ipedf.Common.数据状态.已审核);
                     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.UndoAudit(obj));
         }
     }
 }
        public BizLogicMsg BatchUpdate(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
                        {
                            foreach (EntityObject_V_MCE_ASSET_OUTSTOCK_BACK obj in objs)
                            {
                                SystemLogic.Proxy.AuditEdit(obj);
                            }
                            int amount = 0;

                            //平台自动生成代码
                            foreach (EntityObject_V_MCE_ASSET_OUTSTOCK_BACK obj in objs)
                            {
                                amount += HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Update(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.BatchUpdate(objs));
                }
            }
        }
        public DisplayObject_V_MCE_ASSET_OUTSTOCK_BACK[] Query(CauseObject_V_MCE_ASSET_OUTSTOCK_BACK cause, PagingParamter paging, OrderByParameter order)
        {
            if (LocalMode)
            {
                SystemLogic.Proxy.AuditQuery(cause);

                //平台自动生成代码
                return(HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Query(cause, paging, order));
            }
            else
            {
                using (ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK> smgr = new ServiceManager <ServiceContract_V_MCE_ASSET_OUTSTOCK_BACK>(ServiceUri))
                {
                    return(smgr.Service.Query(cause, paging, order));
                }
            }
        }
 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));
         }
     }
 }
 public BizLogicMsg Delete(CauseObject_V_MCE_ASSET_OUTSTOCK_BACK cause)
 {
     if (LocalMode)
     {
         BizLogicMsg msg = new BizLogicMsg();
         using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
         {
             using (IDbTransaction transaction = connection.BeginTransaction())
             {
                 try
                 {
                     int amount = HelperObject_V_MCE_ASSET_OUTSTOCK_BACK.Delete(cause, 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.Delete(cause));
         }
     }
 }