public JsonResult SpendExpense(SpendNewViewModel model) { var spend = SpendViewModel2Spend.Map(model); SpendService.Instance(UserSid).CreateExpense(spend); //model.Save(ClientId); return(Json(new { })); //return RedirectToAction("New"); }
public ActionResult New() { var spend = new SpendNewViewModel() { Date = DateTime.Now }; return(View(spend)); }
public static Spend Map(SpendNewViewModel model) { var spend = new Spend(); spend.Sum = model.Sum; spend.Comment = model.Comment; spend.VectorId = model.VectorId; spend.CategoryId = model.CategoryId; spend.Date = model.Date; spend.BillId = model.BillId; return(spend); }