예제 #1
0
        public ActionResult ToggleTag(int id, int tagdiv)
        {
            //var Db = Db;
            var organization = CurrentDatabase.LoadOrganizationById(id);

            if (tagdiv == 0)
            {
                return(Json(new { error = "bad tagdiv" }));
            }

            var t = organization.ToggleTag(CurrentDatabase, tagdiv);

            CurrentDatabase.SubmitChanges();
            var m = new OrgSearchModel(CurrentDatabase)
            {
                StatusId = 0, TagDiv = tagdiv, Name = id.ToString()
            };
            var o = m.OrganizationList().SingleOrDefault();

            if (o == null)
            {
                return(Content("error"));
            }

            return(View("Row", o));
        }
예제 #2
0
 public ActionResult RepairTransactions(OrgSearchModel m)
 {
     foreach (var o in m.OrganizationList())
     {
         DbUtil.Db.PopulateComputedEnrollmentTransactions(o.Id);
     }
     return(new EmptyResult());
 }
예제 #3
0
        public ActionResult PasteSettings(OrgSearchModel 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());
        }
예제 #4
0
        public ActionResult MainDiv(int id, int tagdiv)
        {
            var Db = DbUtil.Db;

            Db.SetMainDivision(id, tagdiv);
            var m = new OrgSearchModel {
                TagDiv = tagdiv, Name = id.ToString()
            };
            var o = m.OrganizationList().SingleOrDefault();

            if (o == null)
            {
                return(Content("error"));
            }
            return(View("Row", o));
        }