Пример #1
0
    public static void ZAddAlbum(string _Caption, bool _IsPublic)
    {
        var photosDB = new Z.PhotoDataContext();
        var a        = new Z.Album()
        {
            Caption = _Caption, IsPublic = _IsPublic
        };

        photosDB.Albums.InsertOnSubmit(a);
        photosDB.SubmitChanges();
    }
Пример #2
0
    public static void ZAddPhoto(int _AlbumID, string _Caption, byte[] _BytesOriginal)
    {
        var photosDB = new Z.PhotoDataContext();
        var p        = new Z.Photo()
        {
            AlbumID       = _AlbumID,
            Caption       = _Caption,
            BytesOriginal = _BytesOriginal,
            BytesFull     = ResizeImageFile(_BytesOriginal, 600),
            BytesPoster   = ResizeImageFile(_BytesOriginal, 198),
            BytesThumb    = ResizeImageFile(_BytesOriginal, 100)
        };

        photosDB.Photos.InsertOnSubmit(p);
        photosDB.SubmitChanges();
    }