예제 #1
0
 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();
 }
예제 #2
0
 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));
 }
예제 #3
0
        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));
        }
예제 #4
0
 public void RemoveAboutDetail(AboutDetail casespecs)
 {
     _context.AboutDetails.Remove(casespecs);
     _context.SaveChanges();
 }
예제 #5
0
 public AboutDetail CreateAboutUs(AboutDetail model)
 {
     _context.AboutDetails.Add(model);
     _context.SaveChanges();
     return(model);
 }