Пример #1
0
        public DisplayObject_MCE_B_ASSETS_MT_APPLY_EN[] Query(CauseObject_MCE_B_ASSETS_MT_APPLY_EN cause, PagingParamter paging, OrderByParameter order)
        {
            if (LocalMode)
            {
                SystemLogic.Proxy.AuditQuery(cause);

                //平台自动生成代码
                return(HelperObject_MCE_B_ASSETS_MT_APPLY_EN.Query(cause, paging, order));
            }
            else
            {
                using (ServiceManager <ServiceContract_MCE_B_ASSETS_MT_APPLY_EN> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_MT_APPLY_EN>(ServiceUri))
                {
                    return(smgr.Service.Query(cause, paging, order));
                }
            }
        }
Пример #2
0
        public BizLogicMsg BatchUpdate(EntityObject_MCE_B_ASSETS_MT_APPLY_EN[] objs)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            foreach (EntityObject_MCE_B_ASSETS_MT_APPLY_EN obj in objs)
                            {
                                SystemLogic.Proxy.AuditEdit(obj);
                            }
                            int amount = 0;

                            //平台自动生成代码
                            foreach (EntityObject_MCE_B_ASSETS_MT_APPLY_EN obj in objs)
                            {
                                amount += HelperObject_MCE_B_ASSETS_MT_APPLY_EN.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_MCE_B_ASSETS_MT_APPLY_EN> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_MT_APPLY_EN>(ServiceUri))
                {
                    return(smgr.Service.BatchUpdate(objs));
                }
            }
        }
Пример #3
0
 public BizLogicMsg CommitDelete(EntityObject_MCE_B_ASSETS_MT_APPLY_EN 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.ID;
                     HelperObject_.Delete(p, transaction);
                     HelperObject_MCE_B_ASSETS_MT_APPLY_EN.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_MCE_B_ASSETS_MT_APPLY_EN> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_MT_APPLY_EN>(ServiceUri))
         {
             return(smgr.Service.CommitDelete(deleteBaseEntity));
         }
     }
 }
Пример #4
0
 public BizLogicMsg UndoSubmit(EntityObject_MCE_B_ASSETS_MT_APPLY_EN obj)
 {
     if (LocalMode)
     {
         BizLogicMsg msg = new BizLogicMsg();
         using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
         {
             using (IDbTransaction transaction = connection.BeginTransaction())
             {
                 try
                 {
                     SystemLogic.Proxy.AuditUndoSubmit(obj);
                     int amount = HelperObject_MCE_B_ASSETS_MT_APPLY_EN.Update(obj, transaction);
                     //平台自动生成代码
                     PostUndoSubmit(obj, transaction);
                     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_MCE_B_ASSETS_MT_APPLY_EN> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_MT_APPLY_EN>(ServiceUri))
         {
             return(smgr.Service.UndoSubmit(obj));
         }
     }
 }
Пример #5
0
 public BizLogicMsg Delete(CauseObject_MCE_B_ASSETS_MT_APPLY_EN cause)
 {
     if (LocalMode)
     {
         BizLogicMsg msg = new BizLogicMsg();
         using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
         {
             using (IDbTransaction transaction = connection.BeginTransaction())
             {
                 try
                 {
                     int amount = HelperObject_MCE_B_ASSETS_MT_APPLY_EN.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_MCE_B_ASSETS_MT_APPLY_EN> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_MT_APPLY_EN>(ServiceUri))
         {
             return(smgr.Service.Delete(cause));
         }
     }
 }