예제 #1
0
 public ActionResult ToggleTag(int id, int tagdiv)
 {
     var Db = DbUtil.Db;
     var organization = Db.LoadOrganizationById(id);
     if (tagdiv == 0)
         return Json(new { error = "bad tagdiv" });
     bool t = organization.ToggleTag(DbUtil.Db, tagdiv);
     Db.SubmitChanges();
     var m = new OrganizationModel { TagDiv = tagdiv, Name = id.ToString() };
     var o = m.OrganizationList().SingleOrDefault();
     if (o == null)
         return Content("error");
     return View("Row", o);
 }
예제 #2
0
 public ActionResult PasteSettings(OrganizationModel m)
 {
     var frorg = (int)Session["OrgCopySettings"];
     foreach (var o in m.OrganizationList())
     {
         var toorg = DbUtil.Db.LoadOrganizationById(o.Id);
         toorg.CopySettings(DbUtil.Db, frorg);
     }
     return new EmptyResult();
 }
예제 #3
0
 public ActionResult RepairTransactions(OrganizationModel m)
 {
     foreach (var o in m.OrganizationList())
         DbUtil.Db.PopulateComputedEnrollmentTransactions(o.Id);
     return new EmptyResult();
 }
예제 #4
0
 public ActionResult MainDiv(int id, int tagdiv)
 {
     var Db = DbUtil.Db;
     Db.SetMainDivision(id, tagdiv);
     var m = new OrganizationModel { TagDiv = tagdiv, Name = id.ToString() };
     var o = m.OrganizationList().SingleOrDefault();
     if (o == null)
         return Content("error");
     return View("Row", o);
 }