public ActionResult Index(int id) { ViewBag.Title = "Redigera"; var model = new EditBillViewModel(); var bill = EconomyBusiness.GetBillById(id); if (bill == null) { return(HttpNotFound("Finns ingen faktura med id: " + id.ToString())); } model.BillId = bill.BillID; model.DueDate = bill.DueDate; model.Amount = Math.Round(bill.Amount, 2); model.SelectedCategoryId = bill.CategoryID; model.SelectedSubCategoryId = bill.SubCategoryID; model.SelectedPayerId = bill.PayerID; model.Description = bill.Description; model.Categories = EconomyBusiness.GetAllCategories(); model.SubCategories = EconomyBusiness.GetAllSubCategories(); model.Payers = EconomyBusiness.GetAllPayers(); return(View("Index", model)); }
public ActionResult Index() { var model = EconomyBusiness.GetMonthlyBills(); ViewBag.RunButtonDisabled = EconomyBusiness.IsMonthlyPaymentsExecuted(DateTime.Now); return(View(model)); }
public JsonResult GetSubCategories(CategoryJson categoryJson) { var model = EconomyBusiness.GetSubCategoriesByCategory(categoryJson.CategoryId).ToList(); var list = JsonConvert.SerializeObject(model, Formatting.Indented, new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }); return(Json(list, JsonRequestBehavior.DenyGet)); }
public ActionResult Copy(int id) { var model = EconomyBusiness.CopyBill(id); if (model != null) { return(RedirectToAction("Index", "Invoice", new { id = model.BillID })); } return(Create()); }
public ActionResult Create() { ViewBag.Title = "Skapa"; var model = new EditBillViewModel(); model.Categories = EconomyBusiness.GetAllCategories(); model.SubCategories = EconomyBusiness.GetAllSubCategories(); model.Payers = EconomyBusiness.GetAllPayers(); return(View("Edit", model)); }
public ActionResult Index(int?page) { if (!Request.IsAuthenticated) { return(RedirectToAction("Login", "User")); } page = page ?? 0; ViewBag.Title = "Skapa"; var model = EconomyBusiness.GetBills(page.Value, 50); return(View(model)); }
public ActionResult Edit(int id) { ViewBag.Title = "Redigera"; var model = new EditBillViewModel(); var bill = EconomyBusiness.GetMonthlyBillById(id); model.BillId = bill.MonthlyBillID; model.Amount = bill.Amount; model.SelectedCategoryId = bill.CategoryID; model.SelectedSubCategoryId = bill.SubCategoryID; model.SelectedPayerId = bill.PayerID; model.Description = bill.Description; model.Categories = EconomyBusiness.GetAllCategories(); model.SubCategories = EconomyBusiness.GetAllSubCategories(); model.Payers = EconomyBusiness.GetAllPayers(); return(View("Edit", model)); }
public ActionResult Index() { var model = new StatisticsViewModel(); model.Categories = EconomyBusiness.GetAllCategories(); model.SubCategories = EconomyBusiness.GetAllSubCategories(); model.Descriptions = EconomyBusiness.GetAllDescriptions(); model.Years = StatisticsBusiness.GetYears(); int selectedYear = -AppSettings.GetAppSettingsInteger("YearsBack");//DateTime.Now.AddYears(-AppSettings.GetAppSettingsInteger("YearsBack")).Year; model.SelectedYear = DateTime.Now.AddYears(selectedYear).Year; model.ChartSrc = StatisticsBusiness.GetChart(new FilterJson { CategoryId = 0, SubCategoryId = 0, Description = string.Empty, FromYear = model.SelectedYear }); return(View(model)); }
public JsonResult IsMonthlyPaymentsExecuted(DateTime date) { var model = EconomyBusiness.IsMonthlyPaymentsExecuted(date); return(Json(model)); }
public JsonResult RunMonthlyPayments(DateTime date) { var model = EconomyBusiness.RunMonthlyPayments(date); return(Json(model)); }
public JsonResult AutoCompleteDescription() { var model = EconomyBusiness.GetAllDescriptions().ToList(); return(Json(model, JsonRequestBehavior.DenyGet)); }
public JsonResult SaveMonthlyBill(BillJson billJson) { var model = EconomyBusiness.SaveMonthlyBill(billJson); return(Json(model)); }