예제 #1
0
        public void IncarcarePoze(string descriere, int numarPoze, string locatieContinut)
        {
            //apeleaza infrastructura pentru upload
            var publisher = new OneDrivePublisher();
            var uri       = publisher.PublishToOneDrive(locatieContinut);

            //actualizeaza modelul
            var repository = new Repositories.Anunt.AnuntRepository();
            var anunt      = repository.GasesteAnuntulDupaDescriere(descriere);

            anunt.IncarcarePoze(numarPoze, uri);
        }
예제 #2
0
        public Uri PublicareAnuntPeWebSite(string numeAnunt)
        {
            var repository = new Repositories.Anunt.AnuntRepository();
            var anunt      = repository.GasesteAnuntulDupaDescriere(numeAnunt);

            //genereaza continut raport
            var continutRaport = new List <List <string> >();

            foreach (var locuinta in anunt._anunturi)
            {
                var line = new List <string>();
                line.Add(anunt.ToString());
                if (anunt.NumarTelefon != null)
                {
                    line.Add(anunt.NumarTelefon.ToString());
                }
                else
                {
                    line.Add("");
                }

                if (anunt.AdresaEmail != null)
                {
                    line.Add(anunt.AdresaEmail.ToString());
                }
                else
                {
                    line.Add("");
                }

                continutRaport.Add(line);
            }

            //genereaza PDF
            var pdf     = new GeneratorRapoartePdf();
            var locatie = pdf.GenerareRaportTabelar(continutRaport);

            //[publica pe OneDrive
            var publisher = new OneDrivePublisher();

            return(publisher.PublishToOneDrive(locatie));
        }