// ------------------------------------------------------- // 保存 删除 // ------------------------------------------------------- #region 函数:Save(XmlDocument doc) /// <summary>保存记录</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string Save(XmlDocument doc) { ApplicationEventInfo param = new ApplicationEventInfo(); param = (ApplicationEventInfo)AjaxUtil.Deserialize(param, doc); this.service.Save(param); return(MessageObject.Stringify("0", I18n.Strings["msg_save_success"])); }
// ------------------------------------------------------- // 查询 // ------------------------------------------------------- #region 函数:FindOne(string id) /// <summary>查询某条记录</summary> /// <param name="param">ApplicationEventInfo Id号</param> /// <returns>返回一个 实例<see cref="ApplicationEventInfo"/>详细信息</returns> public ApplicationEventInfo FindOne(string id) { Dictionary <string, object> args = new Dictionary <string, object>(); args.Add("Id", id); ApplicationEventInfo param = this.ibatisMapper.QueryForObject <ApplicationEventInfo>(StringHelper.ToProcedurePrefix(string.Format("{0}_FindOne", tableName)), args); return(param); }
// ------------------------------------------------------- // 查询 // ------------------------------------------------------- #region 函数:FindOne(XmlDocument doc) /// <summary>获取详细信息</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string FindOne(XmlDocument doc) { StringBuilder outString = new StringBuilder(); string id = XmlHelper.Fetch("id", doc); ApplicationEventInfo param = this.service.FindOne(id); outString.Append("{\"data\":" + AjaxUtil.Parse <ApplicationEventInfo>(param) + ","); outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + "}"); return(outString.ToString()); }
/// <summary>重启插件</summary> /// <returns>返回信息. =0代表重启成功, >0代表重启失败.</returns> public override int Restart() { ApplicationInfo application = AppsContext.Instance.ApplicationService[EntitiesConfiguration.ApplicationName]; ApplicationEventInfo applicationEvent = new ApplicationEventInfo(); applicationEvent.Id = DigitalNumberContext.Generate("Key_Guid"); applicationEvent.ApplicationId = application.Id; applicationEvent.Tags = "信息"; applicationEvent.Description = string.Format("【{0}】应用执行{1}事件。", application.ApplicationDisplayName, (this.restartCount == 0 ? "初始化" : "第" + this.restartCount + "次重启")); applicationEvent.Start(); try { // 重新加载信息 Reload(); // 自增重启次数计数器 this.restartCount++; } catch (Exception ex) { logger.Error(ex.ToString()); applicationEvent.Tags = "错误"; applicationEvent.Description = string.Format("【错误】{0}错误信息:{1}", applicationEvent.Description, ex.Message); throw ex; } finally { applicationEvent.Finish(); AppsContext.Instance.ApplicationEventService.Save(applicationEvent); } return(0); }
// ------------------------------------------------------- // 添加 删除 修改 // ------------------------------------------------------- #region 函数:Save(ApplicationInfo param) /// <summary>保存记录</summary> /// <param name="param"> 实例<see cref="ApplicationEventInfo"/>详细信息</param> /// <returns>ApplicationEventInfo 实例详细信息</returns> public ApplicationEventInfo Save(ApplicationEventInfo param) { return(provider.Save(param)); }
// ------------------------------------------------------- // 保存 添加 修改 删除 // ------------------------------------------------------- #region 函数:Save(ApplicationEventInfo param) /// <summary>保存记录</summary> /// <param name="param">实例<see cref="ApplicationEventInfo"/>详细信息</param> /// <returns>实例<see cref="ApplicationEventInfo"/>详细信息</returns> public ApplicationEventInfo Save(ApplicationEventInfo param) { this.ibatisMapper.Insert(StringHelper.ToProcedurePrefix(string.Format("{0}_Save", tableName)), param); return(this.FindOne(param.Id)); }