Пример #1
0
 public ActionResult Create(DivisionModel m)
 {
     var d = new Division { Name = "New Division" };
     d.ProgId = m.TagProgramId;
     d.ProgDivs.Add(new ProgDiv { ProgId = m.TagProgramId.Value });
     DbUtil.Db.Divisions.InsertOnSubmit(d);
     DbUtil.Db.SubmitChanges();
     DbUtil.Db.Refresh(RefreshMode.OverwriteCurrentValues, d);
     var di = m.DivisionItem(d.Id).Single();
     return View("Row", di);
 }
Пример #2
0
 public ActionResult MainProg(int id, DivisionModel m)
 {
     var division = DbUtil.Db.Divisions.Single(d => d.Id == id);
     division.ProgId = m.TagProgramId;
     DbUtil.Db.SubmitChanges();
     DbUtil.Db.Refresh(RefreshMode.OverwriteCurrentValues, division);
     var di = m.DivisionItem(id).Single();
     return View("Row", di);
 }