Exemplo n.º 1
0
        internal void Insert(TadImage oMap)
        {
            using (SqlConnection cn = new SqlConnection(Database.TadMapConnection))
            {
                cn.Open();

                using (SqlCommand cm = cn.CreateCommand())
                {
                    cm.CommandText = "AddTadImage";
                    cm.Parameters.AddWithValue("@MapId", oMap.mId);
                    cm.Parameters.AddWithValue("@Key", mStorageKey);
                    DoInsertUpdate(cm);
                }
            }
        }
Exemplo n.º 2
0
        internal void Update(TadImage oMap)
        {
            using (SqlConnection cn = new SqlConnection(Database.TadMapConnection))
            {
                cn.Open();

                using (SqlCommand cm = cn.CreateCommand())
                {
                    cm.CommandText = "UpdatePicture";
                    cm.Parameters.AddWithValue("@ZoomLevels", mZoomLevels);
                    cm.Parameters.AddWithValue("@TileSize", mTileSize);
                    DoInsertUpdate(cm);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a new image based on a stream and storage key.
        /// </summary>
        /// 
        /// <param name="identity">The identity of the user doing the add.</param>
        /// <param name="oStream">The stream containing the content of the master image.</param>
        /// <param name="strKey">
        /// The storage key to be used for storeing the master image and to be used as the base when forming
        /// derived images.
        /// </param>
        public static TadImage NewTadImage(Stream oStream, string strStorageKey)
        {
            TadImage newImage = new TadImage();

            newImage.mId = Guid.NewGuid();
            newImage.mStorageKey = strStorageKey;
            newImage.UploadBaseImages(oStream);

            return newImage;
        }