public JsonResult GetBudgetByID(long id)
        {
            BudgetAdapter budgetAdapter  = new BudgetAdapter();
            BudgetModel   selectedBudget = budgetAdapter.GetBudgetByID(id);

            return(Json(selectedBudget, JsonRequestBehavior.AllowGet));
        }
        public JsonResult UpdateBudget(string data)
        {
            Dictionary <string, string> variables = JsonConvert.DeserializeObject <Dictionary <string, string> >(data);
            BudgetAdapter budgetAdapter           = new BudgetAdapter();
            BudgetModel   budget = budgetAdapter.GetBudgetByID(long.Parse(variables["Id"]));

            budget.Description  = variables["Description"].ToString();
            budget.Amount       = decimal.Parse(variables["Amount"]);
            budget.Frequency_ID = int.Parse(variables["FrequencyID"]);
            budget.Account_ID   = int.Parse(variables["AccountTypeID"]);

            budgetAdapter.SetBudget(budget, User.Identity.Name);

            return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
        }