public void SavePost(DistrictInput input) { //var depart = Fun.ClassToCopy<DistrictInput, District>(input); //var depart = AutoMapper.Mapper.Map<District>(input); var depart = _districtManagerManager.GetDistrict(input.Id) ?? new District(); depart = Fun.ClassToCopy(input, depart, (new string[] { "Id" }).ToList()); _districtManagerManager.SaveOrUpdateDistrict(depart); }
public ActionResult EditDistrict(long?id) { var model = new DistrictInput { TenantId = AbpSession.TenantId, IsUse = true }; if (id != null && id != 0) { var nav = _districtAppService.GetDistrict(id.Value); model = nav.MapTo <DistrictInput>(); } return(View("Easyman.FwWeb.Views.Admin.EditDistrict", model)); }