public int DeleteByTrans2(CauseObject_V_MCE_ASSETS_ROLLEQUIP cause, IDbTransaction transaction) { if (LocalMode) { return(HelperObject_V_MCE_ASSETS_ROLLEQUIP.Delete(cause, transaction)); //平台自动生成代码 } else { throw new InvalidConstraintException(); } }
public DisplayObject_V_MCE_ASSETS_ROLLEQUIP[] Query(CauseObject_V_MCE_ASSETS_ROLLEQUIP cause, PagingParamter paging, OrderByParameter order) { if (LocalMode) { SystemLogic.Proxy.AuditQuery(cause); //平台自动生成代码 return(HelperObject_V_MCE_ASSETS_ROLLEQUIP.Query(cause, paging, order)); } else { using (ServiceManager <ServiceContract_V_MCE_ASSETS_ROLLEQUIP> smgr = new ServiceManager <ServiceContract_V_MCE_ASSETS_ROLLEQUIP>(ServiceUri)) { return(smgr.Service.Query(cause, paging, order)); } } }
public BizLogicMsg Delete(CauseObject_V_MCE_ASSETS_ROLLEQUIP cause) { if (LocalMode) { BizLogicMsg msg = new BizLogicMsg(); using (IDbConnection connection = IDALProvider.IDAL.PopConnection()) { using (IDbTransaction transaction = connection.BeginTransaction()) { try { int amount = HelperObject_V_MCE_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_V_MCE_ASSETS_ROLLEQUIP> smgr = new ServiceManager <ServiceContract_V_MCE_ASSETS_ROLLEQUIP>(ServiceUri)) { return(smgr.Service.Delete(cause)); } } }
public void ProcessRequest(HttpContext context) { //允许跨域 context.Response.AddHeader("Access-Control-Allow-Origin", "*"); JSON_MSG jsonMsg = new JSON_MSG(); try { context.Response.ContentType = "text/plain"; HttpRequest request = context.Request; if (string.IsNullOrEmpty(request["rollid"])) { throw new Exception("参数错误."); } if (string.IsNullOrEmpty(request["assetsid"])) { throw new Exception("参数错误."); } StringBuilder strCondition = new StringBuilder(); CauseObject_V_MCE_ASSETS_ROLLEQUIP p = new CauseObject_V_MCE_ASSETS_ROLLEQUIP(); p.ROLL_ID = request["rollid"]; p.SetCustomCondition(" and V_MCE_ASSETS_ROLLEQUIP.Assets_Id<>'" + request["assetsid"] + "'"); DisplayObject_V_MCE_ASSETS_ROLLEQUIP[] list = BizLogicObject_V_MCE_ASSETS_ROLLEQUIP.Proxy.Query(p); if (list != null && list.Length > 0) { for (int i = 0; i < list.Length; i++) { if (!string.IsNullOrEmpty(list[i].PICTURE)) { list[i].PICTURE = "../../upload/mce/" + list[i].PICTURE; } else { list[i].PICTURE = "../../images/icon/imgDefault.png"; } } } jsonMsg.Message = list; jsonMsg.Succeed = 1; } catch (Exception ex) { jsonMsg.Succeed = 0; jsonMsg.Message = ex.Message; } finally { IsoDateTimeConverter timeConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy'-'MM'-'dd HH':'mm" }; string strMsg = JsonConvert.SerializeObject(jsonMsg, Formatting.Indented, timeConverter); strMsg = strMsg.Replace("0001-01-01 00:00", ""); context.Response.Write(strMsg); context.Response.End(); } }