综合实训报告测试版(11)
时间:2025-02-24
时间:2025-02-24
s TIME,count(*) as COUNT from PHOTO_PHOTOS group by
convert(varchar(4),datepart(yy,SCREENDATE)),convert(varchar(4),datepart(mm,SCREENDATE)) order by TIME desc";
DataSet ds = DataAccess.ExecuteToDataSet(PhotoStaticStr); return ds; }
public static DataSet getAllAlbums() {
string PhotoStaticStr = "select albumname from PHOTO_ALBUMS order by BUILDDATE desc"; DataSet ds = DataAccess.ExecuteToDataSet(PhotoStaticStr); return ds; }
public static bool deletePhoto(string photoId) {
string deleteStr = "delete from PHOTO_PHOTOS where PHOTOID=" + photoId; TransHelper trans = new TransHelper(); trans.AddCommand(deleteStr, null, null); bool result = trans.Execute(); return result; }
private static String SQL_PHOTO_BY_PHOTOID = @"select distinct PHOTONAME, DESCRIPTION from PHOTO_PHOTOS where PHOTOID=@PHOTOID ";
public static Dictionary<String, String> getphoto(string photoId) {
return DataAccess.ExecuteToSet(SQL_PHOTO_BY_PHOTOID, "PHOTOID", photoId); }
private static string updatephoto = "update PHOTO_PHOTOS set PHOTONAME=@PHOTONAME,DESCRIPTION=@DESCRIPTION where PHOTOID=@PHOTOID"; public static bool updatePhoto(Dictionary<string, string> PhotoInfo) {
bool result = DataAccess.ExecuteNonQuery(updatephoto, PhotoInfo); return result; }
public static string GetAlbumid(string albumname) {
String SQL_ALBUMID_BY_ALBUMNAME = "select ALBUMID from PHOTO_ALBUMS where ALBUMNAME='" + albumname + "'";
object albumid = DataAccess.ExecuteScalar(SQL_ALBUMID_BY_ALBUMNAME);
if (albumid == null) {
return ((string)albumid); }
上一篇:如何选择西瓜良种