public EntityObject_MCE_B_ASSETS_METER_CHECK Load(IDbTransaction transaction, string id, out EntityObject_MDM_D_DEPT prd_id, out EntityObject_COM_TYPE unit_id, out EntityObject_MCE_B_ASSETS_METER_TYPE meter_type, out EntityObject_COM_USER head_user_id, out EntityObject_COM_USER audit_user_id, out EntityObject_COM_DEPART using_dept_id, out EntityObject_MCE_B_ASSETS assets_id)
        {
            if (LocalMode)
            {
                EntityObject_MCE_B_ASSETS_METER_CHECK obj = new EntityObject_MCE_B_ASSETS_METER_CHECK();

                //平台自动生成代码
                prd_id        = new EntityObject_MDM_D_DEPT();
                unit_id       = new EntityObject_COM_TYPE();
                meter_type    = new EntityObject_MCE_B_ASSETS_METER_TYPE();
                head_user_id  = new EntityObject_COM_USER();
                audit_user_id = new EntityObject_COM_USER();
                using_dept_id = new EntityObject_COM_DEPART();
                assets_id     = new EntityObject_MCE_B_ASSETS();


                obj.ID = id;
                obj    = HelperObject_MCE_B_ASSETS_METER_CHECK.Get(obj, 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.UNIT_ID))
                {
                    unit_id.ID = obj.UNIT_ID;
                    unit_id    = HelperObject_COM_TYPE.Get(unit_id, transaction);
                }
                if (!string.IsNullOrEmpty(obj.METER_TYPE))
                {
                    meter_type.ID = obj.METER_TYPE;
                    meter_type    = HelperObject_MCE_B_ASSETS_METER_TYPE.Get(meter_type, transaction);
                }
                if (!string.IsNullOrEmpty(obj.HEAD_USER_ID))
                {
                    head_user_id.ID = obj.HEAD_USER_ID;
                    head_user_id    = HelperObject_COM_USER.Get(head_user_id, transaction);
                }
                if (!string.IsNullOrEmpty(obj.AUDIT_USER_ID))
                {
                    audit_user_id.ID = obj.AUDIT_USER_ID;
                    audit_user_id    = HelperObject_COM_USER.Get(audit_user_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);
                }
                if (!string.IsNullOrEmpty(obj.ASSETS_ID))
                {
                    assets_id.ID = obj.ASSETS_ID;
                    assets_id    = HelperObject_MCE_B_ASSETS.Get(assets_id, transaction);
                }
                return(obj);
            }
            else
            {
                throw new InvalidConstraintException();
            }
        }
Esempio n. 2
0
        public BizLogicMsg Delete_Ext(List <string> listID)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            if (listID != null && listID.Count > 0)
                            {
                                foreach (string strID in listID)
                                {
                                    EntityObject_MCE_B_ASSETS_METER_TYPE obj = new EntityObject_MCE_B_ASSETS_METER_TYPE();
                                    obj.ID = strID;

                                    obj = HelperObject_MCE_B_ASSETS_METER_TYPE.Get(obj);

                                    if (obj != null)
                                    {
                                        HelperObject_MCE_B_ASSETS_METER_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_METER_TYPE> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_METER_TYPE>(ServiceUri))
                {
                    return(smgr.Service.Delete_Ext(listID));
                }
            }
        }
 public DisplayObject_MCE_B_ASSETS_METER_TYPE Get(DisplayObject_MCE_B_ASSETS_METER_TYPE obj)
 {
     if (LocalMode)
     {
         //平台自动生成代码
         return(HelperObject_MCE_B_ASSETS_METER_TYPE.Get(obj));
     }
     else
     {
         using (ServiceManager <ServiceContract_MCE_B_ASSETS_METER_TYPE> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_METER_TYPE>(ServiceUri))
         {
             return(smgr.Service.Get(obj));
         }
     }
 }
        public EntityObject_MCE_B_ASSETS_METER_TYPE Load(IDbTransaction transaction, string id)
        {
            if (LocalMode)
            {
                EntityObject_MCE_B_ASSETS_METER_TYPE obj = new EntityObject_MCE_B_ASSETS_METER_TYPE();

                //平台自动生成代码


                obj.ID = id;
                obj    = HelperObject_MCE_B_ASSETS_METER_TYPE.Get(obj, transaction);
                return(obj);
            }
            else
            {
                throw new InvalidConstraintException();
            }
        }
Esempio n. 5
0
        public BizLogicMsg Save_Ext(EntityObject_MCE_B_ASSETS_METER_TYPE item)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            EntityObject_MCE_B_ASSETS_METER_TYPE obj = new EntityObject_MCE_B_ASSETS_METER_TYPE();

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

                                obj = HelperObject_MCE_B_ASSETS_METER_TYPE.Get(obj);

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

                            obj.CODE  = item.CODE;
                            obj.NAME  = item.NAME;
                            obj.STATE = item.STATE;

                            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_B_ASSETS_METER_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_B_ASSETS_METER_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_B_ASSETS_METER_TYPE> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_METER_TYPE>(ServiceUri))
                {
                    return(smgr.Service.Save_Ext(item));
                }
            }
        }