标签:for eterm add forms 前台 name action service ice
一
/// <summary> /// 参数信息分页请求,前台要设置Form,这样可以当前页多值修改 /// </summary> /// <returns></returns> [HttpPost] public ActionResult ParameterMgr1 ( FormCollection forms ) { //获取界面的值,多个遍历更新 try { var ParameterModel = DB . JJRMDBServices . Sys_Parameter ; //遍历Form中的name,文本的name设成Para,AllKeys获取所有键(name) foreach ( string key in forms . AllKeys ) { //找到对应Para名称的值,forms[key]是对应的值 ParameterModel . Where ( x => x . Para == key ). Single (). Value = forms [ key ]; } //保存提交 DB . JJRMDBServices . SaveChanges (); return Redirect ( "/System/ParameterMgr1" ); } catch ( Exception ) { ModelState . AddModelError ( "" , "保存失败" ); } return Redirect ( "/System/ParameterMgr1" ); }
标签:for eterm add forms 前台 name action service ice
原文地址:http://www.cnblogs.com/xdot/p/6958287.html