public IHttpActionResult AdvertisementDetail(string id)
        {
            try
            {
                var advertiser = repo.FindById(id);
                currentAccount = advertiser;

                return(Ok <Advertisement>(advertiser));
            }
            catch (Exception)
            {
                return(InternalServerError());
            }
        }
Exemplo n.º 2
0
        public ActionResult Index(HttpPostedFileBase file, string id, string Title)
        {
            var advertisement = repo.FindById(id);

            advertisement.Title = Title;
            advertisement.Path  = "/Data/" + file.FileName;

            repo.Update(id, advertisement);

            string filePath = Server.MapPath("/Data/" + file.FileName);


            file.SaveAs(filePath);


            return(Redirect("/ads/detail/" + id + ""));
        }