示例#1
0
        public BizLogicMsg Audit_Ext(List <string> listID)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            foreach (string strID in listID)
                            {
                                EntityObject_MCE_B_ASSETS_DEPR obj = new EntityObject_MCE_B_ASSETS_DEPR();
                                obj.ID = strID;

                                obj = HelperObject_MCE_B_ASSETS_DEPR.Get(obj);

                                if (obj != null)
                                {
                                    if (obj.STATE == 3 || obj.STATE == 4)
                                    {
                                        throw new Exception("已经审核的数据不能再审核.");
                                    }

                                    obj.STATE         = 3;
                                    obj.AUDIT_TIME    = DateTime.Now;
                                    obj.AUDIT_USER_ID = Ipedf.Web.BizLogic.SystemLogic.Proxy.CurrentUser.ID;
                                    HelperObject_MCE_B_ASSETS_DEPR.Update(obj, transaction);

                                    CauseObject_MCE_B_ASSETS_DEPR_D pDeprDetail = new CauseObject_MCE_B_ASSETS_DEPR_D();
                                    pDeprDetail.BASE_ID = strID;
                                    EntityObject_MCE_B_ASSETS_DEPR_D[] deprDetails = HelperObject_MCE_B_ASSETS_DEPR_D.Query(pDeprDetail, transaction);
                                    //更新资产卡片记录
                                    foreach (EntityObject_MCE_B_ASSETS_DEPR_D deprDetail in deprDetails)
                                    {
                                        EntityObject_MCE_B_ASSETS assets = new EntityObject_MCE_B_ASSETS();
                                        assets.ID                        = deprDetail.ASSETS_ID;
                                        assets.NET_VALUE                 = deprDetail.NEW_NET_VALUE; //净值
                                        assets.DEPR_MONTH_AMOUNT        += 1;                        //累计折旧月份
                                        assets.ACCUMULATED_DEPRECIATION += deprDetail.MONEY;         //累计折旧金额
                                        assets.SetUpdate("NET_VALUE", "DEPR_MONTH_AMOUNT", "ACCUMULATED_DEPRECIATION");
                                        HelperObject_MCE_B_ASSETS.Update(assets, 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_DEPR> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_DEPR>(ServiceUri))
                {
                    return(smgr.Service.Audit_Ext(listID));
                }
            }
        }
示例#2
0
        public BizLogicMsg Audit_Ext(JsonMceAssetsRoll item)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            EntityObject_MCE_B_ASSETS_ROLL obj = new EntityObject_MCE_B_ASSETS_ROLL();
                            obj.ID = item.id;

                            obj = HelperObject_MCE_B_ASSETS_ROLL.Get(obj);

                            if (obj != null)
                            {
                                if (obj.AUDIT_STATE == 3 || obj.AUDIT_STATE == 4)
                                {
                                    throw new Exception("已经审核的案卷信息不能再审核.");
                                }

                                obj.AUDIT_STATE   = 3;
                                obj.AUDIT_TIME    = DateTime.Now;
                                obj.AUDIT_USER_ID = Ipedf.Web.BizLogic.SystemLogic.Proxy.CurrentUser.ID;
                                HelperObject_MCE_B_ASSETS_ROLL.Update(obj, transaction);


                                EntityObject_MCE_B_ASSETS objMCE_B_ASSETS = new EntityObject_MCE_B_ASSETS();
                                objMCE_B_ASSETS.ID = item.assets_id;

                                objMCE_B_ASSETS = HelperObject_MCE_B_ASSETS.Get(objMCE_B_ASSETS);

                                if (obj != null)
                                {
                                    objMCE_B_ASSETS.FILE_CODE = obj.CODE;
                                    HelperObject_MCE_B_ASSETS.Update(objMCE_B_ASSETS, 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_ROLL> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_ROLL>(ServiceUri))
                {
                    return(smgr.Service.Audit_Ext(item));
                }
            }
        }
示例#3
0
        public BizLogicMsg Audit_Ext(List <string> listID)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            foreach (string strID in listID)
                            {
                                EntityObject_MCE_B_ASSETS_CHECK obj = new EntityObject_MCE_B_ASSETS_CHECK();
                                obj.ID = strID;

                                obj = HelperObject_MCE_B_ASSETS_CHECK.Get(obj);

                                if (obj != null)
                                {
                                    if (obj.STATE == 3 || obj.STATE == 4)
                                    {
                                        throw new Exception("已经审核的数据不能再审核.");
                                    }

                                    obj.STATE         = 3;
                                    obj.AUDIT_TIME    = DateTime.Now;
                                    obj.AUDIT_USER_ID = Ipedf.Web.BizLogic.SystemLogic.Proxy.CurrentUser.ID;
                                    HelperObject_MCE_B_ASSETS_CHECK.Update(obj, transaction);


                                    CauseObject_MCE_B_ASSETS_CHECK_D pDetail = new CauseObject_MCE_B_ASSETS_CHECK_D();
                                    pDetail.BASE_ID = strID;
                                    EntityObject_MCE_B_ASSETS_CHECK_D[] deprDetails = HelperObject_MCE_B_ASSETS_CHECK_D.Query(pDetail, transaction);
                                    //更新资产卡片记录
                                    foreach (EntityObject_MCE_B_ASSETS_CHECK_D dDetail in deprDetails)
                                    {
                                        string strOldState = dDetail.OLD_ASSETS_STATE ?? "";
                                        string strNewState = dDetail.NEW_ASSETS_STATE ?? "";
                                        if (strOldState != strNewState && !string.IsNullOrEmpty(strNewState))
                                        {
                                            EntityObject_MCE_B_ASSETS assets = new EntityObject_MCE_B_ASSETS();
                                            assets.ID           = dDetail.ASSETS_ID;
                                            assets.ASSETS_STATE = dDetail.NEW_ASSETS_STATE;//净值

                                            assets.SetUpdate("ASSETS_STATE");
                                            HelperObject_MCE_B_ASSETS.Update(assets, 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.Audit_Ext(listID));
                }
            }
        }
示例#4
0
        public BizLogicMsg Audit_Ext2(JsonWriteOffAudit item)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            EntityObject_MCE_B_ASSETS_WRITE_OFF obj = new EntityObject_MCE_B_ASSETS_WRITE_OFF();
                            obj.ID = item.ID;

                            obj = HelperObject_MCE_B_ASSETS_WRITE_OFF.Get(obj);

                            if (obj != null)
                            {
                                if (obj.STATE > 4)
                                {
                                    throw new Exception("已经审核的数据不能再审核.");
                                }

                                obj.STATE = int.Parse(item.AUDIT_STATE);

                                obj.AUDIT_TIME    = DateTime.Parse(item.AUDIT_TIME);
                                obj.AUDIT_USER_ID = item.AUDIT_USER_ID;
                                obj.SUMARRY       = item.SUMARRY;

                                HelperObject_MCE_B_ASSETS_WRITE_OFF.Update(obj, transaction);


                                if (obj.STATE == 5)
                                {
                                    DisplayObject_MCE_B_ASSETS_WRITE_OFF_D[] listD = BizLogicObject_MCE_B_ASSETS_WRITE_OFF_D.Proxy.Query(new CauseObject_MCE_B_ASSETS_WRITE_OFF_D()
                                    {
                                        BASE_ID = obj.ID
                                    });

                                    if (listD != null && listD.Length > 0)
                                    {
                                        foreach (DisplayObject_MCE_B_ASSETS_WRITE_OFF_D item_D in listD)
                                        {
                                            EntityObject_MCE_B_ASSETS objMCE_B_ASSETS = new EntityObject_MCE_B_ASSETS();
                                            objMCE_B_ASSETS.ID = item_D.ASSET_ID;

                                            objMCE_B_ASSETS = HelperObject_MCE_B_ASSETS.Get(objMCE_B_ASSETS);

                                            if (obj != null)
                                            {
                                                objMCE_B_ASSETS.ASSETS_STATE     = "00530003";
                                                objMCE_B_ASSETS.OUT_ACCOUNT_DATE = obj.AUDIT_TIME;
                                                HelperObject_MCE_B_ASSETS.Update(objMCE_B_ASSETS, 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_WRITE_OFF> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_WRITE_OFF>(ServiceUri))
                {
                    return(smgr.Service.Audit_Ext2(item));
                }
            }
        }
示例#5
0
        public BizLogicMsg Audit_Ext(string strID)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            EntityObject_MCE_B_ASSETS_WRITE_OFF obj = new EntityObject_MCE_B_ASSETS_WRITE_OFF();
                            obj.ID = strID;

                            obj = HelperObject_MCE_B_ASSETS_WRITE_OFF.Get(obj);

                            if (obj != null)
                            {
                                if (obj.AUDIT_STATE == 3 || obj.AUDIT_STATE == 4)
                                {
                                    throw new Exception("已经审核的报废信息不能再审核.");
                                }

                                obj.AUDIT_STATE   = 3;
                                obj.AUDIT_TIME    = DateTime.Now;
                                obj.AUDIT_USER_ID = Ipedf.Web.BizLogic.SystemLogic.Proxy.CurrentUser.ID;
                                HelperObject_MCE_B_ASSETS_WRITE_OFF.Update(obj, transaction);

                                EntityObject_MCE_B_ASSETS objMCE_B_ASSETS = new EntityObject_MCE_B_ASSETS();
                                objMCE_B_ASSETS.ID = obj.ASSETS_ID;

                                objMCE_B_ASSETS = HelperObject_MCE_B_ASSETS.Get(objMCE_B_ASSETS);

                                if (obj != null)
                                {
                                    objMCE_B_ASSETS.ASSETS_STATE     = "00530003";
                                    objMCE_B_ASSETS.OUT_ACCOUNT_DATE = obj.CREATE_DATE;
                                    HelperObject_MCE_B_ASSETS.Update(objMCE_B_ASSETS, 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_WRITE_OFF> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_WRITE_OFF>(ServiceUri))
                {
                    return(smgr.Service.Audit_Ext(strID));
                }
            }
        }
示例#6
0
        public BizLogicMsg Audit_Ext2(List <string> listID)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            foreach (string strID in listID)
                            {
                                EntityObject_MCE_B_ASSETS_CONTRACT obj = new EntityObject_MCE_B_ASSETS_CONTRACT();
                                obj.ID = strID;

                                obj = HelperObject_MCE_B_ASSETS_CONTRACT.Get(obj);

                                if (obj != null)
                                {
                                    if (obj.STATE == 3 || obj.STATE == 4)
                                    {
                                        throw new Exception("已经审核的数据不能再审核.");
                                    }

                                    obj.STATE         = 3;
                                    obj.AUDIT_TIME    = DateTime.Now;
                                    obj.AUDIT_USER_ID = Ipedf.Web.BizLogic.SystemLogic.Proxy.CurrentUser.ID;
                                    HelperObject_MCE_B_ASSETS_CONTRACT.Update(obj, transaction);



                                    DisplayObject_MCE_B_ASSETS_CONTRACT_D[] list_D = BizLogicObject_MCE_B_ASSETS_CONTRACT_D.Proxy.Query(new CauseObject_MCE_B_ASSETS_CONTRACT_D()
                                    {
                                        BASE_ID = obj.ID
                                    });
                                    if (list_D != null && list_D.Length > 0)
                                    {
                                        foreach (DisplayObject_MCE_B_ASSETS_CONTRACT_D item_D in list_D)
                                        {
                                            EntityObject_MCE_B_ASSETS objMCE_B_ASSETS = new EntityObject_MCE_B_ASSETS();
                                            objMCE_B_ASSETS.ID = item_D.ASSET_ID;

                                            objMCE_B_ASSETS = HelperObject_MCE_B_ASSETS.Get(objMCE_B_ASSETS);

                                            if (obj != null)
                                            {
                                                objMCE_B_ASSETS.CONTRACT_CODE = obj.CODE;

                                                HelperObject_MCE_B_ASSETS.Update(objMCE_B_ASSETS, 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_CONTRACT> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_CONTRACT>(ServiceUri))
                {
                    return(smgr.Service.Audit_Ext2(listID));
                }
            }
        }
示例#7
0
        public BizLogicMsg Save_Ext(JsonMceAssets jsonMceAssets)
        {
            if (LocalMode)
            {
                BizLogicMsg msg = new BizLogicMsg();
                using (IDbConnection connection = IDALProvider.IDAL.PopConnection())
                {
                    using (IDbTransaction transaction = connection.BeginTransaction())
                    {
                        try
                        {
                            EntityObject_MCE_B_ASSETS obj = new EntityObject_MCE_B_ASSETS();

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

                                obj = HelperObject_MCE_B_ASSETS.Get(obj);

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

                            obj.ASSETS_NAME = jsonMceAssets.assets_name;
                            //   obj.ASSETS_CODE = jsonMceAssets.assets_code;
                            obj.SEQ_NUMBER      = jsonMceAssets.seq_number;
                            obj.MACHINE_TYPE_ID = jsonMceAssets.machine_type_id;
                            if (!string.IsNullOrEmpty(jsonMceAssets.purchase_date))
                            {
                                obj.PURCHASE_DATE = DateTime.Parse(jsonMceAssets.purchase_date);
                            }

                            obj.EN_NAME      = jsonMceAssets.en_name;
                            obj.CARD_CODE    = jsonMceAssets.card_code;
                            obj.CARD_TYPE_ID = jsonMceAssets.card_type_id;

                            obj.SPEC         = jsonMceAssets.spec;
                            obj.UNIT_ID      = jsonMceAssets.unit_id;
                            obj.ASSETS_STATE = jsonMceAssets.assets_state;

                            /*
                             * if (!string.IsNullOrEmpty(jsonMceAssets.enable_date))
                             * {
                             *  obj.ENABLE_DATE = DateTime.Parse( jsonMceAssets.enable_date);
                             * }
                             */

                            if (!string.IsNullOrEmpty(jsonMceAssets.service_life))
                            {
                                obj.SERVICE_LIFE = decimal.Parse(jsonMceAssets.service_life);
                            }

                            obj.DEPR_TYPE_ID = jsonMceAssets.depr_type_id;
                            if (!string.IsNullOrEmpty(jsonMceAssets.depr_year_amount))
                            {
                                obj.DEPR_YEAR_AMOUNT = decimal.Parse(jsonMceAssets.depr_year_amount);
                            }

                            obj.IS_IN_ACCOUNT = jsonMceAssets.is_in_account;

                            /*
                             * if (!string.IsNullOrEmpty(jsonMceAssets.in_account_date))
                             * {
                             *  obj.IN_ACCOUNT_DATE =DateTime.Parse( jsonMceAssets.in_account_date);
                             * }
                             *
                             * if (!string.IsNullOrEmpty(jsonMceAssets.out_account_date))
                             * {
                             *  obj.OUT_ACCOUNT_DATE = DateTime.Parse( jsonMceAssets.out_account_date);
                             * }
                             */

                            obj.STORE_ADDRESS = jsonMceAssets.store_address;
                            if (!string.IsNullOrEmpty(jsonMceAssets.maintain_period))
                            {
                                obj.MAINTAIN_PERIOD = decimal.Parse(jsonMceAssets.maintain_period);
                            }

                            obj.IS_ASSETS          = jsonMceAssets.is_assets;
                            obj.IS_DEPR            = jsonMceAssets.is_depr;
                            obj.IS_LARGE_ME        = jsonMceAssets.is_large_me;
                            obj.IS_AFFIX           = jsonMceAssets.is_affix;
                            obj.IS_METERING        = jsonMceAssets.is_metering;
                            obj.IS_SELF_RESTRAINT  = jsonMceAssets.is_self_restraint;
                            obj.OWNERSHIP_TYPE_ID  = jsonMceAssets.ownership_type_id;
                            obj.SUBJECTION_DEPT_ID = jsonMceAssets.subjection_dept_id;
                            //    obj.CUSTODY_DEPT_ID = jsonMceAssets.custody_dept_id;
                            //   obj.CUSTODY_USER_ID = jsonMceAssets.custody_user_id;
                            obj.CUSTODY_LEVEL_ID = jsonMceAssets.custody_level_id;
                            //  obj.USING_DEPT_ID = jsonMceAssets.using_dept_id;
                            // obj.USING_USER_ID = jsonMceAssets.using_user_id;

                            obj.BIZ_TYPE_ID = jsonMceAssets.biz_type_id;
                            obj.OPERATING_MACHINE_TYPE_ID = jsonMceAssets.operating_machine_type_id;
                            obj.MACHINE_MANAGE_TYPE_ID    = jsonMceAssets.machine_manage_type_id;
                            obj.SPELL_CODE         = jsonMceAssets.spell_code;
                            obj.FIVE_STROKE_CODE   = jsonMceAssets.five_stroke_code;
                            obj.INTERNATIONAL_CODE = jsonMceAssets.international_code;
                            obj.CUSTOM_CODE        = jsonMceAssets.custom_code;
                            obj.CALL_CODE          = jsonMceAssets.call_code;
                            // obj.FILE_CODE = jsonMceAssets.file_code;
                            // obj.CONTRACT_CODE = jsonMceAssets.contract_code;
                            obj.LICENCE_CODE     = jsonMceAssets.licence_code;
                            obj.MAINTAIN_CONTACT = jsonMceAssets.maintain_contact;

                            /*
                             * if (!string.IsNullOrEmpty(jsonMceAssets.original_value))
                             * {
                             *  obj.ORIGINAL_VALUE =decimal.Parse( jsonMceAssets.original_value);
                             * }
                             *
                             * if (!string.IsNullOrEmpty(jsonMceAssets.net_value))
                             * {
                             *  obj.NET_VALUE = decimal.Parse(jsonMceAssets.net_value);
                             * }
                             */
                            if (!string.IsNullOrEmpty(jsonMceAssets.net_amount))
                            {
                                obj.NET_AMOUNT = decimal.Parse(jsonMceAssets.net_amount);
                            }


                            if (!string.IsNullOrEmpty(jsonMceAssets.rudimental_value_ratio))
                            {
                                obj.RUDIMENTAL_VALUE_RATIO = decimal.Parse(jsonMceAssets.rudimental_value_ratio);
                            }

                            if (!string.IsNullOrEmpty(jsonMceAssets.predict_net_rudimental_value))
                            {
                                obj.PREDICT_NET_RUDIMENTAL_VALUE = decimal.Parse(jsonMceAssets.predict_net_rudimental_value);
                            }

                            if (!string.IsNullOrEmpty(jsonMceAssets.add_value))
                            {
                                obj.ADD_VALUE = decimal.Parse(jsonMceAssets.add_value);
                            }

                            obj.ACQUIRE_OWNERSHIP_TYPE_ID = jsonMceAssets.acquire_ownership_type_id;
                            obj.ACQUIRE_USE_TYPE_ID       = jsonMceAssets.acquire_use_type_id;
                            obj.VALUE_TYPE_ID             = jsonMceAssets.value_type_id;
                            obj.FINANCE_TYPE_ID           = jsonMceAssets.finance_type_id;
                            obj.REF_DEPT_ID = jsonMceAssets.ref_dept_id;

                            if (!string.IsNullOrEmpty(jsonMceAssets.ref_price))
                            {
                                obj.REF_PRICE = decimal.Parse(jsonMceAssets.ref_price);
                            }

                            obj.ECONOMIC_USE_TYPE_ID   = jsonMceAssets.economic_use_type_id;
                            obj.PURCHASE_TYPE_ID       = jsonMceAssets.purchase_type_id;
                            obj.CAPITAL_SOURCE_TYPE_ID = jsonMceAssets.capital_source_type_id;
                            if (!string.IsNullOrEmpty(jsonMceAssets.prd_date))
                            {
                                obj.PRD_DATE = DateTime.Parse(jsonMceAssets.prd_date);
                            }
                            if (!string.IsNullOrEmpty(jsonMceAssets.maintenance_period_date))
                            {
                                obj.MAINTENANCE_PERIOD_DATE = DateTime.Parse(jsonMceAssets.maintenance_period_date);
                            }
                            obj.VEHICLE_CODE        = jsonMceAssets.vehicle_code;
                            obj.VEHICLE_USE_TYPE_ID = jsonMceAssets.vehicle_use_type_id;
                            obj.ENERGY_TYPE_ID      = jsonMceAssets.energy_type_id;
                            obj.BRAND_NAME          = jsonMceAssets.brand_name;
                            obj.PRD_ID            = jsonMceAssets.prd_id;
                            obj.PRD_CODE          = jsonMceAssets.prd_code;
                            obj.PROVIDER_ID       = jsonMceAssets.provider_id;
                            obj.PRD_PLACE_TYPE_ID = jsonMceAssets.prd_place_type_id;
                            obj.NATIONALITY_ID    = jsonMceAssets.nationality_id;
                            obj.PICTURE           = jsonMceAssets.picture;

                            if (string.IsNullOrEmpty(jsonMceAssets.id))
                            {
                                obj.STATE       = 1;
                                obj.ASSETS_CODE = GectAssetsCode();
                                int amount = HelperObject_MCE_B_ASSETS.Save(obj, transaction);
                            }
                            else
                            {
                                obj.ID = jsonMceAssets.id;
                                int amount = HelperObject_MCE_B_ASSETS.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> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS>(ServiceUri))
                {
                    return(smgr.Service.Save_Ext(jsonMceAssets));
                }
            }
        }
示例#8
0
        public BizLogicMsg Audit_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 obj = new EntityObject_MCE_B_ASSETS();
                                    obj.ID = strID;

                                    obj = HelperObject_MCE_B_ASSETS.Get(obj);

                                    if (obj != null)
                                    {
                                        if (obj.STATE == 3 || obj.STATE == 4)
                                        {
                                            throw new Exception("已经审核的资产卡片不能再审核.");
                                        }

                                        obj.STATE         = 3;
                                        obj.AUDIT_TIME    = DateTime.Now;
                                        obj.AUDIT_USER_ID = Ipedf.Web.BizLogic.SystemLogic.Proxy.CurrentUser.ID;
                                        HelperObject_MCE_B_ASSETS.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> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS>(ServiceUri))
                {
                    return(smgr.Service.Audit_Ext(listID));
                }
            }
        }