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 BizLogicMsg CommitUpdate(EntityObject_MCE_B_ASSETS_ROLLEQUIP updateBaseEntity, EntityObject_[] saveDetailEntities, EntityObject_[] updateDetailEntities, EntityObject_[] deleteDetailEntities) { if (LocalMode) { BizLogicMsg msg = new BizLogicMsg(); using (IDbConnection connection = IDALProvider.IDAL.PopConnection()) { using (IDbTransaction transaction = connection.BeginTransaction()) { try { SystemLogic.Proxy.AuditEdit(updateBaseEntity); HelperObject_MCE_B_ASSETS_ROLLEQUIP.Update(updateBaseEntity, transaction); //平台自动生成代码 foreach (EntityObject_ obj in saveDetailEntities) { obj. = updateBaseEntity.ID; SystemLogic.Proxy.AuditAdd(obj); HelperObject_.Save(obj, transaction); } foreach (EntityObject_ obj in updateDetailEntities) { SystemLogic.Proxy.AuditEdit(obj); HelperObject_.Update(obj, transaction); } foreach (EntityObject_ obj in deleteDetailEntities) { HelperObject_.Delete(obj, transaction); } PostSave(updateBaseEntity, 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_ROLLEQUIP> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_ROLLEQUIP>(ServiceUri)) { return(smgr.Service.CommitUpdate(updateBaseEntity, saveDetailEntities, updateDetailEntities, deleteDetailEntities)); } } }
public int DeleteByTrans2(CauseObject_MCE_B_ASSETS_ROLLEQUIP cause, IDbTransaction transaction) { if (LocalMode) { return(HelperObject_MCE_B_ASSETS_ROLLEQUIP.Delete(cause, transaction)); //平台自动生成代码 } else { throw new InvalidConstraintException(); } }
public int UpdateByTrans(EntityObject_MCE_B_ASSETS_ROLLEQUIP obj, IDbTransaction transaction) { if (LocalMode) { SystemLogic.Proxy.AuditEdit(obj); return(HelperObject_MCE_B_ASSETS_ROLLEQUIP.Update(obj, transaction)); //平台自动生成代码 } else { throw new InvalidConstraintException(); } }
public int SaveByTrans(EntityObject_MCE_B_ASSETS_ROLLEQUIP obj, IDbTransaction transaction) { if (LocalMode) { SystemLogic.Proxy.AuditAdd(obj); int amount = HelperObject_MCE_B_ASSETS_ROLLEQUIP.Save(obj, transaction); //平台自动生成代码 return(amount); } else { throw new InvalidConstraintException(); } }
public DisplayObject_MCE_B_ASSETS_ROLLEQUIP[] List() { if (LocalMode) { //平台自动生成代码 return(HelperObject_MCE_B_ASSETS_ROLLEQUIP.List()); } else { using (ServiceManager <ServiceContract_MCE_B_ASSETS_ROLLEQUIP> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_ROLLEQUIP>(ServiceUri)) { return(smgr.Service.List()); } } }
public EntityObject_MCE_B_ASSETS_ROLLEQUIP Get(EntityObject_MCE_B_ASSETS_ROLLEQUIP obj) { if (LocalMode) { //平台自动生成代码 return(HelperObject_MCE_B_ASSETS_ROLLEQUIP.Get(obj)); } else { using (ServiceManager <ServiceContract_MCE_B_ASSETS_ROLLEQUIP> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_ROLLEQUIP>(ServiceUri)) { return(smgr.Service.Get(obj)); } } }
public BizLogicMsg UndoAudit(EntityObject_MCE_B_ASSETS_ROLLEQUIP obj) { if (LocalMode) { BizLogicMsg msg = new BizLogicMsg(); using (IDbConnection connection = IDALProvider.IDAL.PopConnection()) { using (IDbTransaction transaction = connection.BeginTransaction()) { try { SystemLogic.Proxy.AuditUndoAudit(obj); int amount = HelperObject_MCE_B_ASSETS_ROLLEQUIP.Update(obj, transaction); //平台自动生成代码 PostUndoAudit(obj, transaction); //执行撤回操作 msg = SystemLogic.Proxy.BillUndoAudit(obj, transaction); if (!msg.Succeed) { throw new Exception(msg.Message); } 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_B_ASSETS_ROLLEQUIP> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_ROLLEQUIP>(ServiceUri)) { return(smgr.Service.UndoAudit(obj)); } } }
public BizLogicMsg BatchUpdate(EntityObject_MCE_B_ASSETS_ROLLEQUIP[] objs) { if (LocalMode) { BizLogicMsg msg = new BizLogicMsg(); using (IDbConnection connection = IDALProvider.IDAL.PopConnection()) { using (IDbTransaction transaction = connection.BeginTransaction()) { try { foreach (EntityObject_MCE_B_ASSETS_ROLLEQUIP obj in objs) { SystemLogic.Proxy.AuditEdit(obj); } int amount = 0; //平台自动生成代码 foreach (EntityObject_MCE_B_ASSETS_ROLLEQUIP obj in objs) { amount += HelperObject_MCE_B_ASSETS_ROLLEQUIP.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_ROLLEQUIP> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_ROLLEQUIP>(ServiceUri)) { return(smgr.Service.BatchUpdate(objs)); } } }
public DisplayObject_MCE_B_ASSETS_ROLLEQUIP[] Query(CauseObject_MCE_B_ASSETS_ROLLEQUIP cause, PagingParamter paging, OrderByParameter order) { if (LocalMode) { SystemLogic.Proxy.AuditQuery(cause); //平台自动生成代码 return(HelperObject_MCE_B_ASSETS_ROLLEQUIP.Query(cause, paging, order)); } else { using (ServiceManager <ServiceContract_MCE_B_ASSETS_ROLLEQUIP> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_ROLLEQUIP>(ServiceUri)) { return(smgr.Service.Query(cause, paging, order)); } } }
public BizLogicMsg CommitDelete(EntityObject_MCE_B_ASSETS_ROLLEQUIP 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_ROLLEQUIP.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_ROLLEQUIP> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_ROLLEQUIP>(ServiceUri)) { return(smgr.Service.CommitDelete(deleteBaseEntity)); } } }
public BizLogicMsg Delete(CauseObject_MCE_B_ASSETS_ROLLEQUIP cause) { if (LocalMode) { BizLogicMsg msg = new BizLogicMsg(); using (IDbConnection connection = IDALProvider.IDAL.PopConnection()) { using (IDbTransaction transaction = connection.BeginTransaction()) { try { int amount = HelperObject_MCE_B_ASSETS_ROLLEQUIP.Delete(cause, 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_ROLLEQUIP> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_ROLLEQUIP>(ServiceUri)) { return(smgr.Service.Delete(cause)); } } }
public BizLogicMsg Delete_RollEquip(string strID) { if (LocalMode) { BizLogicMsg msg = new BizLogicMsg(); using (IDbConnection connection = IDALProvider.IDAL.PopConnection()) { using (IDbTransaction transaction = connection.BeginTransaction()) { try { EntityObject_MCE_B_ASSETS_ROLLEQUIP objMCE_B_ASSETS_ROLLEQUIP = new EntityObject_MCE_B_ASSETS_ROLLEQUIP(); objMCE_B_ASSETS_ROLLEQUIP.ID = strID; objMCE_B_ASSETS_ROLLEQUIP = HelperObject_MCE_B_ASSETS_ROLLEQUIP.Get(objMCE_B_ASSETS_ROLLEQUIP); if (objMCE_B_ASSETS_ROLLEQUIP == null) { throw new Exception("获取数据出错."); } EntityObject_MCE_B_ASSETS_ROLL objRoll = new EntityObject_MCE_B_ASSETS_ROLL(); objRoll.ID = objMCE_B_ASSETS_ROLLEQUIP.ROLL_ID; objRoll = HelperObject_MCE_B_ASSETS_ROLL.Get(objRoll); if (objRoll == null) { throw new Exception("获取数据出错."); } if (objRoll.AUDIT_STATE == 3 || objRoll.AUDIT_STATE == 4) { throw new Exception("已经审核的案卷信息不能再删除关联设备."); } HelperObject_MCE_B_ASSETS_ROLLEQUIP.Delete(objMCE_B_ASSETS_ROLLEQUIP, 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.Delete_RollEquip(strID)); } } }
public BizLogicMsg Save_RollEquip(JsonMceAssetsRollEquip item) { if (LocalMode) { BizLogicMsg msg = new BizLogicMsg(); using (IDbConnection connection = IDALProvider.IDAL.PopConnection()) { using (IDbTransaction transaction = connection.BeginTransaction()) { try { EntityObject_MCE_B_ASSETS_ROLL objRoll = new EntityObject_MCE_B_ASSETS_ROLL(); objRoll.ID = item.rollid; objRoll = HelperObject_MCE_B_ASSETS_ROLL.Get(objRoll); if (objRoll == null) { throw new Exception("获取数据出错."); } if (objRoll.AUDIT_STATE == 3 || objRoll.AUDIT_STATE == 4) { throw new Exception("已经审核的案卷信息不能再添加关联设备."); } CauseObject_MCE_B_ASSETS_ROLLEQUIP pMCE_B_ASSETS_ROLLEQUIP = new CauseObject_MCE_B_ASSETS_ROLLEQUIP(); pMCE_B_ASSETS_ROLLEQUIP.ROLL_ID = item.rollid; pMCE_B_ASSETS_ROLLEQUIP.ASSETS_ID = item.assetsid; DisplayObject_MCE_B_ASSETS_ROLLEQUIP[] listMCE_B_ASSETS_ROLLEQUIP = BizLogicObject_MCE_B_ASSETS_ROLLEQUIP.Proxy.Query(pMCE_B_ASSETS_ROLLEQUIP); if (listMCE_B_ASSETS_ROLLEQUIP == null || listMCE_B_ASSETS_ROLLEQUIP.Length == 0) { EntityObject_MCE_B_ASSETS_ROLLEQUIP objEquip = new EntityObject_MCE_B_ASSETS_ROLLEQUIP(); objEquip.ASSETS_ID = item.assetsid; objEquip.ROLL_ID = item.rollid; HelperObject_MCE_B_ASSETS_ROLLEQUIP.Save(objEquip, transaction); } else { throw new Exception("该案卷信息中已经添加了此设备."); } 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.Save_RollEquip(item)); } } }
public BizLogicMsg Delete_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_ROLL obj = new EntityObject_MCE_B_ASSETS_ROLL(); obj.ID = strID; obj = HelperObject_MCE_B_ASSETS_ROLL.Get(obj); if (obj != null) { if (obj.AUDIT_STATE == 3 || obj.AUDIT_STATE == 4) { throw new Exception("已经审核的案卷信息不能删除."); } CauseObject_MCE_B_ASSETS_ROLLFILE pMCE_B_ASSETS_ROLLFILE = new CauseObject_MCE_B_ASSETS_ROLLFILE(); pMCE_B_ASSETS_ROLLFILE.BASE_ID = obj.ID; DisplayObject_MCE_B_ASSETS_ROLLFILE[] listMCE_B_ASSETS_ROLLFILE = BizLogicObject_MCE_B_ASSETS_ROLLFILE.Proxy.Query(pMCE_B_ASSETS_ROLLFILE); if (listMCE_B_ASSETS_ROLLFILE != null && listMCE_B_ASSETS_ROLLFILE.Length > 0) { foreach (DisplayObject_MCE_B_ASSETS_ROLLFILE displayObject_MCE_B_ASSETS_ROLLFILE in listMCE_B_ASSETS_ROLLFILE) { CauseObject_COM_FILE pCOM_FILE = new CauseObject_COM_FILE(); pCOM_FILE.REF_TAB_ID = displayObject_MCE_B_ASSETS_ROLLFILE.ID; pCOM_FILE.REF_TAB_NAME = "MCE_B_ASSETS_ROLLFILE"; DisplayObject_COM_FILE[] listCOM_FILE = BizLogicObject_COM_FILE.Proxy.Query(pCOM_FILE); if (listCOM_FILE != null && listCOM_FILE.Length > 0) { foreach (DisplayObject_COM_FILE item in listCOM_FILE) { if (!string.IsNullOrEmpty(item.SERVER_NAME)) { string strFileURL = System.Web.HttpContext.Current.Server.MapPath("~/upload/mce/" + item.SERVER_NAME);//路径 if (File.Exists(strFileURL)) { File.Delete(strFileURL); } } } } HelperObject_COM_FILE.Delete(pCOM_FILE, transaction); HelperObject_MCE_B_ASSETS_ROLLFILE.Delete(displayObject_MCE_B_ASSETS_ROLLFILE, transaction); } } CauseObject_MCE_B_ASSETS_ROLLEQUIP pMCE_B_ASSETS_ROLLEQUIP = new CauseObject_MCE_B_ASSETS_ROLLEQUIP(); pMCE_B_ASSETS_ROLLEQUIP.ROLL_ID = obj.ID; HelperObject_MCE_B_ASSETS_ROLLEQUIP.Delete(pMCE_B_ASSETS_ROLLEQUIP, transaction); HelperObject_MCE_B_ASSETS_ROLL.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_ROLL> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_ROLL>(ServiceUri)) { return(smgr.Service.Delete_Ext(strID)); } } }
public BizLogicMsg Save_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(); if (!string.IsNullOrEmpty(item.id)) { obj.ID = item.id; obj = HelperObject_MCE_B_ASSETS_ROLL.Get(obj); if (obj == null) { throw new Exception("获取数据出错."); } } // obj.ASSETS_ID = item.assets_id; // obj.CODE = item.code; obj.NAME = item.name; obj.SAVELIMIT = item.savelimit; obj.CREATE_USER_ID = item.create_user_id; if (!string.IsNullOrEmpty(item.create_time)) { obj.CREATE_TIME = DateTime.Parse(item.create_time); } obj.PLAN_TYPE = item.plan_type; obj.ROLL_TYPE = item.roll_type; obj.ROLL_PROPERTY = item.roll_property; obj.COMMENTS = item.comments; if (string.IsNullOrEmpty(item.id)) { obj.CODE = GetRollCode(); obj.AUDIT_STATE = 1; obj.CREATE_USER_ID = Ipedf.Web.BizLogic.SystemLogic.Proxy.CurrentUser.ID; HelperObject_MCE_B_ASSETS_ROLL.Save(obj, transaction); EntityObject_MCE_B_ASSETS_ROLLEQUIP objEquip = new EntityObject_MCE_B_ASSETS_ROLLEQUIP(); objEquip.ASSETS_ID = item.assets_id; objEquip.ROLL_ID = obj.ID; HelperObject_MCE_B_ASSETS_ROLLEQUIP.Save(objEquip, transaction); } else { obj.ID = item.id; HelperObject_MCE_B_ASSETS_ROLL.Update(obj, transaction); CauseObject_MCE_B_ASSETS_ROLLEQUIP pMCE_B_ASSETS_ROLLEQUIP = new CauseObject_MCE_B_ASSETS_ROLLEQUIP(); pMCE_B_ASSETS_ROLLEQUIP.ROLL_ID = obj.ID; pMCE_B_ASSETS_ROLLEQUIP.ASSETS_ID = item.assets_id; DisplayObject_MCE_B_ASSETS_ROLLEQUIP[] listMCE_B_ASSETS_ROLLEQUIP = BizLogicObject_MCE_B_ASSETS_ROLLEQUIP.Proxy.Query(pMCE_B_ASSETS_ROLLEQUIP); if (listMCE_B_ASSETS_ROLLEQUIP == null || listMCE_B_ASSETS_ROLLEQUIP.Length == 0) { EntityObject_MCE_B_ASSETS_ROLLEQUIP objEquip = new EntityObject_MCE_B_ASSETS_ROLLEQUIP(); objEquip.ASSETS_ID = item.assets_id; objEquip.ROLL_ID = obj.ID; HelperObject_MCE_B_ASSETS_ROLLEQUIP.Save(objEquip, 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_ROLL> smgr = new ServiceManager <ServiceContract_MCE_B_ASSETS_ROLL>(ServiceUri)) { return(smgr.Service.Save_Ext(item)); } } }