// XiaoTuan/Home/ActivityEditAdmin public ActionResult ActivityEditAdmin(string id) { if (id.HasValue()) { InitForm("编辑活动"); var ActivityDetial = _IXiaoTuanService.GetActivityDetial(id); var orgSelect = _IXiaoTuanService.UserOrgList(DataContext.UserID); return(View(ActivityEditAdmin_M.ToViewModel(ActivityDetial, orgSelect))); } else { return(Alert("参数请求错误")); } }
public ActionResult ActivityEditAdmin(ActivityEditAdmin_M model, string photo) { try { model.activity_photo = photo; return(_activity.Update(model.ToModel()) ? RedirectToAction("ActivityList", "Home", new { area = "XiaoTuan" }) : Alert("编辑失败")); } catch (FormValitationException ex) { FormValitation = ex; InitForm("编辑活动"); var ActivityDetial = _IXiaoTuanService.GetActivityDetial(model.activity_id); var orgSelect = _IXiaoTuanService.UserOrgList(DataContext.UserID); return(View(ActivityEditAdmin_M.ToViewModel(ActivityDetial, orgSelect))); } }