/// <summary> /// 修改资讯信息 /// </summary> /// <returns></returns> public int UpdateInformation(JiaJiModels.Information model) { try { return(new infodal().UpdateInformation(model)); } catch (Exception ex) { return(0); } }
/// <summary> /// 添加资讯信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public int infoadd(JiaJiModels.Information model) { try { return(new infodal().infoadd(model)); } catch (Exception ex) { return(0); } }
/// <summary> /// 修改资讯信息 /// </summary> /// <returns></returns> public int UpdateInformation(JiaJiModels.Information model) { try { string sql = "Update study_abroad.information set Title = '" + model.Title + "', Content = '" + model.Content + "', InfoDate = '" + model.InfoDate + "', `Source`= '" + model.Source + "', Author = '" + model.Author + "', CountryID =" + model.CountryID + ",site =" + model.Site + ",InformationImgUrl='" + model.InformationImgUrl + "',InfoKeyWord='" + model.InfoKeyWord + "',InformationProfile='" + model.InformationProfile + "' where informationID =" + model.InformationID + " "; int he = MySqlDB.nonquery(sql, CommandType.Text, null); return(he); } catch (Exception ex) { return(0); } }
/// <summary> /// 添加资讯信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public int infoadd(JiaJiModels.Information model) { try { string sql = "INSERT INTO study_abroad.information (Title, Content, InfoDate, Source, Author, ReadCount, CountryID,Site,InformationImgUrl,InfoKeyWord,InformationProfile)VALUES ('" + model.Title + "', '" + model.Content + "', '" + model.InfoDate + "', '" + model.Source + "', '" + model.Author + "', " + model.ReadCount + ", " + model.CountryID + "," + model.Site + ",'" + model.InformationImgUrl + "','" + model.InfoKeyWord + "','" + model.InformationProfile + "')"; int he = MySqlDB.nonquery(sql, CommandType.Text, null); return(he); } catch (Exception ex) { return(0); } }