public ActionResult Create(DenemeModel newitem) { try { // TODO: Add insert logic here _DenemeRepository.insert_entity(newitem); return(RedirectToAction("Index")); } catch (Exception ex) { return(Content(ex.ToString())); } }
public ActionResult Edit(DenemeModel newModel, int id) { try { // TODO: Add update logic here newModel.ID = id; _DenemeRepository.update_entity(newModel); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult DropdownMesaj() { p.Clear(); cnn.Open(); string sorgu = "Select * From Messages Where GetID=@getid "; SqlCommand cmd = new SqlCommand(sorgu, cnn); cmd.Parameters.AddWithValue("@getid", 9); SqlDataReader oku = cmd.ExecuteReader(); while (oku.Read()) { var veri = new DenemeModel(); veri.baslik0 = oku["Title"].ToString(); veri.icerik0 = oku["Message"].ToString(); p.Add(veri); } ViewBag.MessageCount = p.Count(); cnn.Close(); return(View(p)); }
// GET: Deneme/Details/5 public ActionResult Details(int id) { DenemeModel item = _DenemeRepository.retrieve_entity(id); return(Content(item.Detail)); }
public void Put(DenemeModel model, int id) { model.ID = id; _denemeRepository.update_entity(model); }
public void Post(DenemeModel model) { System.Diagnostics.Debug.WriteLine("helllo"); _denemeRepository.insert_entity(model); }