/// <summary> /// /// </summary> /// <param name="info"></param> /// <returns></returns> public bool ModifyPost(PostInfo info) { if (info == null) return false; else return _dao.ModifyPost(info); }
/// <summary> /// /// </summary> /// <param name="info"></param> /// <returns></returns> public bool CreatePost(PostInfo info) { if (info == null) return false; else return _dao.CreatePost(info); }
/// <summary> /// /// </summary> /// <param name="info"></param> /// <returns></returns> public bool CreatePost(PostInfo info) { StringBuilder Sql = new StringBuilder(); Sql.Append(" Insert Into postinfo "); Sql.Append(" (code, Name,remark,isenable) "); Sql.Append(" Values "); Sql.Append(" ( "); Sql.Append(" '" + info.Code + "', "); Sql.Append(" '" + info.Name + "' , "); Sql.Append(" '" + info.Remark + "' , "); Sql.Append(" '" + info.IsEnable + "' "); Sql.Append(" ) "); return(DataBaseManage.ExecuteSql(Sql.ToString()) > 0); }
/// <summary> /// /// </summary> /// <param name="info"></param> /// <returns></returns> public bool ModifyPost(PostInfo info) { string Sql = string.Format("Update postinfo Set Name = '{1}',remark='{2}', isenable = '{3}' Where code = '{0}'", info.Code, info.Name, info.Remark, info.IsEnable); return(DataBaseManage.ExecuteSql(Sql) > 0); }