public void StergeLogoSediu(IDbTransaction pTranzactie) { BDocumenteInline docProfil = BDocumenteInline.GetLogoSediuMobileAPP(this.Id, pTranzactie); if (docProfil != null) { docProfil.Delete(pTranzactie); } }
public Image GetLogoSediu(IDbTransaction pTranzactie) { BDocumenteInline logoSediu = BDocumenteInline.GetLogoSediuMobileAPP(this.Id, pTranzactie); if (logoSediu == null || logoSediu.Imagine == null) { return(null); } else { using (var ms = new MemoryStream(logoSediu.Imagine)) { return(Image.FromStream(ms)); } } }
public void UpdateLogoSediu(FileInfo imagine, IDbTransaction pTranzactie) { if (imagine == null) { return; } BDocumenteInline docProfil = BDocumenteInline.GetLogoSediuMobileAPP(this.Id, pTranzactie); using (var stream = new FileStream(imagine.FullName, FileMode.Open, FileAccess.Read)) { using (var reader = new BinaryReader(stream)) { if (docProfil != null) { docProfil.UpdateImagine(reader.ReadBytes((int)stream.Length), null); } else { BDocumenteInline.Add(BLocatii.TipObiectClasa, this.Id, BDocumenteInline.EnumTipDocumentInline.LogoSediu, reader.ReadBytes((int)stream.Length), string.Empty, pTranzactie); } } } }