Esempio n. 1
0
 public ActionResult Edit(int id)
 {
     IProfileDAC dac = new ProfileDAC();
     var profile = dac.GetProfile(id);
     var model = new ProfileEdit { ProfileID = profile.ProfileID, Name = profile.Name, ProfileText = profile.ProfileText, SortOrder = profile.SortOrder };
     return View(model);
 }
Esempio n. 2
0
 public ActionResult Edit(ProfileEdit profile)
 {
     if (!ModelState.IsValid)
         return View(profile);
     IProfileDAC dac = new ProfileDAC();
     dac.Update(profile.ProfileID, profile.Name, profile.ProfileText, profile.SortOrder);
     return RedirectToAction("Index");
 }
Esempio n. 3
0
        public ActionResult Create(ProfileCreate profile)
        {
            if (!ModelState.IsValid)
                return View(profile);

            IProfileDAC dac = new ProfileDAC();
            dac.Add(profile.Name, profile.ProfileText, profile.SortOrder);
            return RedirectToAction("Index");
        }
Esempio n. 4
0
 public ActionResult AddImage(HttpPostedFileBase file, int profileID)
 {
     if (file != null)
     {
         IProfileDAC dac = new ProfileDAC();
         var profile = dac.GetProfile(profileID);
         string path = System.IO.Path.Combine(Server.MapPath("~/SiteContent/Images/Band/"), profile.ImageName);
         file.SaveAs(path);
     }
     // after successfully uploading redirect the user
     return RedirectToAction("Index");
 }
Esempio n. 5
0
 // GET: Admin/Profiles
 public ActionResult Index()
 {
     IProfileDAC dac = new ProfileDAC();
     IList<Profile> profiles = dac.GetAll();
     return View(profiles);
 }
Esempio n. 6
0
 public ActionResult Delete(int id)
 {
     IProfileDAC dac = new ProfileDAC();
     dac.Delete(id);
     return RedirectToAction("Index");
 }