예제 #1
0
        internal static void InserimentoProdotto()
        {
            var Layer = new ApplicationServiceLayer();
            IList <Prodotto> prodotti = Layer.FetchProdotti();

            Console.WriteLine("Creazione nuovo prodotto");
            Console.WriteLine(" => nome : ");
            var nome = Console.ReadLine();

            Console.WriteLine(" => categoria : ");
            var categoryString = Console.ReadLine();
            int m = ApplicationStorage.Categorie.Count;

            for (int i = 0; i < m; i += 1)
            {
                string    category        = ApplicationStorage.Categorie[i].Nome;
                Categoria categoriaClasse = new Categoria();
                if (category == categoryString)
                {
                    categoriaClasse = ApplicationStorage.Categorie[i];
                }
            }
            ;

            DateTime dataProduzione = DateTime.Now;

            //Console.WriteLine("Data Produzione: ");
            //var dataProduzioneString = Console.ReadLine();
            //DateTime dataProduzione = Convert.ToDateTime(dataProduzioneString);
            Console.WriteLine("Inserisci descrizione: ");
            string descrizione = Console.ReadLine();

            Console.WriteLine("Inserisci brand: ");
            string brand = Console.ReadLine();

            Prodotto nuovoProdotto = new Prodotto()
            {
                Id   = GeneratoreId.GeneraNuovoIdentificatore <Prodotto>(ApplicationStorage.Prodotti),
                Nome = nome,
                CategoriaAppartenenza = categoriaClasse,
                DataProduzione        = dataProduzione,
                Descrizione           = descrizione,
                Brand = brand
            };

            ApplicationStorage.Prodotti.Add(nuovoProdotto);

            Console.WriteLine($"Creato prodotto {nuovoProdotto.Nome}!"); //oppure concateni, ya know, ma conviene questo modo moderno
            Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            string path = @"\\TOWER\Media\Video\TV\Boardwalk Empire";


            ApplicationServiceLayer service = new ApplicationServiceLayer();

            //service.PopulateList(path);

            var files = service.PopulateList(path);
            //var result = service.ShowPreview();
            var result = service.ShowCleanMeta();

            //var indexList =  new IndexList().GenerateIndexList(0, 0, 0, 50);

            //var repository = new Repository().GetFiles(path,"*");

            //var renamer = new Renamer(repository);

            //var files = renamer.PreviewChanges(indexList);

            //var caretaker = new MementoCaretaker();
            //caretaker.Memento = renamer.SaveMemento();
            //var result = renamer.RestoreMemento(caretaker.Memento);


            //var allfiles = renamer.DisplayPaths();

            //files.WithNewIndexPattern();



            // var facade = new Facade();
            //    var list = files.PathContains(@"\Season").PathExclude(@"\metadata\").GetFilesWithIndex(dict);
            //    var list2 = list.GetIndexFromFile();

            //    var localFiles = new LocalFiles(list2);

            //    var res = localFiles.PopulateMediaItem(dict);

            //    var r3 = res.FilesToProcess().Preview();
            ////    res.FilesToProcess().RenameFiles();

            foreach (var file in files)
            {
                Console.WriteLine("Load :" + file);
            }

            foreach (var file in result)
            {
                Console.WriteLine("Preview :" + file);
            }

            //  service.SaveOriginalPaths();
            //service.RestoreOriginalPath();

            //foreach (var file in allfiles)
            //{

            //    Console.WriteLine(file);


            //}



            Console.WriteLine("Done");
            Console.Read();
        }
예제 #3
0
 public Form1()
 {
     InitializeComponent();
     _service = new ApplicationServiceLayer();
 }