public EntityObject_MCE_B_ASSETS_CAPITAL_ALLOT Load(IDbTransaction transaction, string id, out EntityObject_COM_TYPE capital_source_type_id, out EntityObject_MCE_B_ASSETS assets_id) { if (LocalMode) { EntityObject_MCE_B_ASSETS_CAPITAL_ALLOT obj = new EntityObject_MCE_B_ASSETS_CAPITAL_ALLOT(); //平台自动生成代码 capital_source_type_id = new EntityObject_COM_TYPE(); assets_id = new EntityObject_MCE_B_ASSETS(); obj.ID = id; obj = HelperObject_MCE_B_ASSETS_CAPITAL_ALLOT.Get(obj, transaction); if (!string.IsNullOrEmpty(obj.CAPITAL_SOURCE_TYPE_ID)) { capital_source_type_id.ID = obj.CAPITAL_SOURCE_TYPE_ID; capital_source_type_id = HelperObject_COM_TYPE.Get(capital_source_type_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(); } }
public EntityObject_MCE_B_ASSETS_INSURANCE Load(IDbTransaction transaction, string id, out EntityObject_MCE_B_ASSETS assets_id, out EntityObject_MDM_D_DEPT insurance_unit) { if (LocalMode) { EntityObject_MCE_B_ASSETS_INSURANCE obj = new EntityObject_MCE_B_ASSETS_INSURANCE(); //平台自动生成代码 assets_id = new EntityObject_MCE_B_ASSETS(); insurance_unit = new EntityObject_MDM_D_DEPT(); obj.ID = id; obj = HelperObject_MCE_B_ASSETS_INSURANCE.Get(obj, 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.INSURANCE_UNIT)) { insurance_unit.ID = obj.INSURANCE_UNIT; insurance_unit = HelperObject_MDM_D_DEPT.Get(insurance_unit, transaction); } return(obj); } else { throw new InvalidConstraintException(); } }
public EntityObject_MCE_B_ASSETS_ROLLEQUIP Load(IDbTransaction transaction, string id, out EntityObject_MCE_B_ASSETS_ROLL roll_id, out EntityObject_MCE_B_ASSETS assets_id) { if (LocalMode) { EntityObject_MCE_B_ASSETS_ROLLEQUIP obj = new EntityObject_MCE_B_ASSETS_ROLLEQUIP(); //平台自动生成代码 roll_id = new EntityObject_MCE_B_ASSETS_ROLL(); assets_id = new EntityObject_MCE_B_ASSETS(); obj.ID = id; obj = HelperObject_MCE_B_ASSETS_ROLLEQUIP.Get(obj, transaction); if (!string.IsNullOrEmpty(obj.ROLL_ID)) { roll_id.ID = obj.ROLL_ID; roll_id = HelperObject_MCE_B_ASSETS_ROLL.Get(roll_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(); } }
public EntityObject_MCE_B_ASSETS_WRITE_OFF Load(IDbTransaction transaction, string id, out EntityObject_COM_USER identity_user_id, out EntityObject_COM_TYPE write_off_type_id, out EntityObject_COM_DEPART dept_id, out EntityObject_COM_TYPE write_off_cause_id, out EntityObject_COM_USER audit_user_id, out EntityObject_MCE_B_ASSETS assets_id, out EntityObject_COM_USER user_id) { if (LocalMode) { EntityObject_MCE_B_ASSETS_WRITE_OFF obj = new EntityObject_MCE_B_ASSETS_WRITE_OFF(); //平台自动生成代码 identity_user_id = new EntityObject_COM_USER(); write_off_type_id = new EntityObject_COM_TYPE(); dept_id = new EntityObject_COM_DEPART(); write_off_cause_id = new EntityObject_COM_TYPE(); audit_user_id = new EntityObject_COM_USER(); assets_id = new EntityObject_MCE_B_ASSETS(); user_id = new EntityObject_COM_USER(); obj.ID = id; obj = HelperObject_MCE_B_ASSETS_WRITE_OFF.Get(obj, transaction); if (!string.IsNullOrEmpty(obj.IDENTITY_USER_ID)) { identity_user_id.ID = obj.IDENTITY_USER_ID; identity_user_id = HelperObject_COM_USER.Get(identity_user_id, transaction); } if (!string.IsNullOrEmpty(obj.WRITE_OFF_TYPE_ID)) { write_off_type_id.ID = obj.WRITE_OFF_TYPE_ID; write_off_type_id = HelperObject_COM_TYPE.Get(write_off_type_id, 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.WRITE_OFF_CAUSE_ID)) { write_off_cause_id.ID = obj.WRITE_OFF_CAUSE_ID; write_off_cause_id = HelperObject_COM_TYPE.Get(write_off_cause_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.ASSETS_ID)) { assets_id.ID = obj.ASSETS_ID; assets_id = HelperObject_MCE_B_ASSETS.Get(assets_id, transaction); } if (!string.IsNullOrEmpty(obj.USER_ID)) { user_id.ID = obj.USER_ID; user_id = HelperObject_COM_USER.Get(user_id, transaction); } return(obj); } else { throw new InvalidConstraintException(); } }
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(); } }
public EntityObject_MCE_B_ASSETS_WRITE_OFF_D Load(IDbTransaction transaction, string id, out EntityObject_MCE_B_ASSETS asset_id, out EntityObject_MCE_B_ASSETS_WRITE_OFF base_id) { if (LocalMode) { EntityObject_MCE_B_ASSETS_WRITE_OFF_D obj = new EntityObject_MCE_B_ASSETS_WRITE_OFF_D(); //平台自动生成代码 asset_id = new EntityObject_MCE_B_ASSETS(); base_id = new EntityObject_MCE_B_ASSETS_WRITE_OFF(); obj.ID = id; obj = HelperObject_MCE_B_ASSETS_WRITE_OFF_D.Get(obj, transaction); if (!string.IsNullOrEmpty(obj.ASSET_ID)) { asset_id.ID = obj.ASSET_ID; asset_id = HelperObject_MCE_B_ASSETS.Get(asset_id, transaction); } if (!string.IsNullOrEmpty(obj.BASE_ID)) { base_id.ID = obj.BASE_ID; base_id = HelperObject_MCE_B_ASSETS_WRITE_OFF.Get(base_id, transaction); } return(obj); } else { throw new InvalidConstraintException(); } }
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 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("已经审核的资产卡片不能删除."); } HelperObject_MCE_B_ASSETS.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> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS>(ServiceUri)) { return(smgr.Service.Audit_Ext(listID)); } } }
public EntityObject_MCE_B_ASSETS_CONTRACT Load(IDbTransaction transaction, string id, out EntityObject_COM_USER input_person, out EntityObject_MCE_B_ASSETS assets_id, out EntityObject_COM_TYPE type_id, out EntityObject_MDM_D_DEPT second_party, out EntityObject_COM_DEPART first_party, out EntityObject_COM_USER archivist) { if (LocalMode) { EntityObject_MCE_B_ASSETS_CONTRACT obj = new EntityObject_MCE_B_ASSETS_CONTRACT(); //平台自动生成代码 input_person = new EntityObject_COM_USER(); assets_id = new EntityObject_MCE_B_ASSETS(); type_id = new EntityObject_COM_TYPE(); second_party = new EntityObject_MDM_D_DEPT(); first_party = new EntityObject_COM_DEPART(); archivist = new EntityObject_COM_USER(); obj.ID = id; obj = HelperObject_MCE_B_ASSETS_CONTRACT.Get(obj, transaction); if (!string.IsNullOrEmpty(obj.INPUT_PERSON)) { input_person.ID = obj.INPUT_PERSON; input_person = HelperObject_COM_USER.Get(input_person, 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.TYPE_ID)) { type_id.ID = obj.TYPE_ID; type_id = HelperObject_COM_TYPE.Get(type_id, transaction); } if (!string.IsNullOrEmpty(obj.SECOND_PARTY)) { second_party.ID = obj.SECOND_PARTY; second_party = HelperObject_MDM_D_DEPT.Get(second_party, transaction); } if (!string.IsNullOrEmpty(obj.FIRST_PARTY)) { first_party.ID = obj.FIRST_PARTY; first_party = HelperObject_COM_DEPART.Get(first_party, transaction); } if (!string.IsNullOrEmpty(obj.ARCHIVIST)) { archivist.ID = obj.ARCHIVIST; archivist = HelperObject_COM_USER.Get(archivist, transaction); } return(obj); } else { throw new InvalidConstraintException(); } }
public EntityObject_MCE_B_ASSETS_CHECK_D Load(IDbTransaction transaction, string id, out EntityObject_COM_DEPART using_dept_id, out EntityObject_COM_TYPE new_assets_state, out EntityObject_MCE_B_ASSETS assets_id, out EntityObject_COM_TYPE old_assets_state) { if (LocalMode) { EntityObject_MCE_B_ASSETS_CHECK_D obj = new EntityObject_MCE_B_ASSETS_CHECK_D(); //平台自动生成代码 using_dept_id = new EntityObject_COM_DEPART(); new_assets_state = new EntityObject_COM_TYPE(); assets_id = new EntityObject_MCE_B_ASSETS(); old_assets_state = new EntityObject_COM_TYPE(); obj.ID = id; obj = HelperObject_MCE_B_ASSETS_CHECK_D.Get(obj, 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.NEW_ASSETS_STATE)) { new_assets_state.ID = obj.NEW_ASSETS_STATE; new_assets_state = HelperObject_COM_TYPE.Get(new_assets_state, 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.OLD_ASSETS_STATE)) { old_assets_state.ID = obj.OLD_ASSETS_STATE; old_assets_state = HelperObject_COM_TYPE.Get(old_assets_state, transaction); } return(obj); } else { throw new InvalidConstraintException(); } }
public EntityObject_MCE_B_ASSETS_IMPORTATION Load(IDbTransaction transaction, string id, out EntityObject_MCE_B_ASSETS assets_id, out EntityObject_COM_TYPE currency_id, out EntityObject_COM_TYPE foreign_currency_source_id, out EntityObject_COM_TYPE country_id) { if (LocalMode) { EntityObject_MCE_B_ASSETS_IMPORTATION obj = new EntityObject_MCE_B_ASSETS_IMPORTATION(); //平台自动生成代码 assets_id = new EntityObject_MCE_B_ASSETS(); currency_id = new EntityObject_COM_TYPE(); foreign_currency_source_id = new EntityObject_COM_TYPE(); country_id = new EntityObject_COM_TYPE(); obj.ID = id; obj = HelperObject_MCE_B_ASSETS_IMPORTATION.Get(obj, 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.CURRENCY_ID)) { currency_id.ID = obj.CURRENCY_ID; currency_id = HelperObject_COM_TYPE.Get(currency_id, transaction); } if (!string.IsNullOrEmpty(obj.FOREIGN_CURRENCY_SOURCE_ID)) { foreign_currency_source_id.ID = obj.FOREIGN_CURRENCY_SOURCE_ID; foreign_currency_source_id = HelperObject_COM_TYPE.Get(foreign_currency_source_id, transaction); } if (!string.IsNullOrEmpty(obj.COUNTRY_ID)) { country_id.ID = obj.COUNTRY_ID; country_id = HelperObject_COM_TYPE.Get(country_id, transaction); } return(obj); } else { throw new InvalidConstraintException(); } }
public EntityObject_MCE_B_ASSETS_MT_EXEC_D Load(IDbTransaction transaction, string id, out EntityObject_MCE_B_ASSETS_MT_EXEC base_id, out EntityObject_MCE_B_ASSETS assets_id, out EntityObject_COM_DEPART dept_id, out EntityObject_MCE_B_ASSETS_MT_ITEM item_id) { if (LocalMode) { EntityObject_MCE_B_ASSETS_MT_EXEC_D obj = new EntityObject_MCE_B_ASSETS_MT_EXEC_D(); //平台自动生成代码 base_id = new EntityObject_MCE_B_ASSETS_MT_EXEC(); assets_id = new EntityObject_MCE_B_ASSETS(); dept_id = new EntityObject_COM_DEPART(); item_id = new EntityObject_MCE_B_ASSETS_MT_ITEM(); obj.ID = id; obj = HelperObject_MCE_B_ASSETS_MT_EXEC_D.Get(obj, transaction); if (!string.IsNullOrEmpty(obj.BASE_ID)) { base_id.ID = obj.BASE_ID; base_id = HelperObject_MCE_B_ASSETS_MT_EXEC.Get(base_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.DEPT_ID)) { dept_id.ID = obj.DEPT_ID; dept_id = HelperObject_COM_DEPART.Get(dept_id, transaction); } if (!string.IsNullOrEmpty(obj.ITEM_ID)) { item_id.ID = obj.ITEM_ID; item_id = HelperObject_MCE_B_ASSETS_MT_ITEM.Get(item_id, transaction); } return(obj); } else { throw new InvalidConstraintException(); } }
private string GectAssetsAffixCode(string assets_id) { string strAffixCode = ""; string strCode = ""; EntityObject_MCE_B_ASSETS obj = new EntityObject_MCE_B_ASSETS(); if (!string.IsNullOrEmpty(assets_id)) { obj.ID = assets_id; obj = HelperObject_MCE_B_ASSETS.Get(obj); if (obj != null) { strCode = obj.ASSETS_CODE; } } int code = 1; var cause = new CauseObject_MCE_B_ASSETS_AFFIX(); cause.SetCustomCondition(" and MCE_B_ASSETS_AFFIX.CODE like '" + strCode + "%'"); var list = BizLogicObject_MCE_B_ASSETS_AFFIX.Proxy.Query(cause); if (list != null && list.Length > 0) { var s_code = list.Max(p => p.CODE); var rightCode = s_code.Replace(strCode, "").TrimStart('0'); code = int.Parse(rightCode) + 1; } strAffixCode = strCode + (code).ToString().PadLeft(3, '0'); return(strAffixCode); }
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(); } }
public EntityObject_MCE_B_ASSETS_DEPR_D Load(IDbTransaction transaction, string id, out EntityObject_MCE_B_ASSETS_DEPR base_id, out EntityObject_COM_TYPE currency_id, out EntityObject_MCE_B_ASSETS assets_id) { if (LocalMode) { EntityObject_MCE_B_ASSETS_DEPR_D obj = new EntityObject_MCE_B_ASSETS_DEPR_D(); //平台自动生成代码 base_id = new EntityObject_MCE_B_ASSETS_DEPR(); currency_id = new EntityObject_COM_TYPE(); assets_id = new EntityObject_MCE_B_ASSETS(); obj.ID = id; obj = HelperObject_MCE_B_ASSETS_DEPR_D.Get(obj, transaction); if (!string.IsNullOrEmpty(obj.BASE_ID)) { base_id.ID = obj.BASE_ID; base_id = HelperObject_MCE_B_ASSETS_DEPR.Get(base_id, 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.ASSETS_ID)) { assets_id.ID = obj.ASSETS_ID; assets_id = HelperObject_MCE_B_ASSETS.Get(assets_id, transaction); } return(obj); } else { throw new InvalidConstraintException(); } }
public EntityObject_MCE_B_ASSETS_MT_APPLY Load(IDbTransaction transaction, string id, out EntityObject_MDM_D_DEPT prd_id, out EntityObject_COM_USER apply_user_id, out EntityObject_COM_TYPE mtn_type_id, out EntityObject_COM_DEPART apply_dept_id, out EntityObject_COM_USER using_user_id, out EntityObject_COM_TYPE repair_result, out EntityObject_MCE_D_MCE_TYPE assets_type_id, out EntityObject_COM_TYPE emergency_degree, out EntityObject_COM_DEPART using_dept_id, out EntityObject_COM_TYPE fault_type, out EntityObject_MCE_B_ASSETS assets_id) { if (LocalMode) { EntityObject_MCE_B_ASSETS_MT_APPLY obj = new EntityObject_MCE_B_ASSETS_MT_APPLY(); //平台自动生成代码 prd_id = new EntityObject_MDM_D_DEPT(); apply_user_id = new EntityObject_COM_USER(); mtn_type_id = new EntityObject_COM_TYPE(); apply_dept_id = new EntityObject_COM_DEPART(); using_user_id = new EntityObject_COM_USER(); repair_result = new EntityObject_COM_TYPE(); assets_type_id = new EntityObject_MCE_D_MCE_TYPE(); emergency_degree = new EntityObject_COM_TYPE(); using_dept_id = new EntityObject_COM_DEPART(); fault_type = new EntityObject_COM_TYPE(); assets_id = new EntityObject_MCE_B_ASSETS(); obj.ID = id; obj = HelperObject_MCE_B_ASSETS_MT_APPLY.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.APPLY_USER_ID)) { apply_user_id.ID = obj.APPLY_USER_ID; apply_user_id = HelperObject_COM_USER.Get(apply_user_id, transaction); } if (!string.IsNullOrEmpty(obj.MTN_TYPE_ID)) { mtn_type_id.ID = obj.MTN_TYPE_ID; mtn_type_id = HelperObject_COM_TYPE.Get(mtn_type_id, transaction); } if (!string.IsNullOrEmpty(obj.APPLY_DEPT_ID)) { apply_dept_id.ID = obj.APPLY_DEPT_ID; apply_dept_id = HelperObject_COM_DEPART.Get(apply_dept_id, transaction); } if (!string.IsNullOrEmpty(obj.USING_USER_ID)) { using_user_id.ID = obj.USING_USER_ID; using_user_id = HelperObject_COM_USER.Get(using_user_id, transaction); } if (!string.IsNullOrEmpty(obj.REPAIR_RESULT)) { repair_result.ID = obj.REPAIR_RESULT; repair_result = HelperObject_COM_TYPE.Get(repair_result, transaction); } if (!string.IsNullOrEmpty(obj.ASSETS_TYPE_ID)) { assets_type_id.ID = obj.ASSETS_TYPE_ID; assets_type_id = HelperObject_MCE_D_MCE_TYPE.Get(assets_type_id, transaction); } if (!string.IsNullOrEmpty(obj.EMERGENCY_DEGREE)) { emergency_degree.ID = obj.EMERGENCY_DEGREE; emergency_degree = HelperObject_COM_TYPE.Get(emergency_degree, 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.FAULT_TYPE)) { fault_type.ID = obj.FAULT_TYPE; fault_type = HelperObject_COM_TYPE.Get(fault_type, 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(); } }
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)); } } }
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)); } } }
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)); } } }
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)); } } }
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)); } } }