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))); }
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; }
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); }
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); }
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(); }
public void InitializeBusinessData(DataRow dr) { _UserId = (Guid)dr["UserId"]; _Image = (byte[])dr["Image"]; Photo.ByteArrayToFile(_Image, Path.Combine(_fullPathfileName, string.Format("{0}.jpg", Id))); }