コード例 #1
0
        public ActionResult UrunGuncelle(int id)
        {
            List <SelectListItem> kategoriler = new List <SelectListItem>();

            foreach (Kategori item in _kategoriService.GetAll())
            {
                kategoriler.Add(new SelectListItem()
                {
                    Text = item.KategoriAdi, Value = item.KategoriId.ToString()
                });
            }
            ViewBag.Kategoriler = kategoriler;
            List <SelectListItem> markalar = new List <SelectListItem>();

            foreach (Marka item in _markaService.GetAll())
            {
                markalar.Add(new SelectListItem()
                {
                    Text = item.MarkaAdi, Value = item.MarkaId.ToString()
                });
            }
            ViewBag.Markalar = markalar;
            Urun urun = _urunService.GetByID(id);

            return(View(urun));
        }
コード例 #2
0
        public ActionResult UrunDetay(int id)
        {
            Urun urun = _urunService.GetByID(id);

            return(View(urun));
        }
コード例 #3
0
        public HttpResponseMessage Get(int id)
        {
            var urun = _urunService.GetByID(id);

            return(Request.CreateResponse(HttpStatusCode.OK, urun));
        }