public ActionResult WallpaperList() { RewardsDTO wdto = new RewardsDTO(); wdto = _ipres.GetWallPaperList(); return(View(wdto)); }
public override RewardsDTO Edit_Wall(int id) { using (var context = new PHCEntities()) { try { RewardsDTO dto = new RewardsDTO(); Wallpaper wall = new Wallpaper(); wall = context.Wallpapers.Where(p => p.WID == id).SingleOrDefault(); if (wall != null) { dto.WID = wall.WID; dto.Title = wall.Title; dto.WallImage = wall.WallImage; } return(dto); } catch (Exception ex) { throw ex; } } }
public override string Update_Wall(RewardsDTO dto) { string msg = ""; using (var context = new PHCEntities()) { try { Wallpaper wall = new Wallpaper(); wall = context.Wallpapers.Where(p => p.WID == dto.WID).SingleOrDefault(); if (wall != null) { wall.Title = dto.Title; wall.WallImage = dto.WallImage; context.SaveChanges(); msg = "success"; } } catch (Exception ex) { msg = ex.Message; } } return(msg); }
public ActionResult EditWall(int id) { RewardsDTO dto = new RewardsDTO(); dto = _ichp.Edit_Wall(id); return(View(dto)); }
public override List <RewardsDTO> GetWall_list() { using (var context = new PHCEntities()) { List <RewardsDTO> ldto = new List <RewardsDTO>(); RewardsDTO dto = null; try { List <Wallpaper> bdg = new List <Wallpaper>(); bdg = context.Wallpapers.ToList(); if (bdg != null) { foreach (Wallpaper b in bdg) { dto = new RewardsDTO(); dto.WID = b.WID; dto.Title = b.Title; dto.WallImage = "~/Content/Uploads/Challenges/" + b.WallImage; ldto.Add(dto); } } } catch (Exception) { throw; } return(ldto); } }
public ActionResult Wallpaper(RewardsDTO dto, FormCollection frm) { if (ModelState.IsValid) { HttpPostedFileBase badgfile = Request.Files["upbadge"]; string WallpaperImage = UploadImg(badgfile); if (!string.IsNullOrEmpty(WallpaperImage)) { RewardsDTO adto = new RewardsDTO(); adto.Title = dto.Title; adto.WallImage = WallpaperImage; string msg = _ichp.Save_Wallpaper(adto); if (msg == "success") { TempData["Success"] = "Saved Successfully"; return(RedirectToAction("WallList")); } } } return(View()); }
public override string Save_Wallpaper(RewardsDTO adto) { string msg = ""; using (var context = new PHCEntities()) { try { Wallpaper bg = new Wallpaper(); bg.Title = adto.Title; bg.WallImage = adto.WallImage; context.AddToWallpapers(bg); context.SaveChanges(); msg = "success"; } catch (Exception ex) { msg = ex.Message; } return(msg); } }
public ActionResult EditWall(int id, RewardsDTO dto) { if (dto != null) { HttpPostedFileBase file = Request.Files["upbadge"]; string wall_img = dto.WallImage; if (Request.Files["upbadge"] != null && file.FileName != "") { wall_img = UploadImg(file); dto.WallImage = wall_img; } string msg = _ichp.Update_Wall(dto); if (msg == "success") { TempData["Success"] = "Updated Successfully"; return(RedirectToAction("WallList")); } } return(View(dto)); }
public string Update_Wall(RewardsDTO dto) { return(_ipres.Update_Wall(dto)); }
public string Save_Wallpaper(RewardsDTO adto) { return(_ipres.Save_Wallpaper(adto)); }
public abstract string Update_Wall(RewardsDTO dto);
public abstract string Save_Wallpaper(RewardsDTO adto);