public EntityObject_MCE_D_DEPR_TYPE Load(IDbTransaction transaction, string id)
        {
            if (LocalMode)
            {
                EntityObject_MCE_D_DEPR_TYPE obj = new EntityObject_MCE_D_DEPR_TYPE();

                //平台自动生成代码


                obj.ID = id;
                obj    = HelperObject_MCE_D_DEPR_TYPE.Get(obj, transaction);
                return(obj);
            }
            else
            {
                throw new InvalidConstraintException();
            }
        }
        public BizLogicMsg BatchDelete(EntityObject_MCE_D_DEPR_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_D_DEPR_TYPE obj in objs)
                            {
                                amount += HelperObject_MCE_D_DEPR_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_D_DEPR_TYPE> smgr = new ServiceManager <ServiceContract_MCE_D_DEPR_TYPE>(ServiceUri))
                {
                    return(smgr.Service.BatchDelete(objs));
                }
            }
        }
 public BizLogicMsg CommitDelete(EntityObject_MCE_D_DEPR_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_D_DEPR_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_D_DEPR_TYPE> smgr = new ServiceManager <ServiceContract_MCE_D_DEPR_TYPE>(ServiceUri))
         {
             return(smgr.Service.CommitDelete(deleteBaseEntity));
         }
     }
 }
 public BizLogicMsg UndoSubmit(EntityObject_MCE_D_DEPR_TYPE 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_D_DEPR_TYPE.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_D_DEPR_TYPE> smgr = new ServiceManager <ServiceContract_MCE_D_DEPR_TYPE>(ServiceUri))
         {
             return(smgr.Service.UndoSubmit(obj));
         }
     }
 }
示例#5
0
        public EntityObject_MCE_B_ASSETS_DEPR_ALLOT Load(IDbTransaction transaction, string id, out EntityObject_COM_DEPART dept_id, out EntityObject_MCE_B_ASSETS assets_id, out EntityObject_MCE_D_DEPR_TYPE depr_id)
        {
            if (LocalMode)
            {
                EntityObject_MCE_B_ASSETS_DEPR_ALLOT obj = new EntityObject_MCE_B_ASSETS_DEPR_ALLOT();

                //平台自动生成代码
                dept_id   = new EntityObject_COM_DEPART();
                assets_id = new EntityObject_MCE_B_ASSETS();
                depr_id   = new EntityObject_MCE_D_DEPR_TYPE();


                obj.ID = id;
                obj    = HelperObject_MCE_B_ASSETS_DEPR_ALLOT.Get(obj, transaction);
                if (!string.IsNullOrEmpty(obj.DEPT_ID))
                {
                    dept_id.ID = obj.DEPT_ID;
                    dept_id    = HelperObject_COM_DEPART.Get(dept_id, transaction);
                }
                if (!string.IsNullOrEmpty(obj.ASSETS_ID))
                {
                    assets_id.ID = obj.ASSETS_ID;
                    assets_id    = HelperObject_MCE_B_ASSETS.Get(assets_id, transaction);
                }
                if (!string.IsNullOrEmpty(obj.DEPR_ID))
                {
                    depr_id.ID = obj.DEPR_ID;
                    depr_id    = HelperObject_MCE_D_DEPR_TYPE.Get(depr_id, transaction);
                }
                return(obj);
            }
            else
            {
                throw new InvalidConstraintException();
            }
        }
示例#6
0
        public BizLogicMsg Save_Ext(EntityObject_MCE_D_DEPR_TYPE item)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            EntityObject_MCE_D_DEPR_TYPE obj = new EntityObject_MCE_D_DEPR_TYPE();

                            if (!string.IsNullOrEmpty(item.ID))
                            {
                                obj.ID = item.ID;

                                obj = HelperObject_MCE_D_DEPR_TYPE.Get(obj);

                                if (obj == null)
                                {
                                    throw new Exception("获取数据出错.");
                                }
                            }

                            obj.CODE          = item.CODE;
                            obj.NAME          = item.NAME;
                            obj.YEARLY_SCALE  = item.YEARLY_SCALE;
                            obj.MONTHLY_SCALE = item.YEARLY_SCALE / 12.00m;
                            obj.STATE         = 1;

                            if (string.IsNullOrEmpty(item.ID))
                            {
                                obj.CREATE_TIME    = DateTime.Now;
                                obj.CREATE_USER_ID = Ipedf.Web.BizLogic.SystemLogic.Proxy.CurrentUser.ID;
                                int amount = HelperObject_MCE_D_DEPR_TYPE.Save(obj, transaction);
                            }
                            else
                            {
                                obj.MODIFY_TIME    = DateTime.Now;
                                obj.MODIFY_USER_ID = Ipedf.Web.BizLogic.SystemLogic.Proxy.CurrentUser.ID; int amount = HelperObject_MCE_D_DEPR_TYPE.Update(obj, transaction);
                            }


                            msg.Message = obj.ID;
                            //平台自动生成代码

                            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_D_DEPR_TYPE> smgr = new ServiceManager <ServiceContract_MCE_D_DEPR_TYPE>(ServiceUri))
                {
                    return(smgr.Service.Save_Ext(item));
                }
            }
        }
        public EntityObject_MCE_B_ASSETS_INSTOCK_D Load(IDbTransaction transaction, string id, out EntityObject_COM_TYPE currency_id, out EntityObject_COM_TYPE country, out EntityObject_MDM_D_DEPT prd_id, out EntityObject_MCE_B_ASSETS_INSTOCK base_id, out EntityObject_MCE_D_MCE_TYPE asset_type_id, out EntityObject_MCE_D_DEPR_TYPE depr_type_id, out EntityObject_COM_TYPE unit_id, out EntityObject_COM_DEPART using_dept_id)
        {
            if (LocalMode)
            {
                EntityObject_MCE_B_ASSETS_INSTOCK_D obj = new EntityObject_MCE_B_ASSETS_INSTOCK_D();

                //平台自动生成代码
                currency_id   = new EntityObject_COM_TYPE();
                country       = new EntityObject_COM_TYPE();
                prd_id        = new EntityObject_MDM_D_DEPT();
                base_id       = new EntityObject_MCE_B_ASSETS_INSTOCK();
                asset_type_id = new EntityObject_MCE_D_MCE_TYPE();
                depr_type_id  = new EntityObject_MCE_D_DEPR_TYPE();
                unit_id       = new EntityObject_COM_TYPE();
                using_dept_id = new EntityObject_COM_DEPART();


                obj.ID = id;
                obj    = HelperObject_MCE_B_ASSETS_INSTOCK_D.Get(obj, transaction);
                if (!string.IsNullOrEmpty(obj.CURRENCY_ID))
                {
                    currency_id.ID = obj.CURRENCY_ID;
                    currency_id    = HelperObject_COM_TYPE.Get(currency_id, transaction);
                }
                if (!string.IsNullOrEmpty(obj.COUNTRY))
                {
                    country.ID = obj.COUNTRY;
                    country    = HelperObject_COM_TYPE.Get(country, transaction);
                }
                if (!string.IsNullOrEmpty(obj.PRD_ID))
                {
                    prd_id.ID = obj.PRD_ID;
                    prd_id    = HelperObject_MDM_D_DEPT.Get(prd_id, transaction);
                }
                if (!string.IsNullOrEmpty(obj.BASE_ID))
                {
                    base_id.ID = obj.BASE_ID;
                    base_id    = HelperObject_MCE_B_ASSETS_INSTOCK.Get(base_id, transaction);
                }
                if (!string.IsNullOrEmpty(obj.ASSET_TYPE_ID))
                {
                    asset_type_id.ID = obj.ASSET_TYPE_ID;
                    asset_type_id    = HelperObject_MCE_D_MCE_TYPE.Get(asset_type_id, transaction);
                }
                if (!string.IsNullOrEmpty(obj.DEPR_TYPE_ID))
                {
                    depr_type_id.ID = obj.DEPR_TYPE_ID;
                    depr_type_id    = HelperObject_MCE_D_DEPR_TYPE.Get(depr_type_id, transaction);
                }
                if (!string.IsNullOrEmpty(obj.UNIT_ID))
                {
                    unit_id.ID = obj.UNIT_ID;
                    unit_id    = HelperObject_COM_TYPE.Get(unit_id, transaction);
                }
                if (!string.IsNullOrEmpty(obj.USING_DEPT_ID))
                {
                    using_dept_id.ID = obj.USING_DEPT_ID;
                    using_dept_id    = HelperObject_COM_DEPART.Get(using_dept_id, transaction);
                }
                return(obj);
            }
            else
            {
                throw new InvalidConstraintException();
            }
        }