Пример #1
0
        public JsonResult SpendExpense(SpendNewViewModel model)
        {
            var spend = SpendViewModel2Spend.Map(model);

            SpendService.Instance(UserSid).CreateExpense(spend);
            //model.Save(ClientId);
            return(Json(new { }));
            //return RedirectToAction("New");
        }
Пример #2
0
        public ActionResult New()
        {
            var spend = new SpendNewViewModel()
            {
                Date = DateTime.Now
            };

            return(View(spend));
        }
Пример #3
0
        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);
        }