コード例 #1
0
        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"]));
        }
コード例 #2
0
        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"]));
        }
コード例 #3
0
        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"));
        }
コード例 #4
0
        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"));
        }
コード例 #5
0
 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();
     }
 }
コード例 #6
0
        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();
            }
        }
コード例 #7
0
 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("필수 값이 없습니다.(제목)");
     }
 }
コード例 #8
0
        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();
            }
        }
コード例 #9
0
ファイル: TabletPromotionDao.cs プロジェクト: suji1229/test
 public void insertTabletPromotion(TabletPromotion tabletPromotion)
 {
     Mapper.Instance().Insert("tabletPromotion.insertTabletPromotion", tabletPromotion);
 }
コード例 #10
0
ファイル: TabletPromotionDao.cs プロジェクト: suji1229/test
 public int findAllCount(TabletPromotion tabletPromotion)
 {
     return(Mapper.Instance().QueryForObject <int>("tabletPromotion.findAllCount", tabletPromotion));
 }
コード例 #11
0
ファイル: TabletPromotionDao.cs プロジェクト: suji1229/test
 public TabletPromotion findTabletPromotion(TabletPromotion tabletPromotion)
 {
     return(Mapper.Instance().QueryForObject <TabletPromotion>("tabletPromotion.findTabletPromotion", tabletPromotion));
 }
コード例 #12
0
 public TabletPromotion findTabletPromotion(TabletPromotion tabletPromotion)
 {
     return(this.tabletPromotionDao.findTabletPromotion(tabletPromotion));
 }
コード例 #13
0
 public int findAllCount(TabletPromotion tabletPromotion)
 {
     return(this.tabletPromotionDao.findAllCount(tabletPromotion));
 }
コード例 #14
0
 public IList <TabletPromotion> findAll(TabletPromotion tabletPromotion)
 {
     return(this.tabletPromotionDao.findAll(tabletPromotion));
 }
コード例 #15
0
 public RedirectToRouteResult delete(TabletPromotion tabletPromotion)
 {
     tabletPromotionService.deleteTabletPromotion(tabletPromotion);
     return(RedirectToAction("list"));
 }
コード例 #16
0
ファイル: TabletPromotionDao.cs プロジェクト: suji1229/test
 public IList <TabletPromotion> findAll(TabletPromotion tabletPromotion)
 {
     return(Mapper.Instance().QueryForList <TabletPromotion>("tabletPromotion.findAll", tabletPromotion));
 }
コード例 #17
0
ファイル: TabletPromotionDao.cs プロジェクト: suji1229/test
 public void updateTabletPromotion(TabletPromotion tabletPromotion)
 {
     Mapper.Instance().Update("tabletPromotion.updateTabletPromotion", tabletPromotion);
 }
コード例 #18
0
ファイル: TabletPromotionDao.cs プロジェクト: suji1229/test
 public void deleteTabletPromotion(TabletPromotion tabletPromotion)
 {
     Mapper.Instance().Delete("tabletPromotion.deleteTabletPromotion", tabletPromotion);
 }