Exemplo n.º 1
0
 public ActionResult Delete(Guid?id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     AccountBook.Models.AccountBook accountBook = _AccountBookSvc.GetSingle(id.Value);
     if (accountBook == null)
     {
         return(HttpNotFound());
     }
     return(View(accountBook));
 }
Exemplo n.º 2
0
        public ActionResult Edit(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Models.AccountBook accountBook = _AccountBookSvc.GetSingle(id.Value, User.Identity.Name);
            if (accountBook == null)
            {
                return(HttpNotFound());
            }

            var result = new EditRecordViewModel
            {
                Id       = accountBook.Id,
                Date     = accountBook.Date,
                Category = (BookType)accountBook.Category,
                Remark   = accountBook.Remark,
                Amount   = accountBook.Amount
            };

            return(View(result));
        }