Exemplo n.º 1
0
 public ActionResult ApplyType(int id, OrganizationModel m)
 {
     foreach (var o in m.FetchOrgs())
         o.OrganizationTypeId = id == -1 ? (int?)null : id;
     DbUtil.Db.SubmitChanges();
     return View("Results", m);
 }
Exemplo n.º 2
0
 public ActionResult DivisionIds(int id)
 {
     var m = new OrganizationModel { ProgramId = id };
     return View(m);
     //return Json(OrgSearchModel.DivisionIds(id));
 }
Exemplo n.º 3
0
 //        public ActionResult ExportExcel(int prog, int div, int schedule, int status, int campus, string name)
 //        {
 //            var m = new OrgSearchModel
 //            {
 //                ProgramId = prog,
 //                DivisionId = div,
 //                ScheduleId = schedule,
 //                StatusId = status,
 //                CampusId = campus,
 //                Name = name
 //            };
 //            return new OrgExcelResult(m);
 //        }
 private void SaveToSession(OrganizationModel m)
 {
     Session[STR_OrgSearch] = new OrgSearchInfo
     {
         Name = m.Name,
         Program = m.ProgramId,
         Division = m.DivisionId,
         Sched = m.ScheduleId,
         Status = m.StatusId,
         OnlineReg = m.OnlineReg,
         Type = m.TypeId,
         Campus = m.CampusId,
     };
 }
Exemplo n.º 4
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);
 }
Exemplo n.º 5
0
 public ActionResult Results(OrganizationModel m)
 {
     SaveToSession(m);
     return View(m);
 }
Exemplo n.º 6
0
 public ActionResult TagDivIds(int id)
 {
     var m = new OrganizationModel { ProgramId = id };
     return View("DivisionIds", m);
 }
Exemplo n.º 7
0
 public ActionResult RenameDiv(int id, int divid, string name)
 {
     var d = DbUtil.Db.Divisions.Single(dd => dd.Id == divid);
     d.Name = name;
     DbUtil.Db.SubmitChanges();
     var m = new OrganizationModel { ProgramId = id };
     return View("DivisionIds", m);
 }
Exemplo n.º 8
0
 public ActionResult RepairTransactions(OrganizationModel m)
 {
     foreach (var o in m.OrganizationList())
         DbUtil.Db.PopulateComputedEnrollmentTransactions(o.Id);
     return new EmptyResult();
 }
Exemplo n.º 9
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();
 }
Exemplo n.º 10
0
 public ActionResult MakeNewDiv(int id, string name)
 {
     var d = new Division { Name = name, ProgId = id };
     d.ProgDivs.Add(new ProgDiv { ProgId = id });
     DbUtil.Db.Divisions.InsertOnSubmit(d);
     DbUtil.Db.SubmitChanges();
     var m = new OrganizationModel { ProgramId = id, TagDiv = d.Id };
     return View("DivisionIds", m);
 }
Exemplo n.º 11
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);
 }
Exemplo n.º 12
0
        public ActionResult Index(int? div, int? progid)
        {
            Response.NoCache();
            var m = new OrganizationModel();

            if (div.HasValue)
            {
                m.DivisionId = div;
                if (progid.HasValue)
                    m.ProgramId = progid;
                else
                    m.ProgramId = m.Division().ProgId;
                m.TagProgramId = m.ProgramId;
                m.TagDiv = div;
            }
            else if (Session[STR_OrgSearch].IsNotNull())
            {
                var os = Session[STR_OrgSearch] as OrgSearchInfo;
                m.Name = os.Name;
                m.ProgramId = os.Program;
                m.DivisionId = os.Division;
                m.ScheduleId = os.Sched;
                m.StatusId = os.Status;
                m.OnlineReg = os.OnlineReg;
                m.TypeId = os.Type;
                m.CampusId = os.Campus;
            }
            return View(m);
        }
Exemplo n.º 13
0
 public ActionResult EmailAttendanceNotices(OrganizationModel m)
 {
     m.SendNotices(this);
     return Content("ok");
 }