public async Task <IActionResult> EditSection(UpdateSectionCommand command) { if (await Mediator.Send(command) == null) { return(BadRequest()); } return(Ok()); }
protected void Reg_Mod(object sender, EventArgs e) { course = new Course(); course.Id = list_course.SelectedValue; course.Name = list_course.DataTextField; section = new Section(); section.Id = Int32.Parse(Session["Id_mod"].ToString()); section.Name = name.Value; section.Description = desc.Value; section.Amount = Double.Parse(amount.Value); section.Course = course; UpdateSectionCommand cmd = new UpdateSectionCommand(section); cmd.Execute(); if (section.Code == 201) { ClientScript.RegisterClientScriptBlock(this.GetType(), "random", "alertme_succ()", true); } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "random", "alertme()", true); } }
public async Task <IActionResult> Update([FromBody] UpdateSectionCommand command) { await Mediator.Send(command); return(NoContent()); }