Exemple #1
0
 public void UpdateClaim(AboutClaim updateAboutClaim, AboutClaim model)
 {
     updateAboutClaim.Status        = model.Status;
     updateAboutClaim.ClaimLogo     = model.ClaimLogo;
     updateAboutClaim.ClaimSubtext  = model.ClaimSubtext;
     updateAboutClaim.ClaimSubtitle = model.ClaimSubtitle;
     updateAboutClaim.AboutUsId     = model.AboutUsId;
     _context.SaveChanges();
 }
 public IActionResult Create(AboutClaim model)
 {
     ViewBag.AboutUs = _aboutRepository.GetAboutFull();
     if (model == null)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         model.AddedBy   = _admin.Name;
         model.AddedDate = DateTime.Now;
         _aboutRepository.CreateAboutClaim(model);
         return(RedirectToAction("index"));
     }
     return(View(model));
 }
        public IActionResult Edit(AboutClaim model)
        {
            ViewBag.AboutUs = _aboutRepository.GetAboutFull();
            var updateAboutClaim = _aboutRepository.AboutClaimById(model.Id);

            if (model == null)
            {
                return(NotFound());
            }
            if (ModelState.IsValid)
            {
                updateAboutClaim.ModifiedBy   = _admin.Name;
                updateAboutClaim.ModifiedDate = DateTime.Now;
                _aboutRepository.UpdateClaim(updateAboutClaim, model);
                return(RedirectToAction("index"));
            }
            return(View(model));
        }
Exemple #4
0
 public void RemoveClaim(AboutClaim claim)
 {
     _context.AboutClaims.Remove(claim);
     _context.SaveChanges();
 }
Exemple #5
0
 public AboutClaim CreateAboutClaim(AboutClaim model)
 {
     _context.AboutClaims.Add(model);
     _context.SaveChanges();
     return(model);
 }