public ActionResult Index(int id)
 {
     var m = new PostBundleModel(id);
     if (m.bundle == null)
         return Content("no bundle " + m.id);
     if (m.bundle.BundleStatusId == BundleStatusCode.Closed)
         return Content("bundle closed");
     m.fund = m.bundle.FundId ?? 1;
     return View(m);
 }
 public ActionResult Edit(string id, string value)
 {
     var iid = id.Substring(1).ToInt();
     var c = DbUtil.Db.Contributions.SingleOrDefault(co => co.ContributionId == iid);
     if (c != null)
         switch (id.Substring(0, 1))
         {
             case "a":
                 c.ContributionAmount = value.ToDecimal();
                 DbUtil.Db.SubmitChanges();
                 var m = new PostBundleModel();
                 return Json(m.ContributionRowData(this, iid));
             case "f":
                 c.FundId = value.ToInt();
                 DbUtil.Db.SubmitChanges();
                 return Content("{0} - {1}".Fmt(c.ContributionFund.FundId, c.ContributionFund.FundName));
         }
     return new EmptyResult();
 }
 public ActionResult DeleteRow(PostBundleModel m)
 {
     return Json(m.DeleteContribution());
 }
 public ActionResult UpdateRow(PostBundleModel m)
 {
     return Json(m.UpdateContribution(this));
 }
 public ActionResult PostRow(PostBundleModel m)
 {
     return Json(m.PostContribution(this));
 }
 public ActionResult GetNamePid(PostBundleModel m)
 {
     var o = m.GetNamePidFromId();
     return Json(o);
 }
 public ActionResult FundTotals(int id)
 {
     var m = new PostBundleModel(id);
     return View(m);
 }
 public JsonResult Funds()
 {
     var m = new PostBundleModel();
     return Json(m.Funds2());
 }