修改专业
控制器
#region 修改专业
public ActionResult UpdateSpecialty(int AcademeID, int SpecialtyID, string SpecialtyName, string SpecialtyCode)// 修改专业
{
SYS_Specialty modSpecialty = new SYS_Specialty();
ReturnJson msg = new ReturnJson();
msg.State = false;
if (AcademeID != 0 && SpecialtyID != 0 && !string.IsNullOrEmpty(SpecialtyName) && !string.IsNullOrEmpty(SpecialtyCode))
{
modSpecialty.AcademeID = AcademeID;
modSpecialty.SpecialtyID = SpecialtyID;
modSpecialty.SpecialtyName = SpecialtyName;
modSpecialty.SpecialtyCode = SpecialtyCode;
ChongQing.Entry(modSpecialty).State = System.Data.Entity.EntityState.Modified;
if (ChongQing.SaveChanges() > 0)
{
msg.State = true;
msg.Text = "修改成功!";
}
else
{
msg.Text = "修改失败!";
}
}
else
{
msg.Text = "专业名称或专业代号不能为空!";
}
return Json(msg, JsonRequestBehavior.AllowGet);// 修改专业
}
#endregion
JavaScript