public BdNotice GetCsEsmNoticeView(CsEsmNoticeModels getModel) { string errorStr = ""; BdNotice model = new BdNotice(); if (getModel.act_type != null && getModel.act_type == "updt") { string ViewQuery = " SELECT bn.SEQNO , esmU.EMAIL , " + string.Join(",", selectColoum_CsNotice) + " FROM bd_notice bn left outer join esm_user esmU on bn.WRITER_ID = esmU.SEQNO WHERE bn.SEQNO = " + getModel.act_key; DataTable listDt = getQueryResult(ViewQuery, out errorStr); if (listDt != null && listDt.Rows.Count != 0) { model.SEQNO = int.Parse(listDt.Rows[0]["SEQNO"].ToString().Trim()); //model.EST_CODE = listDt.Rows[0]["EST_CODE"].ToString().Trim(); model.WRITER_ID = int.Parse(listDt.Rows[0]["WRITER_ID"].ToString().Trim()); model.TITLE_CN = listDt.Rows[0]["TITLE_CN"].ToString().Trim(); model.TITLE_EN = listDt.Rows[0]["TITLE_EN"].ToString().Trim(); model.TITLE_KR = listDt.Rows[0]["TITLE_KR"].ToString().Trim(); model.CONTENTS_CN = listDt.Rows[0]["CONTENTS_CN"].ToString().Trim(); model.CONTENTS_EN = listDt.Rows[0]["CONTENTS_EN"].ToString().Trim(); model.CONTENTS_KR = listDt.Rows[0]["CONTENTS_KR"].ToString().Trim(); model.REGDATE = listDt.Rows[0]["REGDATE"].ToString().Trim(); //model.UP_DATE = listDt.Rows[0]["UP_DATE"].ToString().Trim(); //model.READ_NUM = int.Parse(listDt.Rows[0]["READ_NUM"].ToString().Trim()); //model.POPUP_DISPLAY = int.Parse(listDt.Rows[0]["POPUP_DISPLAY"].ToString().Trim()); //model.POPUP_START = listDt.Rows[0]["POPUP_START"].ToString().Trim(); //model.POPUP_END = listDt.Rows[0]["POPUP_END"].ToString().Trim(); //model.WEB_DISPLAY = int.Parse(listDt.Rows[0]["WEB_DISPLAY"].ToString().Trim()); model.BD_TYPE = int.Parse(listDt.Rows[0]["BD_TYPE"].ToString().Trim()); model.WRITER_NAME = listDt.Rows[0]["EMAIL"].ToString().Trim(); } } return(model); }
public ActionResult CsEsmNotice(CsEsmNoticeModels model) { //권한 체크=================================================== if (!chk.chkPermission("CsEsmNotice", "PER_SELECT")) { return(RedirectToAction("Index", "Home", new { msg = chk.alertStr })); } //=========================================================== model = act.GetCsEsmNoticeList(model); //리스트 가져오기 ViewData["pageing"] = comM.setPaging(model.Paging); //페이징 HTML 만들기 return(View(model)); }
// GET: Cs 고객센터 ETOMARS 공지 public ActionResult CsEsmNotice() { //권한 체크=================================================== if (!chk.chkPermission("CsEsmNotice", "PER_SELECT")) { return(RedirectToAction("Index", "Home", new { msg = chk.alertStr })); } //=========================================================== CsEsmNoticeModels model = new CsEsmNoticeModels(); //페이징 설정 초기화 model.Paging.page = 1; model.Paging.pageNum = 10; model.sortKey = "SEQNO"; //리스트 가져오기 model = act.GetCsEsmNoticeList(model); ViewData["pageing"] = comM.setPaging(model.Paging); //페이징 HTML 만들기 return(View(model)); }
public ActionResult CsEsmNoticeView(string seqNo) { //권한 체크=================================================== if (!chk.chkPermission("CsEsmNotice", "PER_SELECT")) { return(RedirectToAction("Index", "Home", new { msg = chk.alertStr })); } //=========================================================== CsEsmNoticeModels model = new CsEsmNoticeModels(); int pSeqNo = 0; if (int.TryParse(seqNo, out pSeqNo)) { model.act_type = "updt"; model.act_key = pSeqNo; } model.Item = act.GetCsEsmNoticeView(model); return(View(model)); }
public CsEsmNoticeModels GetCsEsmNoticeList(CsEsmNoticeModels model) { string errorStr = ""; string listQuery = " SELECT bn.SEQNO , esmU.EMAIL , " + string.Join(",", selectColoum_CsNotice); string cntQuery = " SELECT count(*) as cnt "; string baseQuery = " FROM bd_notice bn left outer join esm_user esmU on bn.WRITER_ID = esmU.SEQNO WHERE EST_CODE is Null "; if (!String.IsNullOrEmpty(model.schType)) //공지유형 { baseQuery += " AND bn.BD_TYPE = " + model.schType.Trim(); } if (!String.IsNullOrEmpty(model.schSdt)) //등록일자 (시작일) { baseQuery += " AND bn.REGDATE >= '" + model.schSdt.Trim() + "'"; } if (!String.IsNullOrEmpty(model.schEdt)) //등록일자 (종료일) { baseQuery += " AND bn.REGDATE <= '" + model.schEdt.Trim() + " 23:59:59'"; } if (!String.IsNullOrEmpty(model.schTypeTxt) && !String.IsNullOrEmpty(model.schTxt)) //검색조건 검색어 { baseQuery += " AND bn." + model.schTypeTxt.Trim() + " like '%" + model.schTxt.Trim() + "%' "; } string endQuery = " ORDER BY " + model.sortKey.ToString().Trim() + " DESC limit " + ((model.Paging.page - 1) * model.Paging.pageNum) + " , " + model.Paging.pageNum; //정렬 cntQuery += baseQuery; //토탈 카운트 쿼리 listQuery += baseQuery + endQuery; //리스트 쿼리 int totCnt = getQueryCnt(cntQuery, out errorStr); //전체 리스트 갯수 구하기 //model.Paging.pageTotNum = (totCnt / model.Paging.pageNum) + 1; //총 페이징 갯수 구하기 model.Paging.totCnt = totCnt; //전체 갯수 세팅 model.Paging.startCnt = totCnt - (model.Paging.pageNum * (model.Paging.page - 1)); //리스트 첫번째 시작 번호 model.Paging.pageTotNum = (totCnt / model.Paging.pageNum) + 1; //총 페이징 갯수 구하기 if ((totCnt % model.Paging.pageNum) == 0) { model.Paging.pageTotNum -= 1; //총 페이징 갯수가 0 일경우 + 1 } DataTable listDt = getQueryResult(listQuery, out errorStr); if (listDt != null && listDt.Rows.Count != 0) { for (int i = 0; i < listDt.Rows.Count; i++) { BdNotice temp = new BdNotice(); temp.SEQNO = int.Parse(listDt.Rows[i]["SEQNO"].ToString().Trim()); temp.WRITER_ID = int.Parse(listDt.Rows[i]["WRITER_ID"].ToString().Trim()); temp.TITLE_CN = listDt.Rows[i]["TITLE_CN"].ToString().Trim(); temp.TITLE_EN = listDt.Rows[i]["TITLE_EN"].ToString().Trim(); temp.TITLE_KR = listDt.Rows[i]["TITLE_KR"].ToString().Trim(); temp.CONTENTS_CN = listDt.Rows[i]["CONTENTS_CN"].ToString().Trim(); temp.CONTENTS_EN = listDt.Rows[i]["CONTENTS_EN"].ToString().Trim(); temp.CONTENTS_KR = listDt.Rows[i]["CONTENTS_KR"].ToString().Trim(); temp.REGDATE = listDt.Rows[i]["REGDATE"].ToString().Trim(); temp.BD_TYPE = int.Parse(listDt.Rows[i]["BD_TYPE"].ToString().Trim()); foreach (schTypeArray tempS in model.schTypeArray) { if (tempS.opt_value == listDt.Rows[i]["BD_TYPE"].ToString().Trim()) { temp.BD_TYPE = int.Parse(listDt.Rows[i]["BD_TYPE"].ToString().Trim()); temp.BD_TYPE_txt = tempS.opt_key; } } model.Items.Add(temp); } } return(model); }