public IActionResult Index(BillsViewModel bvm) { MLContext mlContext = new MLContext(seed: 9997); BillsModelTrainer bmt = new BillsModelTrainer(); var data = bmt.GetRawData(mlContext, "2018Bills.csv"); var trainer = mlContext.MulticlassClassification.Trainers.NaiveBayes(labelColumnName: "Label", featureColumnName: "Features"); var model = bmt.TrainModel(mlContext, data, trainer); PredictionEngineBase <RawInput, Prediction> predictor = mlContext.Model.CreatePredictionEngine <RawInput, Prediction>(model); var outcome = predictor.Predict(new RawInput { Game = 0, Quarterback = bvm.Quarterback, Location = bvm.Location.ToString(), NumberOfPointsScored = bvm.NumberOfPointsScored, TopReceiver = bvm.TopReceiver, TopRunner = bvm.TopRunner, NumberOfSacks = 0, NumberOfDefensiveTurnovers = 0, MinutesPossession = 0, Outcome = "WHO KNOWS?" }); return(Content($"Under these conditions, the most likely outcome is a {outcome.Outcome.ToLower()}.")); }
public BillsPage() { InitializeComponent(); db = new BillManagerDB(); Setup(); BindingContext = new BillsViewModel(); }
public MainViewModel() { showAcountsUserWindow = new DelegateCommand(() => CurrentUserWindow = new AccountsViewModel()); showBillsUserWindow = new DelegateCommand(() => CurrentUserWindow = new BillsViewModel()); showExpensesUserWindow = new DelegateCommand(() => CurrentUserWindow = new ExpensesViewModel()); //CurrentUserWindow = new LibraryViewModel(); }
//[HttpPost] //public ActionResult Index(DateTime Date) //{ // var model = new BillsViewModel(Date); // return View(model); //} public ActionResult GetBills(DateTime?Date) { var date = Date ?? DateTime.Now; var model = new BillsViewModel(date); return(PartialView("_BillsTable", model)); }
public PartialViewResult PartialBringHome() { string ASPUser = GetUserId(); var model = new BillsViewModel(); var bh = new BringHomeLogic(); model.BringHomes = bh.getBringHome(ASPUser); return(PartialView("_PartialBringHome", model)); }
public PartialViewResult PartialWeekly() { string ASPUser = GetUserId(); var model = new BillsViewModel(); var mgr = new GetBills(); model.WeeklyBills = mgr.getWeeklyBills(ASPUser); return(PartialView("_PartialWeekly", model)); }
public PartialViewResult PartialUpcoming() { string ASPUser = GetUserId(); var model = new BillsViewModel(); var mgr = new GetBills(); model.TheUpcomingBills = mgr.getUpcomingBills(ASPUser); return(PartialView("_PartialUpcoming", model)); }
public BillController(ApplicationDbContext db) { _db = db; BillsVM = new BillsViewModel() { Users = _db.Users.ToList(), Bill = new Models.Bill() }; }
// GET: Bills public async Task <IActionResult> Index() { BillsViewModel model = new BillsViewModel(); model.bills = await _context.Bill.OrderBy(m => m.Date).ToListAsync(); model.customers = await _context.Customer.ToListAsync(); return(View(model)); }
public PartialViewResult InsertMonthly(MonthlyBill monthlyBillInsert) { string ASPUser = GetUserId(); var mgr = new GetBills(); mgr.InsertMonthly(monthlyBillInsert, ASPUser); var model = new BillsViewModel(); model.MonthlyBills = mgr.getMonthlyBills(ASPUser); return(PartialView("_PartialMonthly", model)); }
public IActionResult Index() { string ASPUser = GetUserId(); //testing var model = new BillsViewModel(); var mgr = new GetBills(); var bh = new BringHomeLogic(); model.TheUpcomingBills = mgr.getUpcomingBills(ASPUser); model.bankBalance = mgr.getBankBalance(ASPUser); return(View(model)); }
public PartialViewResult DeleteMonthly(int id) { string ASPUser = GetUserId(); var mgr = new GetBills(); mgr.DeleteMonthly(id); var model = new BillsViewModel(); model.MonthlyBills = mgr.getMonthlyBills(ASPUser); return(PartialView("_PartialMonthly", model)); }
public ActionResult Index() { int userId = (int)Session["userId"]; var bills = GetMonthlyBills(userId); var paidBills = GetPaidMonthlyBills(userId); var viewModel = new BillsViewModel { AllBills = bills, PaidBills = paidBills }; return(View(viewModel)); }
public IActionResult Bills() { var userId = this.userManager.GetUserId(this.HttpContext.User); if (userId == null) { return(this.RedirectToAction("Index")); } var userEmail = this.userManager.FindByIdAsync(userId).Result.ToString(); var allApartments = this.usersApartmentsRepository.All().Where(x => x.ApplicationUserId == userId).ToList(); var userApartmentsIds = new List <int>(); foreach (var apartment in allApartments) { userApartmentsIds.Add(apartment.ApartmentId); } var allPayments = this.paymentsRepository.All().Where(x => x.ApartmentId == userApartmentsIds.FirstOrDefault()); var userApartmentPayments = new List <decimal>(); var paymentsDates = new List <string>(); foreach (var apartmentId in userApartmentsIds) { foreach (var payment in allPayments) { userApartmentPayments.Add(payment.TotalSum); paymentsDates.Add(payment.CreatedOn.ToString()); } } var viewModel = new BillsViewModel { UserEmail = userEmail, ApartmentsIds = userApartmentsIds, Payments = userApartmentPayments, Dates = paymentsDates, }; return(this.View(viewModel)); }
public ShellViewModel( IDialogService dialogService , SuppliersViewModel suppliersViewModel , BillsViewModel billsViewModel ) { this._dialogService = dialogService ?? throw new ArgumentNullException(nameof(dialogService)); this.SuppliersViewModel = suppliersViewModel ?? throw new ArgumentNullException(nameof(suppliersViewModel)); this.BillsViewModel = billsViewModel ?? throw new ArgumentNullException(nameof(billsViewModel)); //this._isEnabled_OAPH = Observable // .Return(true) // .ToProperty(this, nameof(this.IsEnabled)) // .DisposeWith(this._disposables); this.Items.Add(this.SuppliersViewModel); this.Items.Add(this.BillsViewModel); this.DisplayName = nameof(Billy) + Thread.CurrentThread.Name; }
private void GetBills() { try { BillsList.Clear(); var bills = dBContext.Bills.Where(p => p.IsDeleted == false).AsNoTracking().ToList(); foreach (var item in bills) { var viewModel = new BillsViewModel() { Bulstat = item.Bulstat, Number = item.Number, PriceWithDDS = item.PriceWithDDS, PriceWithoutDDS = item.PriceWithoutDDS }; BillsList.Add(viewModel); } } catch (Exception ex) { log.Error(ex.Message); } }
public PaymentsViewModel(BillsViewModel bills, DebtsViewModel debts) : base(bills, debts) { }