public IActionResult AddFooterLink(FooterLink footerLink) { if (ModelState.IsValid) { footerLink.Id = Guid.NewGuid().ToString(); var config = profileService.Config; switch (Request.Query["type"]) { case "WhatsNew": config.WhatsNew.Add(footerLink); break; case "FriendLinks": config.FriendLinks.Add(footerLink); break; case "About": config.About.Add(footerLink); break; case "Others": config.Others.Add(footerLink); break; } profileService.Config = config; } return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { FooterLink footerLink = db.foterLinks.Find(id); db.foterLinks.Remove(footerLink); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "FooterId,facebook,twitter,instagram,youtube,googlemap,email,telephone,adres,whataspp")] FooterLink footerLink) { if (ModelState.IsValid) { db.Entry(footerLink).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(footerLink)); }
public void update(FooterLink c) { linkCollection.UpdateOne( Builders <FooterLink> .Filter.Eq("_id", c.Id), Builders <FooterLink> .Update .Set("facebook", c.facebook) .Set("instagram", c.instagram) .Set("twitter", c.twitter) .Set("youtube", c.youtube) .Set("googleMap", c.googleMap) ); }
// GET: FooterLink/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FooterLink footerLink = db.foterLinks.Find(id); if (footerLink == null) { return(HttpNotFound()); } return(View(footerLink)); }
public ActionResult Edit(FooterLink c, FormCollection fc) { string id = fc["Id"]; var f = footerLinkModel.find(id); f.facebook = c.facebook; f.twitter = c.twitter; f.instagram = c.instagram; f.youtube = c.youtube; f.googleMap = c.googleMap; footerLinkModel.update(f); return(RedirectToAction("Index")); }
public ActionResult Add(FooterLink c) { footerLinkModel.create(c); return(RedirectToAction("Index")); }
public void create(FooterLink c) { linkCollection.InsertOne(c); }