protected void RadGrid1_OnItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "EditRow") { mvwForm.SetActiveView(viwAddEdit); RowID = Convert.ToInt32(e.CommandArgument); var term = TermService.GetTerm(RowID); txtName.Text = term.Name; chkIsActive.Checked = term.IsActive; txtName.Focus(); } }
// PUT api/<controller>/5 public IHttpActionResult Put(Term term) { IHttpActionResult result = null; TermService service = new TermService(); if (service.GetTerm(term.ID) != null) { service.UpdateTerm(term); result = Ok(term); } else { result = NotFound(); } return(result); }
public ActionResult Classes(int?id) // term id { checkLogin(); TERM displayingTerm = id != null?TermService.GetTerm((int)id) : CP.currentTerm; ClassViewModel CVM = new ClassViewModel() { classes = ClassService.getClassViews(displayingTerm.ID), SelectedTerm = displayingTerm.ID, TermList = CP.termSelectList, teachers = CP.teacherSelectList, newClass = new QE_CLASS() }; ModelState.Clear(); return(View(CVM)); }
// GET api/<controller>/5 public IHttpActionResult Get(int id) { IHttpActionResult result = null; TermService service = new TermService(); Term term = service.GetTerm(id); if (term != null) { result = Ok(term); } else { result = NotFound(); } return(result); }
// DELETE api/<controller>/5 public IHttpActionResult Delete(int id) { IHttpActionResult result = null; TermService service = new TermService(); Term term = service.GetTerm(id); if (term != null) { service.RemoveTerm(id); result = Ok(true); } else { result = NotFound(); } return(result); }