public void Create([FromBody] Class Class) { if (ModelState.IsValid) { objClass.AddClass(Class); } }
public async Task <IActionResult> Add(DAL.Class @class) { await _class.AddClass(@class); await AddLog(@class.NAME + " adlı sınıf eklendi."); return(RedirectToAction("Add", new { success = true })); }
public void AddClass(ClassInf classInf) { int result = stuClass.AddClass(classInf); switch (result) { case 1: JScript.AlertAndRedirect("添加班级成功!", "AddClass.aspx"); break; case 0: JScript.Alert("添加失败,请检查输入!"); JScript.GoHistory(-1); break; case -2: JScript.Alert("班级编号重复请换其他班级编号!"); JScript.GoHistory(-1); break; } }