示例#1
0
        public IActionResult FirstPage()
        {
            var model = new FirstPageModel();

            model.Prediction = _MLService.PredictFromFile();
            return(PartialView(model));
        }
示例#2
0
        public async Task <bool> TrainModel()
        {
            var model = new FirstPageModel();
            await _weatherService.TrainModel();

            _MLService.TrainModel();
            return(true);
        }
        public void Test_TextInput_Null()
        {
            var _dialogSerice    = new Mock <IDialogService>();
            var _settingsService = new Mock <ISettingsService>();
            var firstPageModel   = new FirstPageModel(_dialogSerice.Object, _settingsService.Object);

            firstPageModel.TextInput = null;
            Assert.IsFalse(firstPageModel.TextInputCheck);
        }
示例#4
0
        public async Task <IActionResult> Tables()
        {
            try
            {
                var res = new FirstPageModel();
                res.DistanceByProvinces = await _Da.GetDistanceByProvinceTableData();

                res.TypeOfRelevations = await _Da.GetTypeOfRelevationsData();

                res.TopTenDevices = await _Da.GetTopTenDevicesData();

                res.TopTenByScores = await _Da.GetTopTenByScoresData();

                return(View(res));
            }
            catch (Exception)
            {
                return(RedirectToAction(nameof(ErrorPage), new ErrorModel {
                    Error = "Non è stato possibile caricare i dati"
                }));
            }
        }
示例#5
0
        public ActionResult Autorize(string email, string password)
        {
            FirstPageModel db  = new FirstPageModel();
            Persons        aut = db.GetUser(email);

            if (aut == null)
            {
                ViewBag.Answer = "No such user. Try again.";
                return(View("Index"));
            }

            if (aut.Password == password)
            {
                return(View("MainWindow_cw"));
            }
            else
            {
                ViewBag.Answer = "Password is incorect";
                return(View("Index"));
            }

            // id - имя клиента, заказы которого необходимо выводить на странице.
            // ViewBag.Answer = "No such user. Try again.";
        }
示例#6
0
 public AboutPage()
 {
     InitializeComponent();
     BindingContext = VM = new FirstPageModel();
     SetBinding(Shell.NavBarIsVisibleProperty, new Binding(nameof(VM.ShowNavBar)));
 }