示例#1
0
        public string Save(XmlDocument doc)
        {
            EntityDraftInfo param = new EntityDraftInfo();

            param = (EntityDraftInfo)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="id">标识</param>
        /// <returns>返回实例<see cref="EntityDraftInfo"/>的详细信息</returns>
        public EntityDraftInfo FindOne(string id)
        {
            Dictionary <string, object> args = new Dictionary <string, object>();

            args.Add("Id", StringHelper.ToSafeSQL(id));

            EntityDraftInfo param = this.ibatisMapper.QueryForObject <EntityDraftInfo>(StringHelper.ToProcedurePrefix(string.Format("{0}_FindOne", tableName)), args);

            return(param);
        }
        // -------------------------------------------------------
        // 添加 删除 修改
        // -------------------------------------------------------

        #region 函数:Save(EntityDraftInfo param)
        /// <summary>保存记录</summary>
        /// <param name="param">实例<see cref="EntityDraftInfo"/>详细信息</param>
        /// <returns>实例<see cref="EntityDraftInfo"/>详细信息</returns>
        public EntityDraftInfo Save(EntityDraftInfo param)
        {
            if (!IsExist(param.Id))
            {
                Insert(param);
            }
            else
            {
                Update(param);
            }

            return((EntityDraftInfo)param);
        }
示例#4
0
        public string FindOne(XmlDocument doc)
        {
            StringBuilder outString = new StringBuilder();

            string id = XmlHelper.Fetch("id", doc);

            EntityDraftInfo param = this.service.FindOne(id);

            outString.Append("{\"data\":" + AjaxUtil.Parse <EntityDraftInfo>(param) + ",");

            outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + "}");

            return(outString.ToString());
        }
        // -------------------------------------------------------
        // 保存 删除
        // -------------------------------------------------------

        #region 函数:Save(EntityDraftInfo param)
        /// <summary>保存记录</summary>
        /// <param name="param">实例<see cref="EntityDraftInfo"/>详细信息</param>
        /// <returns>实例<see cref="EntityDraftInfo"/>详细信息</returns>
        public EntityDraftInfo Save(EntityDraftInfo param)
        {
            return(this.provider.Save(param));
        }
 /// <summary>修改记录</summary>
 /// <param name="param">实例<see cref="EntityDraftInfo"/>详细信息</param>
 public void Update(EntityDraftInfo param)
 {
     this.ibatisMapper.Update(StringHelper.ToProcedurePrefix(string.Format("{0}_Update", tableName)), param);
 }
 /// <summary>添加记录</summary>
 /// <param name="param">实例<see cref="EntityDraftInfo"/>详细信息</param>
 public void Insert(EntityDraftInfo param)
 {
     this.ibatisMapper.Insert(StringHelper.ToProcedurePrefix(string.Format("{0}_Insert", tableName)), param);
 }