コード例 #1
0
 public IActionResult Add(Model.Blog m)
 {
     Model.Category ca = cadal.GetModelByBh(m.cabh);
     if (ca != null)
     {
         m.caname = ca.caname;
     }
     if (m.id == 0)
     {
         //新增
         dal.insert(m);
     }
     else
     {
         //修改
         dal.update(m);
     }
     return(Redirect("/Admin/Blog/Index"));
 }