public ActionResult Modifier(int id) { tb_ads ad = annoncesRepository.GetById(id); if (ad == null) { throw new HttpException(404, "Annonce not found"); } ModifierAdsViewModel model = new ModifierAdsViewModel { id_ad = ad.id_ad, ad_title = ad.ad_title, id_section = ad.id_section, id_category = ad.id_category, ad_description = ad.ad_description, ad_price = (double)ad.ad_price, id_devise = (int)ad.id_devise }; ViewBag.id_devise = new SelectList(deviseRepository.GetAll(), "id_devise", "description", model.id_devise); ViewBag.selected_category = this.populateCategoryBySection(); return(View(model)); }
public ActionResult Create() { ViewBag.ad_type = new SelectList(adtypeRepository.GetAll(), "id_ad_type", "description"); ViewBag.id_commune = new SelectList(communeRepository.GetAll(), "id_commune", "commune"); ViewBag.id_devise = new SelectList(deviseRepository.GetAll(), "id_devise", "symbole"); ViewBag.id_category = this.populateCategoryBySection(); ViewBag.id_item_condition = new SelectList(condRepository.GetAll(), "id_item_condition", "item_condition"); return(View()); }
public List <Devise> GetAll() { List <Devise> result = new List <Devise>(); result = _DeviseRepository.GetAll(); return(result); }
public List <Devise> GetAll() { List <Devise> result = new List <Devise>(); try { result = _DeviseRepository.GetAll(); return(result); } catch (Exception ex) { throw ex; } }