public ActionResult EditSave(EditClientCitySupplierHukou model, string returnUrl = "Index")
        {
            ViewBag.Path1 = "参数设置";
            //检查记录在权限范围内
            var result = Common.GetHRAdminClientCitySupplierHukouQuery(db, WebSecurity.CurrentUserId).Include(a => a.PensionTypes).Include(a => a.AccumulationTypes).Where(a => a.Id == model.ClientCitySupplierHukouId).SingleOrDefault();
            if (result == null)
            {
                Common.RMError(this);
                return Redirect(Url.Content(returnUrl));
            }
            //end

            if (ModelState.IsValid)
            {
                try
                {
                    var pensionTypes = Common.GetPensionTypeQuery(db).Where(a => model.PensionTypeIds.Any(b => b == a.Id)).ToList();
                    var accumulationTypes = Common.GetAccumulationTypeQuery(db).Where(a => model.PensionTypeIds.Any(b => b == a.Id)).ToList();
                    result.PensionTypes = pensionTypes;
                    result.AccumulationTypes = accumulationTypes;
                    db.PPSave();
                    Common.RMOk(this, "记录:" + result + "保存成功!");
                    return Redirect(Url.Content(returnUrl));
                }
                catch (Exception e)
                {
                    ModelState.AddModelError(string.Empty, e.Message);
                }
            }
            ViewBag.ReturnUrl = returnUrl;

            return View("Edit", model);
        }
        public ActionResult Edit(int id = 0, string returnUrl = "Index")
        {
            ViewBag.Path1 = "参数设置";
            //检查记录在权限范围内
            var result = Common.GetHRAdminClientCitySupplierHukouQuery(db, WebSecurity.CurrentUserId).Where(a => a.Id == id).SingleOrDefault();
            if (result == null)
            {
                Common.RMError(this);
                return Redirect(Url.Content(returnUrl));
            }
            //end

            var model = new EditClientCitySupplierHukou
            {
                ClientCitySupplierHukouId = result.Id,
                Name = result.Name,
                PensionTypeIds = result.PensionTypes.Select(a => a.Id).ToList(),
                AccumulationTypeIds = result.AccumulationTypes.Select(a => a.Id).ToList(),
            };

            ViewBag.ReturnUrl = returnUrl;

            return View(model);
        }