コード例 #1
0
ファイル: Program.cs プロジェクト: feffante/TRUCKMANAGECODE
        private static List <string> CaricaCategoria()
        {
            var MyLista = new List <string>();

            try
            {
                TRUCKMODEL.BEMagazzino be = new TRUCKMODEL.BEMagazzino();
                var Query = be.GetMagCategoria();

                foreach (var item in Query)
                {
                    MyLista.Add(item.Categoria);
                }
            }
            catch
            {}


            return(MyLista);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: feffante/TRUCKMANAGECODE
        private static void Main()
        {
            //     ReadAllSettings();
            //      static void ReadAllSettings()
            // {
            //     try
            //     {
            //         var appSettings = ConfigurationManager.AppSettings;

            //         if (appSettings.Count == 0)
            //         {
            //             Console.WriteLine("AppSettings is empty.");
            //         }
            //         else
            //         {
            //             foreach (var key in appSettings.AllKeys)
            //             {
            //                 Console.WriteLine("Key: {0} Value: {1}", key, appSettings[key]);
            //             }
            //         }
            //     }
            //     catch (ConfigurationErrorsException)
            //     {
            //         Console.WriteLine("Error reading app settings");
            //     }
            // }

            //******************************************************************************
            var dbcontex = new TRUCKMODEL.Models.truckmanageContext();

            TRUCKMODEL.BEMagazzino BE = new TRUCKMODEL.BEMagazzino();
            var q = BE.GetMagazzinoView();

            foreach (var item in q)
            {
                Console.WriteLine($"ID: {item.IdMagazzino} CODICE: {item.CodiceArticolo} DSCRIZIONE: {item.NomeArticolo}");
            }
//***************************************************************************************************************
            // Application.Init();
            // var top = Application.Top;

            // var mainWindow = new Window("MAGAZZINO")
            // {
            //     X = 0,
            //     Y = 1, // Leave one row for the toplevel menu

            //     // By using Dim.Fill(), it will automatically resize without manual intervention
            //     Width = Dim.Fill(),
            //     Height = Dim.Fill()
            // };

            // #region top-menu
            // top.Add(
            //     new MenuBar(new MenuBarItem[] {
            //         new MenuBarItem("_File", new MenuItem[]{
            //             new MenuItem("_Quit", "", Application.RequestStop)
            //         }), // end of file menu
            //         new MenuBarItem("_Help", new MenuItem[]{
            //             new MenuItem("_About", "", ()
            //                         => MessageBox.Query(50, 5, "About", "Scirtto da Casali Federico\nVersion: 0.1", "Ok"))
            //         }) // end of the help menu
            //     })
            // );
            // #endregion

            // View FindViewFrame = CreaFindView();
            // mainWindow.Add(FindViewFrame);

            // View Details_View = CreaDetailsView(4);
            // mainWindow.Add(Details_View);



            // #region Grid_view
            // var Grid_View = new FrameView()
            // {
            //     X = 0,
            //     Y = Pos.Bottom(Details_View),
            //     Width = FindViewFrame.Width,
            //     Height = Dim.Fill()
            // };
            // #endregion



            // mainWindow.Add(Grid_View);



            // top.Add(mainWindow);
            // Application.Run();
        }