예제 #1
0
        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()));
            }
        }
예제 #2
0
        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());
            }
        }
예제 #3
0
        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));
        }
예제 #4
0
        // GET: Deneme/Details/5
        public ActionResult Details(int id)
        {
            DenemeModel item = _DenemeRepository.retrieve_entity(id);

            return(Content(item.Detail));
        }
예제 #5
0
 public void Put(DenemeModel model, int id)
 {
     model.ID = id;
     _denemeRepository.update_entity(model);
 }
예제 #6
0
 public void Post(DenemeModel model)
 {
     System.Diagnostics.Debug.WriteLine("helllo");
     _denemeRepository.insert_entity(model);
 }