示例#1
0
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  ExtensionMethod
        /// <summary>
        /// 首先判断是否存在该数据,如果存在则更新,不存在则插入
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string updatedata(Maticsoft.Model.member model)
        {
            DataSet ds = GetList("openid = '" + model.openid.Trim() + "'");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                model.id = Convert.ToInt16(ds.Tables[0].Rows[0]["id"].ToString());
                if (Update(model))
                {
                    return("更新成功");
                }
                else
                {
                    return("更新失败");
                }
            }
            else
            {
                if (Add(model) > 0)
                {
                    return("插入成功");
                }
                else
                {
                    return("插入失败");
                };
            }
        }
示例#2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.member model)
 {
     return(dal.Update(model));
 }
示例#3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.member model)
 {
     return(dal.Add(model));
 }