62,046
社区成员
发帖
与我相关
我的任务
分享
public ActionResult Save(int id,string name,string content)
{
var model = new xxxModel();
xxxModel.Save(id,name,content);
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(int id, FormCollection form)
{
var model = Management.Information.FirstOrDefault(c => c.id == id);
if (model == null)
{
Information information = new Information();
UpdateModel(information, new[] { "Name", "Sex", "Tel", "Address", "Remarks" });
Management.AddToInformation(information);
Management.SaveChanges();
return RedirectToAction("Index");
}
else
{
return RedirectToAction("Create");
}
}