public RedirectToRouteResult registerProc(TabletPromotion tabletPromotion) { HttpFileCollectionBase multipartfiles = Request.Files; tabletPromotion.regId = System.Web.HttpContext.Current.User.Identity.Name; tabletPromotionService.insertTabletPromotion(multipartfiles, tabletPromotion); return(RedirectToAction("list", (RouteValueDictionary)Session["searchMap"])); }
public RedirectToRouteResult modifyProc(TabletPromotion tabletPromotion) { HttpFileCollectionBase multipartRequest = Request.Files; tabletPromotion.uptId = System.Web.HttpContext.Current.User.Identity.Name; tabletPromotionService.updateTabletPromotion(multipartRequest, tabletPromotion); return(RedirectToAction("list", (RouteValueDictionary)Session["searchMap"])); }
public ActionResult modify(TabletPromotion tabletPromotion) { TabletPromotion item = tabletPromotionService.findTabletPromotion(tabletPromotion); ViewBag.item = item; ViewBag.thumbList = filesService.findAllByMasterIdxAndType(item.idx, "thumbNail"); ViewBag.bannerList = filesService.findAllByMasterIdxAndType(item.idx, "bannerImg"); IList <Files> mainImgList = filesService.findAllByMasterIdxAndType(item.idx, "mainImg"); ViewBag.mainImgList = mainImgList; return(View("~/Views/Promotion/TabletPromotion/modify.cshtml")); }
public ActionResult list(TabletPromotion tabletPromotion) { if (tabletPromotion.searchOption == null) { tabletPromotion.searchOption = "now"; } searchService.setSearchSession(Request, Session); searchService.setPagination(tabletPromotion, 6, tabletPromotionService.findAllCount(tabletPromotion)); ViewBag.list = tabletPromotionService.findAll(tabletPromotion); ViewBag.pagination = tabletPromotion; return(View("~/Views/Promotion/TabletPromotion/list.cshtml")); }
public void deleteTabletPromotion(TabletPromotion tabletPromotion) { try { Mapper.Instance().BeginTransaction(); this.tabletPromotionDao.deleteTabletPromotion(tabletPromotion); filesService.deleteRealFilesAndDataByFileMasterIdx(tabletPromotion.idx);//파일 삭제 Mapper.Instance().CommitTransaction(); } catch (Exception e) { Mapper.Instance().RollBackTransaction(); } }
public void updateTabletPromotion(HttpFileCollectionBase multipartFiles, TabletPromotion tabletPromotion) { validation(tabletPromotion); try { Mapper.Instance().BeginTransaction(); filesService.deleteFileAndFileUpload(multipartFiles, "thumbNail", "jpg|png", 5 * 1024 * 1024, tabletPromotion.idx, tabletPromotion.thumbIdxs); //섬네일 filesService.deleteFileAndFileUpload(multipartFiles, "bannerImg", "jpg|png", 5 * 1024 * 1024, tabletPromotion.idx, tabletPromotion.bannerIdxs); //띠배너 filesService.deleteFileAndFileUpload(multipartFiles, "mainImg", "jpg|png", 5 * 1024 * 1024, tabletPromotion.idx, tabletPromotion.mainIdxs); //메인이미지 this.tabletPromotionDao.updateTabletPromotion(tabletPromotion); Mapper.Instance().CommitTransaction(); } catch (Exception e) { Mapper.Instance().RollBackTransaction(); } }
private void validation(TabletPromotion tabletPromotion) { if (String.IsNullOrWhiteSpace(tabletPromotion.startDate)) { throw new CustomException("필수 값이 없습니다.(게시 시작일)"); } if (String.IsNullOrWhiteSpace(tabletPromotion.endDate)) { throw new CustomException("필수 값이 없습니다.(게시 종료일)"); } if (String.IsNullOrWhiteSpace(tabletPromotion.deployYn)) { throw new CustomException("필수 값이 없습니다.(배포 여부)"); } if (String.IsNullOrWhiteSpace(tabletPromotion.title)) { throw new CustomException("필수 값이 없습니다.(제목)"); } }
public void insertTabletPromotion(HttpFileCollectionBase multipartFiles, TabletPromotion tabletPromotion) { int masterIdx = sequenceService.getSequenceMasterIdx(); tabletPromotion.idx = masterIdx; validation(tabletPromotion); try { Mapper.Instance().BeginTransaction(); tabletPromotionDao.insertTabletPromotion(tabletPromotion); filesService.fileUpload(multipartFiles, "thumbNail", "jpg|png", 5 * 1024 * 1024, masterIdx, null); //섬네일 filesService.fileUpload(multipartFiles, "bannerImg", "jpg|png", 5 * 1024 * 1024, masterIdx, null); //띠배너 filesService.fileUpload(multipartFiles, "mainImg", "jpg|png", 5 * 1024 * 1024, masterIdx, null); //본문 Mapper.Instance().CommitTransaction(); } catch (Exception e) { Mapper.Instance().RollBackTransaction(); } }
public void insertTabletPromotion(TabletPromotion tabletPromotion) { Mapper.Instance().Insert("tabletPromotion.insertTabletPromotion", tabletPromotion); }
public int findAllCount(TabletPromotion tabletPromotion) { return(Mapper.Instance().QueryForObject <int>("tabletPromotion.findAllCount", tabletPromotion)); }
public TabletPromotion findTabletPromotion(TabletPromotion tabletPromotion) { return(Mapper.Instance().QueryForObject <TabletPromotion>("tabletPromotion.findTabletPromotion", tabletPromotion)); }
public TabletPromotion findTabletPromotion(TabletPromotion tabletPromotion) { return(this.tabletPromotionDao.findTabletPromotion(tabletPromotion)); }
public int findAllCount(TabletPromotion tabletPromotion) { return(this.tabletPromotionDao.findAllCount(tabletPromotion)); }
public IList <TabletPromotion> findAll(TabletPromotion tabletPromotion) { return(this.tabletPromotionDao.findAll(tabletPromotion)); }
public RedirectToRouteResult delete(TabletPromotion tabletPromotion) { tabletPromotionService.deleteTabletPromotion(tabletPromotion); return(RedirectToAction("list")); }
public IList <TabletPromotion> findAll(TabletPromotion tabletPromotion) { return(Mapper.Instance().QueryForList <TabletPromotion>("tabletPromotion.findAll", tabletPromotion)); }
public void updateTabletPromotion(TabletPromotion tabletPromotion) { Mapper.Instance().Update("tabletPromotion.updateTabletPromotion", tabletPromotion); }
public void deleteTabletPromotion(TabletPromotion tabletPromotion) { Mapper.Instance().Delete("tabletPromotion.deleteTabletPromotion", tabletPromotion); }