// ------------------------------------------------------- // 保存 删除 // ------------------------------------------------------- #region 函数:Save(TaskHistoryItemInfo param) /// <summary>保存记录</summary> /// <param name="param">实例<see cref="TaskHistoryItemInfo"/>详细信息</param> /// <returns>实例<see cref="TaskHistoryItemInfo"/>详细信息</returns> public TaskHistoryItemInfo Save(TaskHistoryItemInfo param) { if (string.IsNullOrEmpty(param.Id)) { throw new Exception("实例标识不能为空。"); } // 处理XSS特殊字符 param = StringHelper.ToSafeXSS <TaskHistoryItemInfo>(param); return(this.provider.Save(param)); }
// ------------------------------------------------------- // 保存 添加 修改 删除 // ------------------------------------------------------- #region 函数:Save(TaskHistoryItemInfo param) /// <summary>保存记录</summary> /// <param name="param">实例详细信息</param> /// <returns></returns> public TaskHistoryItemInfo Save(TaskHistoryItemInfo param) { if (!this.IsExist(param.Id, param.ReceiverId)) { this.Insert(param); } else { this.Update(param); } return(param); }
/// <summary>读取任务信息</summary> /// <param name="doc">Xml 文档对象</param> private string Read(XmlDocument doc) { StringBuilder outString = new StringBuilder(); string taskId = XmlHelper.Fetch("taskId", doc); string receiverId = XmlHelper.Fetch("receiverId", doc); TaskHistoryItemInfo param = service.FindOne(taskId, receiverId); if (param != null) { // ------------------------------------------------------- // 设置跳转的页面 // ------------------------------------------------------- string url = param.Content; outString.AppendFormat("<span style=\"font-size:12px;padding:10px;\" ><a href=\"{0}\">正在跳转到任务相关页面,请稍候...</a></span>", url); outString.AppendFormat("<script type=\"text/javascript\" >location.href='{0}';</script>", url); } return(outString.ToString()); }
/// <summary>修改记录</summary> /// <param name="param">实例的详细信息</param> public void Update(TaskHistoryItemInfo param) { this.ibatisMapper.Update(StringHelper.ToProcedurePrefix(string.Format("{0}_Update", this.tableName)), param); }
/// <summary>添加记录</summary> /// <param name="param">实例的详细信息</param> public void Insert(TaskHistoryItemInfo param) { this.ibatisMapper.Insert(StringHelper.ToProcedurePrefix(string.Format("{0}_Insert", this.tableName)), param); }