// ------------------------------------------------------- // 查询 // ------------------------------------------------------- #region 函数:FindOne(string id) /// <summary>查询某条记录</summary> /// <param name="id">标识</param> /// <returns>返回实例<see cref="ApplicationFeatureInfo"/>的详细信息</returns> public ApplicationFeatureInfo FindOne(string id) { Dictionary <string, object> args = new Dictionary <string, object>(); args.Add("Id", StringHelper.ToSafeSQL(id)); ApplicationFeatureInfo param = ibatisMapper.QueryForObject <ApplicationFeatureInfo>(StringHelper.ToProcedurePrefix(string.Format("{0}_FindOne", tableName)), args); return(param); }
// ------------------------------------------------------- // 添加 删除 修改 // ------------------------------------------------------- #region 函数:Save(ApplicationFeatureInfo param) /// <summary>保存记录</summary> /// <param name="param">实例<see cref="ApplicationFeatureInfo"/>详细信息</param> /// <returns>实例<see cref="ApplicationFeatureInfo"/>详细信息</returns> public ApplicationFeatureInfo Save(ApplicationFeatureInfo param) { if (!IsExist(param.Id)) { Insert(param); } else { Update(param); } 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); ApplicationFeatureInfo param = this.service.FindOne(id); outString.Append("{\"data\":" + AjaxUtil.Parse <ApplicationFeatureInfo>(param) + ","); outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + "}"); return(outString.ToString()); }
// ------------------------------------------------------- // 保存 删除 // ------------------------------------------------------- #region 函数:Save(XmlDocument doc) /// <summary>保存记录</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string Save(XmlDocument doc) { ApplicationFeatureInfo param = new ApplicationFeatureInfo(); string originalName = XmlHelper.Fetch("originalName", doc); param = (ApplicationFeatureInfo)AjaxUtil.Deserialize(param, doc); if (originalName != param.Name) { if (this.service.IsExistName(param.Name)) { return("{\"message\":{\"returnCode\":1,\"value\":\"已存在相同的名称。\"}}"); } } this.service.Save(param); return(MessageObject.Stringify("0", I18n.Strings["msg_save_success"])); }
/// <summary>创建新的对象</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string CreateNewObject(XmlDocument doc) { StringBuilder outString = new StringBuilder(); string applicationId = XmlHelper.Fetch("applicationId", doc); ApplicationFeatureInfo param = new ApplicationFeatureInfo(); param.Id = DigitalNumberContext.Generate("Key_Guid"); param.ApplicationId = applicationId; param.ParentId = "00000000-0000-0000-0000-000000000000"; param.Status = 1; outString.Append("{\"data\":" + AjaxUtil.Parse <ApplicationFeatureInfo>(param) + ","); outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + "}"); return(outString.ToString()); }
///<summary>同步信息</summary> ///<param name="param">应用功能信息</param> public void SyncFromPackPage(ApplicationFeatureInfo param) { this.provider.SyncFromPackPage(param); this.BindAuthorizationScopeObjects(param.Id, "应用_通用_查看权限", param.AuthorizationReadScopeObjectText); }
// ------------------------------------------------------- // 保存 删除 // ------------------------------------------------------- #region 函数:Save(ApplicationFeatureInfo param) /// <summary>保存记录</summary> /// <param name="param">实例<see cref="ApplicationFeatureInfo"/>详细信息</param> /// <returns>实例<see cref="ApplicationFeatureInfo"/>详细信息</returns> public ApplicationFeatureInfo Save(ApplicationFeatureInfo param) { return(this.provider.Save(param)); }
/// <summary>修改记录</summary> /// <param name="param">实例<see cref="ApplicationFeatureInfo"/>详细信息</param> public void Update(ApplicationFeatureInfo param) { ibatisMapper.Update(StringHelper.ToProcedurePrefix(string.Format("{0}_Update", tableName)), param); }
/// <summary>添加记录</summary> /// <param name="param">实例<see cref="ApplicationFeatureInfo"/>详细信息</param> public void Insert(ApplicationFeatureInfo param) { param.Code = DigitalNumberContext.Generate("Table_Application_Feature_Key_Code"); ibatisMapper.Insert(StringHelper.ToProcedurePrefix(string.Format("{0}_Insert", tableName)), param); }
// ------------------------------------------------------- // 同步管理 // ------------------------------------------------------- #region 函数:SyncFromPackPage(ApplicationFeatureInfo param) ///<summary>同步信息</summary> ///<param name="param">应用功能信息</param> public void SyncFromPackPage(ApplicationFeatureInfo param) { ibatisMapper.Insert(StringHelper.ToProcedurePrefix(string.Format("{0}_SyncFromPackPage", tableName)), param); }