public void UpdateDetail(AboutDetail updateAboutDetail, AboutDetail model) { updateAboutDetail.Status = model.Status; updateAboutDetail.Logo = model.Logo; updateAboutDetail.Key = model.Key; updateAboutDetail.AboutUsId = model.AboutUsId; updateAboutDetail.Value = model.Value; _context.SaveChanges(); }
public IActionResult Create(AboutDetail model) { ViewBag.AboutUs = _aboutRepository.GetAboutFull(); if (model == null) { return(NotFound()); } if (ModelState.IsValid) { model.AddedBy = _admin.Name; model.AddedDate = DateTime.Now; _aboutRepository.CreateAboutUs(model); return(RedirectToAction("index")); } return(View(model)); }
public IActionResult Edit(AboutDetail model) { ViewBag.AboutUs = _aboutRepository.GetAboutFull(); var updateAboutDetail = _aboutRepository.GetAboutUsById(model.Id); if (model == null) { return(NotFound()); } if (ModelState.IsValid) { updateAboutDetail.ModifiedBy = _admin.Name; updateAboutDetail.ModifiedDate = DateTime.Now; _aboutRepository.UpdateDetail(updateAboutDetail, model); return(RedirectToAction("index")); } return(View(model)); }
public void RemoveAboutDetail(AboutDetail casespecs) { _context.AboutDetails.Remove(casespecs); _context.SaveChanges(); }
public AboutDetail CreateAboutUs(AboutDetail model) { _context.AboutDetails.Add(model); _context.SaveChanges(); return(model); }