public virtual ActionResult Edit(Guid id) { var aboutSection = unitOfWork.AboutSectionRepository.GetByID(id); if (aboutSection == null) aboutSection = new AboutSection() { AboutSectionId = id }; var vm = AboutSectionMapper.GetVM(aboutSection); return View(vm); }
public static void GetAboutSection(AboutSectionEditVM vm, ref AboutSection aboutSection) { if (aboutSection == null) { aboutSection = new AboutSection(); } if (vm != null) { aboutSection.HeaderBG = vm.HeaderBG; aboutSection.HeaderEN = vm.HeaderEN; aboutSection.TextBG = vm.TextBG; aboutSection.TextEN = vm.TextEN; aboutSection.OrderNum = vm.OrderNum; } }
public static AboutSectionEditVM GetVM(AboutSection aboutSection) { var vm = new AboutSectionEditVM(); if (aboutSection == null) aboutSection = new AboutSection() { AboutSectionId = Guid.NewGuid() }; vm.AboutSectionId = aboutSection.AboutSectionId; vm.FileName = aboutSection.FileName; vm.HeaderBG = aboutSection.HeaderBG; vm.HeaderEN = aboutSection.HeaderEN; vm.TextBG = aboutSection.TextBG; vm.TextEN = aboutSection.TextEN; vm.OrderNum = aboutSection.OrderNum; return vm; }