public JsonResult Create(ViewExpense expense)
 {
     try {
         // TODO: Add insert logic here
         //create a new Client object
         int result;
         ExpenseMeModelContainer context = new ExpenseMeModelContainer();
         Expense e = context.Expenses.CreateObject();
         {
             e.Description = expense.Description;
             e.Spent = expense.Spent;
             e.ExpenseDate = expense.ExpenseDate;
             e.ExpenseId = 0;
         }
         //save to db
         context.Expenses.AddObject(e);
         result=context.SaveChanges();
         return this.Json(new TransactionResult() { IsError = true, StatusDescription = "Expense posted", Data = expense });
     }
     catch (Exception ex) {
         return this.Json(new TransactionResult() { IsError = true, StatusDescription = ex.Message });
     }
 }
 //
 // GET: /Expense/Details/5
 public JsonResult Details(int id)
 {
     ExpenseMeModelContainer context = new ExpenseMeModelContainer();
     var expenseresult = context.Expenses.SingleOrDefault(e => e.ExpenseId == id);
     ViewExpense expense = new ViewExpense()
     {
         Description = expenseresult.Description,
         ExpenseDate = expenseresult.ExpenseDate.Value,
         ExpenseId = expenseresult.ExpenseId,
         Spent = expenseresult.Spent.Value
     };
     return this.Json(expense,JsonRequestBehavior.AllowGet);
 }
        public JsonResult Edit(ViewExpense expense)
        {
            try {
                // TODO: Add update logic here

                return this.Json(expense);
            }
            catch (Exception ex) {
                return this.Json(new TransactionResult() { IsError = true, StatusDescription = ex.Message });
            }
        }