Esempio n. 1
0
 public void InitializeBusinessData(DataRow dr)
 {
     _CompanyName = dr["CompanyName"].ToString();
     _Phone       = dr["Phone"].ToString();
     _Image       = (byte[])dr["image"];
     Photo.ByteArrayToFile(_Image, Path.Combine(_fullPathfileName, string.Format("{0}.jpg", Id)));
 }
Esempio n. 2
0
        void GetBookCover()
        {
            string filename     = Path.Combine(Server.MapPath("Images"), book.ID + book.MimeType);
            string relativepath = string.Format("Images/{0}", book.ID + book.MimeType);

            book.PhotoName = relativepath;
            Photo.ByteArrayToFile(book.Cover, filename);
            imgbookCover.ImageUrl = book.PhotoName;
        }
Esempio n. 3
0
        public void InitializeBusinessData(DataRow dr)
        {
            _CategoryID  = (Guid)dr["CategoryID"];
            _Name        = dr["Name"].ToString();
            _Description = dr["Description"].ToString();
            _Price       = (Decimal)dr["Price"];
            _Image       = (Byte[])dr["Image"];
            String filepath = System.IO.Path.Combine(_FilePath, Id.ToString() + ".jpg");

            _RelativeFileName = System.IO.Path.Combine("UploadedImages", Id.ToString() + ".jpg");
            Photo.ByteArrayToFile(_Image, filepath);
        }
Esempio n. 4
0
        private User GetMyBooks()
        {
            User     user = (User)Session["User"];
            BookList bl   = user.Books;

            foreach (Book book in bl.List)
            {
                string filename     = Path.Combine(Server.MapPath("Images"), book.ID + book.MimeType);
                string relativepath = string.Format("Images/{0}", book.ID + book.MimeType);
                book.PhotoName = relativepath;
                Photo.ByteArrayToFile(book.Cover, filename);
            }
            rptBooks.DataSource = bl.List;
            rptBooks.DataBind();
            return(user);
        }
Esempio n. 5
0
        private void GetBookType()
        {
            BookList btl = new BookList();

            btl = btl.GetByBookTypeID(new Guid(ddlGenre.SelectedValue));

            foreach (Book book in btl.List)
            {
                string filename     = Path.Combine(Server.MapPath("Images"), book.ID + book.MimeType);
                string relativepath = string.Format("Images/{0}", book.ID + book.MimeType);
                book.PhotoName = relativepath;
                Photo.ByteArrayToFile(book.Cover, filename);
            }

            rptBooks.DataSource = btl.List;
            rptBooks.DataBind();
        }
Esempio n. 6
0
 public void InitializeBusinessData(DataRow dr)
 {
     _UserId = (Guid)dr["UserId"];
     _Image  = (byte[])dr["Image"];
     Photo.ByteArrayToFile(_Image, Path.Combine(_fullPathfileName, string.Format("{0}.jpg", Id)));
 }