Exemple #1
0
        public BizLogicMsg Save_CheckType_Ext(string strBaseID, List <string> listID)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            CauseObject_MCE_B_ASSETS_CHECK_TYPE pDetail = new CauseObject_MCE_B_ASSETS_CHECK_TYPE();
                            pDetail.BASE_ID = strBaseID;
                            HelperObject_MCE_B_ASSETS_CHECK_TYPE.Delete(pDetail, transaction);


                            if (listID != null && listID.Count > 0)
                            {
                                foreach (string strID  in listID)
                                {
                                    EntityObject_MCE_B_ASSETS_CHECK_TYPE entity_D = new EntityObject_MCE_B_ASSETS_CHECK_TYPE();
                                    entity_D.BASE_ID = strBaseID;

                                    entity_D.TYPE_ID = strID;

                                    HelperObject_MCE_B_ASSETS_CHECK_TYPE.Save(entity_D, 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_CHECK> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_CHECK>(ServiceUri))
                {
                    return(smgr.Service.Save_CheckType_Ext(strBaseID, listID));
                }
            }
        }
Exemple #2
0
 public int DeleteByTrans2(CauseObject_MCE_B_ASSETS_CHECK_TYPE cause, IDbTransaction transaction)
 {
     if (LocalMode)
     {
         return(HelperObject_MCE_B_ASSETS_CHECK_TYPE.Delete(cause, transaction));
         //平台自动生成代码
     }
     else
     {
         throw new InvalidConstraintException();
     }
 }
Exemple #3
0
 public BizLogicMsg CommitUpdate(EntityObject_MCE_B_ASSETS_CHECK_TYPE[] saveEntities, EntityObject_MCE_B_ASSETS_CHECK_TYPE[] updateEntities, EntityObject_MCE_B_ASSETS_CHECK_TYPE[] deleteEntities)
 {
     if (LocalMode)
     {
         BizLogicMsg msg = new BizLogicMsg();
         using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
         {
             using (IDbTransaction transaction = connection.BeginTransaction())
             {
                 try
                 {
                     //平台自动生成代码
                     foreach (EntityObject_MCE_B_ASSETS_CHECK_TYPE obj in saveEntities)
                     {
                         SystemLogic.Proxy.AuditAdd(obj);
                         HelperObject_MCE_B_ASSETS_CHECK_TYPE.Save(obj, transaction);
                     }
                     foreach (EntityObject_MCE_B_ASSETS_CHECK_TYPE obj in updateEntities)
                     {
                         SystemLogic.Proxy.AuditEdit(obj);
                         HelperObject_MCE_B_ASSETS_CHECK_TYPE.Update(obj, transaction);
                     }
                     foreach (EntityObject_MCE_B_ASSETS_CHECK_TYPE obj in deleteEntities)
                     {
                         HelperObject_MCE_B_ASSETS_CHECK_TYPE.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_MCE_B_ASSETS_CHECK_TYPE> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_CHECK_TYPE>(ServiceUri))
         {
             return(smgr.Service.CommitUpdate(saveEntities, updateEntities, deleteEntities));
         }
     }
 }
Exemple #4
0
        public BizLogicMsg BatchDelete(EntityObject_MCE_B_ASSETS_CHECK_TYPE[] objs)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            int amount = 0;

                            //平台自动生成代码
                            foreach (EntityObject_MCE_B_ASSETS_CHECK_TYPE obj in objs)
                            {
                                amount += HelperObject_MCE_B_ASSETS_CHECK_TYPE.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_MCE_B_ASSETS_CHECK_TYPE> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_CHECK_TYPE>(ServiceUri))
                {
                    return(smgr.Service.BatchDelete(objs));
                }
            }
        }
Exemple #5
0
 public BizLogicMsg CommitDelete(EntityObject_MCE_B_ASSETS_CHECK_TYPE 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_CHECK_TYPE.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_CHECK_TYPE> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_CHECK_TYPE>(ServiceUri))
         {
             return(smgr.Service.CommitDelete(deleteBaseEntity));
         }
     }
 }