6450. 관리자 홈 메뉴 내 필터링 기능
This commit is contained in:
parent
f044c66bde
commit
3d993bf121
|
|
@ -1,19 +1,27 @@
|
|||
using System;
|
||||
using NP.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
using NP.Model;
|
||||
|
||||
namespace NP.BO.Controllers
|
||||
{
|
||||
public class ccController : BOBaseController
|
||||
{
|
||||
private int jkBoardNo = 13; // // ST :21, LIVE : 13
|
||||
public ActionResult bms(NP.Model.VMCC vm)
|
||||
// ST :21, LIVE : 13
|
||||
private int jkBoardNo = 13;
|
||||
|
||||
/// <summary>
|
||||
/// 커뮤니케이션 > 게시판설정
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult bms(VMCC vm)
|
||||
{
|
||||
vm.BMs = InitM<BoardMaster>(); var ht = SetHash(vm);
|
||||
vm.BMs = InitM<BoardMaster>();
|
||||
|
||||
var ht = SetHash(vm);
|
||||
|
||||
if ("3".Equals(vm.stringval))
|
||||
{
|
||||
ht.Add("bmposition", 0);
|
||||
|
|
@ -23,18 +31,22 @@ namespace NP.BO.Controllers
|
|||
{
|
||||
ht.Add("bmposition", vm.stringval);
|
||||
}
|
||||
|
||||
ht.Add("bmtype", vm.stringval2);
|
||||
ht.Add("disptype", vm.stringval3);
|
||||
vm.stringval4 = vm.stringval4 ?? "bmname";
|
||||
ht.Add(vm.stringval4, vm.stringval5);
|
||||
vm.BMs = Dao.Get<BoardMaster>("board.bms", ht);
|
||||
vm.pagetotalcount = GetCount(vm.BMs.FirstOrDefault());
|
||||
|
||||
return View(vm);
|
||||
}
|
||||
public ActionResult bmr(NP.Model.VMCC vm)
|
||||
|
||||
public ActionResult bmr(VMCC vm)
|
||||
{
|
||||
vm.BM = new BoardMaster() { };
|
||||
vm.BMOs = new List<BoardMasterOpening>() { };
|
||||
|
||||
if (vm.intval > 0)
|
||||
{
|
||||
vm.BM = Dao.Get<BoardMaster>("board.bms", new System.Collections.Hashtable() { { "bmno", vm.intval } }).First();
|
||||
|
|
@ -43,6 +55,7 @@ namespace NP.BO.Controllers
|
|||
vm.BMOs = Dao.Get<BoardMasterOpening>("board.bmos", vm.BM.bmno);
|
||||
}
|
||||
}
|
||||
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
|
|
@ -67,9 +80,9 @@ namespace NP.BO.Controllers
|
|||
ht.Add("userid", vm.stringval4);
|
||||
ht.Add("sstime", vm.stringval5);
|
||||
ht.Add("setime", vm.stringval6);
|
||||
ht.Add("isallday", "1");
|
||||
/*Excellog excellog = new Excellog();*/
|
||||
ht.Add("isallday", "1");
|
||||
vm.excelloglook = Dao.Get<Excellog>("excellog.look", ht);
|
||||
|
||||
vm.pagetotalcount = GetCount(vm.excelloglook.FirstOrDefault());
|
||||
|
||||
return View(vm);
|
||||
|
|
@ -106,9 +119,16 @@ namespace NP.BO.Controllers
|
|||
}
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 커뮤니케이션 > 홈페이지게시판
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult homes(NP.Model.VMCC vm)
|
||||
{
|
||||
vm.Boards = InitM<Board>();
|
||||
|
||||
var ht = SetHash(vm);
|
||||
if (SUserInfo.IsSiteAdmin)
|
||||
{
|
||||
|
|
@ -119,21 +139,35 @@ namespace NP.BO.Controllers
|
|||
{
|
||||
vm.Assigns = Dao.Get<Assign>("users.assigns", new System.Collections.Hashtable() { { "issite", 1 } });
|
||||
}
|
||||
|
||||
vm.BMs = Dao.Get<BoardMaster>("board.bms", new System.Collections.Hashtable() { { "asno", vm.stringval }, { "bmposition", 0 }, { "isdefaults", string.IsNullOrEmpty(vm.stringval) ? "0,2" : "3" } });
|
||||
vm.BMOs = new List<BoardMasterOpening>() { };
|
||||
|
||||
if (!string.IsNullOrEmpty(vm.stringval2))
|
||||
{
|
||||
vm.BMOs = Dao.Get<BoardMasterOpening>("board.bmos", GetInt(vm.stringval2));
|
||||
}
|
||||
|
||||
ht.Add("asno", vm.stringval);
|
||||
ht.Add("bmno", vm.stringval2);
|
||||
ht.Add("opno", vm.stringval3);
|
||||
ht.Add("scc", vm.stringval4);
|
||||
ht.Add("bmposition", "0");
|
||||
|
||||
vm.Boards = Dao.Get<Board>("board.bs", ht);
|
||||
// stringval6 == "Y" => Home > 잔여 업무 요약 > 강의Q&A미답변 으로 접근일떄
|
||||
if (vm.stringval6 == "Y")
|
||||
{
|
||||
// 기존 쿼리로 조건절을 만들기엔 JOIN절의 의도를 파악하기가 어렵다.
|
||||
vm.Boards = Dao.Get<Board>("board.bsnoReplies", ht);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm.Boards = Dao.Get<Board>("board.bs", ht);
|
||||
}
|
||||
|
||||
|
||||
vm.pagetotalcount = GetCount(vm.Boards.FirstOrDefault());
|
||||
|
||||
if (vm.Boards.Count() > 0)
|
||||
{
|
||||
vm.Boards2 = Dao.Get<Board>("board.bcmt.cnt", new System.Collections.Hashtable() { { "bnos", string.Join(",", vm.Boards.Select(s => s.bno)) } });
|
||||
|
|
@ -142,6 +176,7 @@ namespace NP.BO.Controllers
|
|||
d.ccount = vm.Boards2.Where(w => w.bno == d.bno).First().ccount;
|
||||
}
|
||||
}
|
||||
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
|
|
@ -215,14 +250,17 @@ namespace NP.BO.Controllers
|
|||
{
|
||||
vm.Board = new Board() { isopen = 1 };
|
||||
}
|
||||
|
||||
if (SUserInfo.IsSiteAdmin)
|
||||
{
|
||||
vm.IsSiteAdmin = SUserInfo.IsSiteAdmin;
|
||||
}
|
||||
|
||||
vm.BMs = new List<BoardMaster>() { };
|
||||
vm.FileList = new List<File>() { };
|
||||
vm.BMOs = new List<BoardMasterOpening>() { };
|
||||
vm.BoardCMTs = new List<BoardCMT>() { };
|
||||
|
||||
if (vm.longval > 0 && vm.Board.pbno == null)
|
||||
{
|
||||
vm.Board = Dao.Get<Board>("board.get", vm.longval).First();
|
||||
|
|
@ -260,10 +298,18 @@ namespace NP.BO.Controllers
|
|||
vm.SCUserName = SUserInfo.UserName;
|
||||
return View(vm);
|
||||
}
|
||||
public ActionResult rooms(NP.Model.VMCC vm)
|
||||
|
||||
/// <summary>
|
||||
/// 커뮤니케이션 > 강의실게시판
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult rooms(VMCC vm)
|
||||
{
|
||||
vm.Boards = InitM<Board>();
|
||||
|
||||
var ht = SetHash(vm);
|
||||
|
||||
if (SUserInfo.IsTeacher)
|
||||
{
|
||||
vm.Terms = Dao.Get<Term>("cm.myterm", SUserInfo.UserNo);
|
||||
|
|
@ -272,7 +318,9 @@ namespace NP.BO.Controllers
|
|||
{
|
||||
vm.Terms = Dao.Get<Term>("cm.term.ys", new System.Collections.Hashtable() { });
|
||||
}
|
||||
|
||||
vm.CMs = new List<CM>() { };
|
||||
|
||||
if (!string.IsNullOrEmpty(vm.stringval2))
|
||||
{
|
||||
if (SUserInfo.IsTeacher)
|
||||
|
|
@ -284,18 +332,32 @@ namespace NP.BO.Controllers
|
|||
vm.CMs = Dao.Get<CM>("cm.cms", new System.Collections.Hashtable() { { "tmno", vm.stringval2 }, { "ismaster", 0 }, { "orderby", "d.cname,d.classno" } });
|
||||
}
|
||||
}
|
||||
|
||||
vm.BMs = Dao.Get<BoardMaster>("board.bms", new System.Collections.Hashtable() { { "bmposition", 1 } });
|
||||
|
||||
ht.Add("tyear", !string.IsNullOrEmpty(vm.stringval2) ? null : vm.stringval);
|
||||
ht.Add("tmno", !string.IsNullOrEmpty(vm.stringval3) ? null : vm.stringval2);
|
||||
ht.Add("cmno", vm.stringval3);
|
||||
ht.Add("bmno", vm.stringval4);
|
||||
ht.Add("scc", vm.stringval5);
|
||||
|
||||
if (SUserInfo.IsTeacher)
|
||||
{
|
||||
ht.Add("teacherno", SUserInfo.UserNo);
|
||||
}
|
||||
vm.Boards = Dao.Get<Board>("board.roombs", ht);
|
||||
|
||||
// stringval6 == "Y" => Home > 잔여 업무 요약 > 강의Q&A미답변 으로 접근일떄
|
||||
if (vm.stringval6 == "Y")
|
||||
{
|
||||
vm.Boards = Dao.Get<Board>("board.roombsnoReplies", ht);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm.Boards = Dao.Get<Board>("board.roombs", ht);
|
||||
}
|
||||
|
||||
vm.pagetotalcount = GetCount(vm.Boards.FirstOrDefault());
|
||||
|
||||
if (vm.Boards.Count() > 0)
|
||||
{
|
||||
vm.Boards2 = Dao.Get<Board>("board.bcmt.cnt", new System.Collections.Hashtable() { { "bnos", string.Join(",", vm.Boards.Select(s => s.bno)) } });
|
||||
|
|
@ -304,8 +366,10 @@ namespace NP.BO.Controllers
|
|||
d.ccount = vm.Boards2.Where(w => w.bno == d.bno).First().ccount;
|
||||
}
|
||||
}
|
||||
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
public ActionResult roomr(NP.Model.VMCC vm)
|
||||
{
|
||||
if (vm.Board != null && vm.Board.pbno != null)
|
||||
|
|
@ -323,9 +387,9 @@ namespace NP.BO.Controllers
|
|||
else
|
||||
{
|
||||
vm.Terms = Dao.Get<Term>("cm.term.ys", new System.Collections.Hashtable() { });
|
||||
}
|
||||
//vm.BMs = Dao.Get<BoardMaster>("board.bms", new System.Collections.Hashtable() { { "bmposition", 1 } });
|
||||
}
|
||||
}
|
||||
|
||||
vm.FileList = new List<File>() { };
|
||||
vm.BoardCMTs = new List<BoardCMT>() { };
|
||||
if (vm.longval > 0 && vm.Board.pbno == null)
|
||||
|
|
@ -346,22 +410,33 @@ namespace NP.BO.Controllers
|
|||
}
|
||||
vm.BoardCMTs = Dao.Get<BoardCMT>("board.boardcmts", vm.Board.bno);
|
||||
}
|
||||
|
||||
if (vm.Board.pbno != null)
|
||||
{
|
||||
vm.BoardP = Dao.Get<Board>("board.get", vm.Board.pbno.Value).First();
|
||||
}
|
||||
vm.SCUserName = SUserInfo.UserName;
|
||||
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 커뮤니케이션 > 메일
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult emails(NP.Model.VMCC vm)
|
||||
{
|
||||
vm.Emails = InitM<EmailSend>();
|
||||
vm.pagerowcount = 100;
|
||||
|
||||
var ht = SetHash(vm);
|
||||
vm.Emails = Dao.Get<EmailSend>("common.emailsends", ht);
|
||||
vm.pagetotalcount = GetCount(vm.Emails.FirstOrDefault());
|
||||
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
public ActionResult emailr(NP.Model.VMCC vm)
|
||||
{
|
||||
vm.Terms = Dao.Get<Term>("cm.term.ys", new System.Collections.Hashtable() { });
|
||||
|
|
@ -370,6 +445,12 @@ namespace NP.BO.Controllers
|
|||
vm.EmailSend = new EmailSend() { };
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 커뮤니케이션 > 쪽지
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult memos(NP.Model.VMCC vm)
|
||||
{
|
||||
vm.Memos = InitM<Memo>();
|
||||
|
|
@ -379,7 +460,8 @@ namespace NP.BO.Controllers
|
|||
vm.pagetotalcount = GetCount(vm.Memos.FirstOrDefault());
|
||||
return View(vm);
|
||||
}
|
||||
public ActionResult memosends(NP.Model.VMCC vm)
|
||||
|
||||
public ActionResult memosends(VMCC vm)
|
||||
{
|
||||
vm.Memos = InitM<Memo>();
|
||||
var ht = SetHash(vm);
|
||||
|
|
@ -394,6 +476,7 @@ namespace NP.BO.Controllers
|
|||
vm.pagetotalcount = GetCount(vm.Memos2.FirstOrDefault());
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
public ActionResult memosend(NP.Model.VMCC vm)
|
||||
{
|
||||
vm.Assigns = Dao.Get<Assign>("users.assigns", new System.Collections.Hashtable() { { "issite", 1 } });
|
||||
|
|
@ -409,6 +492,7 @@ namespace NP.BO.Controllers
|
|||
vm.userauths = Dao.Get<NP.Model.UserAuth>("sys.menu.auths", new System.Collections.Hashtable() { { "isall", 1 } });
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
public ActionResult memoview(NP.Model.VMCC vm)
|
||||
{
|
||||
ViewBag.PopupMenuName = "S".Equals(vm.sendorrcv) ? "보낸쪽지" : "받은쪽지";
|
||||
|
|
@ -420,7 +504,13 @@ namespace NP.BO.Controllers
|
|||
}
|
||||
return View(vm);
|
||||
}
|
||||
public ActionResult talks(NP.Model.VMCC vm)
|
||||
|
||||
/// <summary>
|
||||
/// 커뮤니케이션 > 알림톡
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult talks(VMCC vm)
|
||||
{
|
||||
vm.Memos = InitM<Memo>();
|
||||
var ht = SetHash(vm);
|
||||
|
|
@ -429,14 +519,16 @@ namespace NP.BO.Controllers
|
|||
vm.pagetotalcount = GetCount(vm.Memos.FirstOrDefault());
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
public ActionResult talkr(NP.Model.VMCC vm)
|
||||
{
|
||||
vm.Assigns = Dao.Get<Assign>("users.assigns", new System.Collections.Hashtable() { { "issite", 1 } });
|
||||
vm.Terms = Dao.Get<Term>("cm.term.ys", new System.Collections.Hashtable() { });
|
||||
//ViewBag.PopupMenuName = "알림톡 발송";
|
||||
vm.Terms = Dao.Get<Term>("cm.term.ys", new System.Collections.Hashtable() { });
|
||||
vm.Memo = new Memo() { };
|
||||
vm.userauths = Dao.Get<NP.Model.UserAuth>("sys.menu.auths", new System.Collections.Hashtable() { { "isall", 1 } });
|
||||
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,10 @@
|
|||
using System;
|
||||
using NP.Base.Popbill;
|
||||
using NP.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Web.Mvc;
|
||||
using NP.Model;
|
||||
using NP.Base.Popbill;
|
||||
using Popbill.Taxinvoice;
|
||||
using System.Collections;
|
||||
using Spring.Expressions;
|
||||
|
||||
namespace NP.BO.Controllers
|
||||
{
|
||||
|
|
@ -156,7 +153,8 @@ namespace NP.BO.Controllers
|
|||
if (vm.addstringval == "8")
|
||||
{
|
||||
ht.Add("statusin", "5,8,9");
|
||||
} else if (vm.addstringval == "3")
|
||||
}
|
||||
else if (vm.addstringval == "3")
|
||||
{
|
||||
ht.Add("statusin", "1,2,3,4");
|
||||
}
|
||||
|
|
@ -544,8 +542,8 @@ namespace NP.BO.Controllers
|
|||
if (vm.Lects.Any())
|
||||
{
|
||||
// cshapename가 이미 설정되어 있다. cshapename2에 cshapename의 앞 3글자만 저장
|
||||
vm.Lects.ToList().ForEach(i =>
|
||||
{
|
||||
vm.Lects.ToList().ForEach(i =>
|
||||
{
|
||||
i.cshapename2 = (!string.IsNullOrEmpty(i.cshapename) && i.cshapename.Length > 3) ? i.cshapename.Substring(0, 3) : i.cshapename;
|
||||
});
|
||||
}
|
||||
|
|
@ -813,7 +811,8 @@ namespace NP.BO.Controllers
|
|||
&& String.IsNullOrEmpty(vm.stringval9) && String.IsNullOrEmpty(vm.stringval10) && String.IsNullOrEmpty(vm.stringval11))
|
||||
{
|
||||
ht.Add("ustatus", 0);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
ht.Add("ustatus", 99);
|
||||
}
|
||||
|
|
@ -845,7 +844,8 @@ namespace NP.BO.Controllers
|
|||
// pms6473 => 엑셀다운로드에서 수료번호의 "제" 와 "호" 글자를 제거해달라는 요청
|
||||
if (vm.Lects.Any())
|
||||
{
|
||||
vm.Lects = vm.Lects.Select(x => {
|
||||
vm.Lects = vm.Lects.Select(x =>
|
||||
{
|
||||
x.completeno = (x.completeno != null) ? x.completeno.Replace("제", "").Replace("호", "") : "";
|
||||
return x;
|
||||
}).ToList();
|
||||
|
|
@ -866,14 +866,14 @@ namespace NP.BO.Controllers
|
|||
, "attrate", "ex1point", "sd0point", "tpointstr", "isoffabsstr", "rs0point"
|
||||
,"asname","addr","brno","eino","btype","bkind","ceoname","slevelName","uduty","mname","mphone"
|
||||
,"payamt","isrebatename","rbankamt","rbank","rbankaccnum","rbankuser","taxemail","association"
|
||||
,"pcgname","cgname","studyplacename","tyear", "iscompletename"
|
||||
,"pcgname","cgname","studyplacename","tyear", "iscompletename"
|
||||
}
|
||||
, vm.Lects
|
||||
, $"성적처리전체{DateTime.Now.Year}{DateTime.Now.Month}{DateTime.Now.Day}"
|
||||
, null
|
||||
, ",2,4"
|
||||
, vm.excellog);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -953,8 +953,8 @@ namespace NP.BO.Controllers
|
|||
public ActionResult atts(VMLect vm)
|
||||
{
|
||||
vm.Lect = Dao.Get<Lect>("lect.lects", new System.Collections.Hashtable() { { "lectno", vm.longval } }).First();
|
||||
vm.LectInningPages = Dao.Get<LectInningPage>("lect.lectinningpages", new System.Collections.Hashtable() { { "lectno", vm.Lect.lectno },{"isscd", 0} });
|
||||
|
||||
vm.LectInningPages = Dao.Get<LectInningPage>("lect.lectinningpages", new System.Collections.Hashtable() { { "lectno", vm.Lect.lectno }, { "isscd", 0 } });
|
||||
|
||||
// [이슈_602 / 박상완] 활동이력 탭에서 '검색' 시 데이터 로드 할 수 있도록 변경
|
||||
// 파라미터 userno 를 -1으로 변경
|
||||
// [이슈 404 오류] 첫 페이지 조회시 쿼리문 조회 불필요
|
||||
|
|
@ -995,13 +995,13 @@ namespace NP.BO.Controllers
|
|||
String pstatusall = null;
|
||||
if (vm.stringval3 != null)
|
||||
{
|
||||
pstatusall = " and ((p.pstatus in (" +vm.stringval3+") and (pr.rstatus is null or p.rstatus = 0))";
|
||||
pstatusall = " and ((p.pstatus in (" + vm.stringval3 + ") and (pr.rstatus is null or p.rstatus = 0))";
|
||||
}
|
||||
if (vm.stringval4 != null)
|
||||
{
|
||||
pstatusall = pstatusall == null ? "and ((pr.rfdno is not null and pr.rstatus = 0)" : (pstatusall + " or (pr.rfdno is not null and pr.rstatus = 0)");
|
||||
}
|
||||
if ((vm.stringval5??"").Contains("1"))
|
||||
if ((vm.stringval5 ?? "").Contains("1"))
|
||||
{
|
||||
pstatusall = pstatusall == null ? "and ((pi.rstatus=1 and p.payamt>p.refundamt)" : (pstatusall + " or (pi.rstatus=1 and p.payamt>p.refundamt)");
|
||||
}
|
||||
|
|
@ -1060,15 +1060,15 @@ namespace NP.BO.Controllers
|
|||
payItem.cmistudyplacename = vm.ComCodes.Where(w => w.cgroup.ToString() == "studyplace" && w.ccode == payItem.cmistudyplace).FirstOrDefault()?.cname;
|
||||
}
|
||||
|
||||
if(vm.excellog != null)
|
||||
if (vm.excellog != null)
|
||||
{
|
||||
vm.excellog.userno = SUserInfo.UserNo;
|
||||
vm.excellog.userip = GetUserIP();
|
||||
}
|
||||
|
||||
return ExportExcel(
|
||||
new String[] { "결제번호", "신청자이름", "ID","주민번호", "핸드폰", "회사명", "상품유형", "환급여부", "상품명", "결제금액", "결제방법", "입금금액", "환불금액", "신청일","신청일시", "입금일", "결제상태", "환급은행명", "환급계좌번호", "환급예금주", "교육장소", "강좌교육시작일", "강좌교육종료일", "신청교육장소", "교육종료일","기술인분류","교육구분","직무분야","등급","목적","수료여부" },
|
||||
new String[] { "payno", "username", "userid"," userpno", "mobile", "asname", "cshapename", "isrebatename", "itemname", "payamt", "pptypename", "payamt", "refundamt", "cdtymd","cdtymdhms", "payymd", "pstatusname2", "rbank", "rbankaccnum", "tbankuser", "studyplacename", "sdateymd", "edateymd", "cmistudyplacename", "cmiestartymd","tmname","edukind","tjname","tgname","tename", "completename" },
|
||||
new String[] { "결제번호", "신청자이름", "ID", "주민번호", "핸드폰", "회사명", "상품유형", "환급여부", "상품명", "결제금액", "결제방법", "입금금액", "환불금액", "신청일", "신청일시", "입금일", "결제상태", "환급은행명", "환급계좌번호", "환급예금주", "교육장소", "강좌교육시작일", "강좌교육종료일", "신청교육장소", "교육종료일", "기술인분류", "교육구분", "직무분야", "등급", "목적", "수료여부" },
|
||||
new String[] { "payno", "username", "userid", " userpno", "mobile", "asname", "cshapename", "isrebatename", "itemname", "payamt", "pptypename", "payamt", "refundamt", "cdtymd", "cdtymdhms", "payymd", "pstatusname2", "rbank", "rbankaccnum", "tbankuser", "studyplacename", "sdateymd", "edateymd", "cmistudyplacename", "cmiestartymd", "tmname", "edukind", "tjname", "tgname", "tename", "completename" },
|
||||
vm.PayItems,
|
||||
"ProductSales_" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day, null, null, vm.excellog);
|
||||
}
|
||||
|
|
@ -1078,7 +1078,7 @@ namespace NP.BO.Controllers
|
|||
{
|
||||
if (!IsPost())
|
||||
{
|
||||
LogSet(new ActLog() { logtype = 60, logtarget = 41, logdata = "결제번호: "+vm.payno, uno = SUserInfo.UserNo, uip = GetUserIP() });
|
||||
LogSet(new ActLog() { logtype = 60, logtarget = 41, logdata = "결제번호: " + vm.payno, uno = SUserInfo.UserNo, uip = GetUserIP() });
|
||||
}
|
||||
if (vm.isexamready == 1)
|
||||
{
|
||||
|
|
@ -1089,7 +1089,7 @@ namespace NP.BO.Controllers
|
|||
else
|
||||
{
|
||||
vm.Pay = Dao.Get<Pay>("cr.pay1", vm.payno).First();
|
||||
vm.PayItems = Dao.Get<PayItem>("cr.pay2", vm.payno);
|
||||
vm.PayItems = Dao.Get<PayItem>("cr.pay2", vm.payno);
|
||||
vm.Lect = Dao.Get<Lect>("lect.lects", new System.Collections.Hashtable() { { "payno", vm.payno } }).FirstOrDefault();
|
||||
ViewBag.JobTypeItems = "typejob40,typejob41,typejob42,typejob43,typejob44,typejob45,typejob46,typejob47,typejob48,typejob49,typejob57";
|
||||
vm.ComCodes = GetComCodes("typeman,typeedu,typegrade,typejob,studyplace," + ViewBag.JobTypeItems);
|
||||
|
|
@ -1100,13 +1100,13 @@ namespace NP.BO.Controllers
|
|||
vm.Lect.typegradename = vm.ComCodes.Where(w => w.cgroup.ToString() == "typegrade" && w.ccode == vm.Lect.typegrade).FirstOrDefault()?.cname;
|
||||
vm.Lect.typejobitemname = vm.ComCodes.Where(w => w.ccode == vm.Lect.typejobitem).FirstOrDefault()?.cname;
|
||||
vm.Lect.typejobname = vm.ComCodes.Where(w => w.cgroup.ToString() == "typejob" && w.ccode == vm.Lect.typejob).FirstOrDefault()?.cname;
|
||||
if(!string.IsNullOrEmpty(vm.Lect.studyplace)) vm.Lect.studyplacename = vm.ComCodes.Where(w => w.cgroup.ToString() == "studyplace" && w.ccode == int.Parse(vm.Lect.studyplace)).FirstOrDefault()?.cname;
|
||||
if (!string.IsNullOrEmpty(vm.Lect.studyplace)) vm.Lect.studyplacename = vm.ComCodes.Where(w => w.cgroup.ToString() == "studyplace" && w.ccode == int.Parse(vm.Lect.studyplace)).FirstOrDefault()?.cname;
|
||||
ViewBag.TestCode = TestCode;
|
||||
vm.CM = Dao.Get<CM>("cm.cm", new System.Collections.Hashtable() { { "cmno", vm.Lect.cmno } }).First();
|
||||
}
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
|
||||
public ActionResult payrefund(VMPay vm)
|
||||
{
|
||||
vm.Pay = Dao.Get<Pay>("cr.pay.forrfd", vm.payno).First();
|
||||
|
|
@ -1121,11 +1121,11 @@ namespace NP.BO.Controllers
|
|||
vm.PayRfds = Dao.Get<PayRfd>("cr.payrfditems2", vm.rfdno);
|
||||
vm.FileList = new List<File>() { };
|
||||
vm.FileList2 = new List<File>() { };
|
||||
if (vm.PayRfds != null && (vm.PayRfds.First().fgnor??0) > 0)
|
||||
if (vm.PayRfds != null && (vm.PayRfds.First().fgnor ?? 0) > 0)
|
||||
{
|
||||
vm.FileList = GetFiles(vm.PayRfds.First().fgnor.Value);
|
||||
}
|
||||
if (vm.PayRfds != null && (vm.PayRfds.First().fgnob??0) > 0)
|
||||
if (vm.PayRfds != null && (vm.PayRfds.First().fgnob ?? 0) > 0)
|
||||
{
|
||||
vm.FileList2 = GetFiles(vm.PayRfds.First().fgnob.Value);
|
||||
}
|
||||
|
|
@ -1138,18 +1138,27 @@ namespace NP.BO.Controllers
|
|||
vm.PayRfds = Dao.Get<PayRfd>("cr.payrfditems2", vm.rfdno);
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 교육운영 > 계산서요청
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult tax(VMCRoom vm)
|
||||
{
|
||||
var ht = SetHash(vm, false);
|
||||
if(vm.isexceldown != 1)
|
||||
|
||||
if (vm.isexceldown != 1)
|
||||
{
|
||||
vm.stringval11 = null;
|
||||
}
|
||||
|
||||
if (!IsPost())
|
||||
{
|
||||
vm.stringval6 = DateTime.Now.ToString("yyyy-MM-01");
|
||||
vm.stringval7 = Convert.ToDateTime(vm.stringval6).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
ht.Add("staxdatereq", vm.stringval6);
|
||||
ht.Add("etaxdatereq", string.IsNullOrEmpty(vm.stringval7) ? null : (vm.stringval7 + " 23:59:59"));
|
||||
ht.Add("cdts", vm.stringval);
|
||||
|
|
@ -1161,11 +1170,11 @@ namespace NP.BO.Controllers
|
|||
ht.Add("csdate", vm.stringval13);
|
||||
ht.Add("cedate", string.IsNullOrEmpty(vm.stringval14) ? null : (vm.stringval14 + " 23:59:59"));
|
||||
ht.Add("isreceipt", vm.stringval15);
|
||||
ht.Add("taxnos", vm.stringval11);
|
||||
|
||||
ht.Add("taxnos", vm.stringval11);
|
||||
if (!string.IsNullOrEmpty(vm.stringval3))
|
||||
{
|
||||
if(vm.stringval3 == "2")
|
||||
if (vm.stringval3 == "2")
|
||||
{
|
||||
ht.Add("iscancel", 1);
|
||||
}
|
||||
|
|
@ -1175,6 +1184,7 @@ namespace NP.BO.Controllers
|
|||
ht.Add("tstatus" + (vm.stringval3), 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(vm.stringval5))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(vm.stringval4))
|
||||
|
|
@ -1186,7 +1196,9 @@ namespace NP.BO.Controllers
|
|||
ht.Add("nimp", vm.stringval5);
|
||||
}
|
||||
}
|
||||
|
||||
vm.PayTaxes = Dao.Get<PayTax>("cr.paytaxes", ht);
|
||||
|
||||
if (vm.isexceldown == 1)
|
||||
{
|
||||
if (vm.excellog != null)
|
||||
|
|
@ -1198,25 +1210,35 @@ namespace NP.BO.Controllers
|
|||
return ExportExcel(
|
||||
new String[] {"결제번호","신청일","입금일","결제상태","이름","아이디","전화번호","강좌명","교육종료일","회사명","대표명","주소","사업자번호","업태","종목","담당자명","담당자연락처"
|
||||
,"계산서수신이메일","청구영수","발행요청금액","발행요청일","실제날짜","발행한날","발행상태"},
|
||||
new String[] {"payno","cdtymd", "payoktimeymd", "pstatusname2","username", "userid", "mobile", "itemname","eendymd", "asname", "ceoname","asaddr",
|
||||
new String[] {"payno","cdtymd", "payoktimeymd", "pstatusname2","username", "userid", "mobile", "itemname","eendymd", "asname", "ceoname","asaddr",
|
||||
"brno", "btype","bkind", "manname", "telno", "email", "isreceiptname", "taxamt", "taxdatereqymd","taxdateymd","realtaxdateymd","status"},
|
||||
vm.PayTaxes,
|
||||
"계산서요청"+DateTime.Now.ToString("yy.MM.dd"), null, null, vm.excellog);
|
||||
"계산서요청" + DateTime.Now.ToString("yy.MM.dd"),
|
||||
null,
|
||||
null,
|
||||
vm.excellog);
|
||||
}
|
||||
|
||||
vm.pagetotalcount = GetCount(vm.PayTaxes.FirstOrDefault());
|
||||
|
||||
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 교육운영 > 계산서요청 (상세)
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult taxdetail(VMCRoom vm)
|
||||
{
|
||||
if (vm.longval < 1 && vm.intval < 0 )
|
||||
if (vm.longval < 1 && vm.intval < 0)
|
||||
{
|
||||
return Redirect("/croom/tax");
|
||||
}
|
||||
if (vm.intval > 0)
|
||||
vm.PayTaxes = Dao.Get<PayTax>("cr.paytaxes", new System.Collections.Hashtable() { { "payno", vm.intval } });
|
||||
else
|
||||
vm.PayTaxes = Dao.Get<PayTax>("cr.paytaxes", new System.Collections.Hashtable() { { "taxno", vm.longval }});
|
||||
vm.PayTaxes = Dao.Get<PayTax>("cr.paytaxes", new System.Collections.Hashtable() { { "taxno", vm.longval } });
|
||||
vm.FileList = new List<File>() { };
|
||||
if (vm.PayTaxes.First().fgno != null)
|
||||
{
|
||||
|
|
@ -1229,13 +1251,13 @@ namespace NP.BO.Controllers
|
|||
vm.PayTaxItem = Dao.Get<PayItem>("cr.paytaxitem2", new System.Collections.Hashtable() { { "taxno", vm.longval } });
|
||||
|
||||
#region 세금계산서 Popbill 연동
|
||||
var payTax = vm.PayTaxes.First();
|
||||
var payTax = vm.PayTaxes.First();
|
||||
if (payTax != null)
|
||||
{
|
||||
{
|
||||
var result = PopbillService.GetTaxinvoice(payTax);
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
ViewBag.Taxinvoice = result.Data;
|
||||
ViewBag.Taxinvoice = result.Data;
|
||||
ViewBag.TaxinvoiceInfo = PopbillService.GetTaxinvoiceInfo(payTax).Data;
|
||||
|
||||
string[] popbillManager = GetConfig("popbillManager").Split(';');
|
||||
|
|
@ -1249,8 +1271,8 @@ namespace NP.BO.Controllers
|
|||
if (ViewBag.TaxinvoiceInfo != null && payTax.statecode == 0)
|
||||
{
|
||||
#region 세금계산서 상태코드 업데이트
|
||||
payTax.uno = SUserInfo.UserNo;
|
||||
payTax.uip = GetUserIP();
|
||||
payTax.uno = SUserInfo.UserNo;
|
||||
payTax.uip = GetUserIP();
|
||||
payTax.statecode = ViewBag.TaxinvoiceInfo.stateCode;
|
||||
Dao.Save("cr.paytax.save", payTax);
|
||||
#endregion
|
||||
|
|
@ -1393,7 +1415,7 @@ namespace NP.BO.Controllers
|
|||
vm.typejobs = Dao.Get<textvalue>("cr.documnetspasts.typejob", ht).ToList();
|
||||
vm.kinds = Dao.Get<textvalue>("cr.documnetspasts.kind", ht).ToList();
|
||||
List<textvalue> words = new List<textvalue>();
|
||||
words.Add(new textvalue { text = "이름", value = "이름"});
|
||||
words.Add(new textvalue { text = "이름", value = "이름" });
|
||||
words.Add(new textvalue { text = "주민등록번호", value = "주민등록번호" });
|
||||
words.Add(new textvalue { text = "수료번호", value = "수료번호" });
|
||||
words.Add(new textvalue { text = "업체명", value = "업체명" });
|
||||
|
|
@ -1409,9 +1431,9 @@ namespace NP.BO.Controllers
|
|||
ht.Add("typeedu", vm.stringval6);
|
||||
ht.Add("typegrade", vm.stringval7);
|
||||
ht.Add("typejob", vm.stringval8);
|
||||
vm.stringval9 = vm.stringval9 == null ? vm.stringval == null ? "2019-01-01 00:00:00" : vm.stringval + "-01-01 00:00:00" : vm.stringval9;
|
||||
vm.stringval9 = vm.stringval9 == null ? vm.stringval == null ? "2019-01-01 00:00:00" : vm.stringval + "-01-01 00:00:00" : vm.stringval9;
|
||||
vm.stringval10 = vm.stringval10 == null ? vm.stringval == null ? "2020-12-31 23:59:59" : vm.stringval + "-12-31 23:59:59" : vm.stringval10;
|
||||
ht.Add("ssdate", vm.stringval9);
|
||||
ht.Add("ssdate", vm.stringval9);
|
||||
ht.Add("sedate", vm.stringval10);
|
||||
switch (vm.stringval11)
|
||||
{
|
||||
|
|
@ -1424,7 +1446,7 @@ namespace NP.BO.Controllers
|
|||
ht.Add("text", vm.stringval12);
|
||||
vm.DocumentList = Dao.Get<Document>("cr.documnetspasts", ht);
|
||||
vm.pagetotalcount = GetCount(vm.DocumentList.FirstOrDefault());
|
||||
|
||||
|
||||
if (vm.isexceldown == 1)
|
||||
{
|
||||
if (vm.excellog != null)
|
||||
|
|
@ -1443,13 +1465,13 @@ namespace NP.BO.Controllers
|
|||
"ceoname","slevel","uduty","mname","mphone","sprice","rprice","rbank","rbankno","rbankuser","taxemail",
|
||||
"assign","userid","userid","userid","sctime","syear"},
|
||||
vm.DocumentList,
|
||||
"증빙서류출력(과거)",null,",0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38",vm.excellog);
|
||||
"증빙서류출력(과거)", null, ",0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38", vm.excellog);
|
||||
}
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
public ActionResult completions(VMCRoom vm)
|
||||
{
|
||||
{
|
||||
vm.Completions = InitM<Completion>();
|
||||
vm.CGs = Dao.Get<CG>("cm.cgs", new System.Collections.Hashtable() { { "isuse", 1 }, { "isdel", 0 } });
|
||||
ViewBag.JobTypeItems = "typejob40,typejob41,typejob42,typejob43,typejob44,typejob45,typejob46,typejob47,typejob48,typejob49,typejob57";
|
||||
|
|
@ -1462,24 +1484,24 @@ namespace NP.BO.Controllers
|
|||
ht.Add("cshape", vm.stringval4);
|
||||
ht.Add("typeman", vm.stringval5);
|
||||
ht.Add("studyplace", vm.stringval6);
|
||||
ht.Add("typejob", vm.stringval7);
|
||||
ht.Add("typejob", vm.stringval7);
|
||||
// 교육종료일
|
||||
ht.Add("edate1", vm.stringval8);
|
||||
ht.Add("edate2", vm.stringval9);
|
||||
|
||||
ht.Add("typegrade", vm.stringval10);
|
||||
ht.Add("typeedu", vm.stringval11);
|
||||
|
||||
ht.Add("typeedu", vm.stringval11);
|
||||
|
||||
vm.Completions = Dao.Get<Completion>("cr.completions", ht);
|
||||
vm.pagetotalcount = GetCount(vm.Completions.FirstOrDefault());
|
||||
foreach (var completion in vm.Completions)
|
||||
{
|
||||
completion.typeeduName = vm.ComCodes.Where(w=> w.ccode == completion.typeedu).FirstOrDefault()?.cname;
|
||||
completion.typeeduName = vm.ComCodes.Where(w => w.ccode == completion.typeedu).FirstOrDefault()?.cname;
|
||||
completion.typegradeName = vm.ComCodes.Where(w => w.ccode == completion.typegrade).FirstOrDefault()?.cname;
|
||||
completion.typejobName = vm.ComCodes.Where(w => w.ccode == completion.typejob).FirstOrDefault()?.cname;
|
||||
completion.typemanName = vm.ComCodes.Where(w => w.ccode == completion.typeman).FirstOrDefault()?.cname;
|
||||
completion.studyplaceName = vm.ComCodes.Where(w => w.ccode == completion.studyplace).FirstOrDefault()?.cname;
|
||||
if(completion.cshape == 2)
|
||||
if (completion.cshape == 2)
|
||||
{
|
||||
completion.sdate = completion.payoktime;
|
||||
completion.edate = completion.estart;
|
||||
|
|
@ -1510,7 +1532,8 @@ namespace NP.BO.Controllers
|
|||
|
||||
if (vm.Completions.Any())
|
||||
{
|
||||
vm.Completions = vm.Completions.Select(x => {
|
||||
vm.Completions = vm.Completions.Select(x =>
|
||||
{
|
||||
x.completeno = (x.completeno != null) ? x.completeno.Replace("제", "").Replace("호", "") : "";
|
||||
return x;
|
||||
}).ToList();
|
||||
|
|
@ -1526,7 +1549,7 @@ namespace NP.BO.Controllers
|
|||
"ceoname","slevelName","uduty","mname","mphone","payamt","rbankamt","rbank","rbankaccnum","rbankuser","taxemail",
|
||||
"association","pcgname", "cgname", "studyplaceName","studytime","tyear"},
|
||||
vm.Completions,
|
||||
"수료관리", null, ",0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38",vm.excellog);
|
||||
"수료관리", null, ",0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38", vm.excellog);
|
||||
}
|
||||
return View(vm);
|
||||
}
|
||||
|
|
@ -1536,4 +1559,4 @@ namespace NP.BO.Controllers
|
|||
return View(vm);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
@model NP.Model.VMHome
|
||||
<!-- 잔여업무 요약 -->
|
||||
<section class="panel panel-default">
|
||||
<header class="panel-heading"><strong><i class="fa fa-bars"></i> 잔여 업무 요약<span class=""></span></strong></header>
|
||||
<div class="table-responsive" id="excel1">
|
||||
|
|
@ -15,17 +16,19 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="link text-center @(Model.Data.intval > 0 ? "emphasis":"")"><a href="/cc/memos">@Model.Data.intval.ToString("#,0") 건</a></td>
|
||||
<td class="link text-center @(Model.Data.intval2 > 0 ? "emphasis":"")"><a href="/cc/homes">@Model.Data.intval2.ToString("#,0") 건</a></td>
|
||||
<td class="link text-center @(Model.Data.intval3 > 0 ? "emphasis":"")"><a href="/cc/rooms">@Model.Data.intval3.ToString("#,0") 건</a></td>
|
||||
<td class="link text-center @(Model.Data.intval4 > 0 ? "emphasis":"")"><a href="/croom/pay">@Model.Data.intval4.ToString("#,0") 건</a></td>
|
||||
<td class="link text-center @(Model.Data.intval > 0 ? "emphasis":"")"><a href="javascript:taskSummaryPendingLink(1);">@Model.Data.intval.ToString("#,0") 건</a></td>
|
||||
<td class="link text-center @(Model.Data.intval2 > 0 ? "emphasis":"")"><a href="javascript:taskSummaryPendingLink(2);">@Model.Data.intval2.ToString("#,0") 건</a></td>
|
||||
<td class="link text-center @(Model.Data.intval3 > 0 ? "emphasis":"")"><a href="javascript:taskSummaryPendingLink(3);">@Model.Data.intval3.ToString("#,0") 건</a></td>
|
||||
<td class="link text-center @(Model.Data.intval4 > 0 ? "emphasis":"")"><a href="javascript:taskSummaryPendingLink(4);">@Model.Data.intval4.ToString("#,0") 건</a></td>
|
||||
@*<td class="link text-center @(Model.Data.intval5 > 0 ? "emphasis":"")"><a href="/croom/deliveries">@Model.Data.intval5.ToString("#,0") 건</a></td>*@
|
||||
<td class="link text-center @(Model.Data.intval6 > 0 ? "emphasis":"")"><a href="/croom/tax">@Model.Data.intval6.ToString("#,0") 건</a></td>
|
||||
<td class="link text-center @(Model.Data.intval6 > 0 ? "emphasis":"")"><a href="javascript:taskSummaryPendingLink(5);">@Model.Data.intval6.ToString("#,0") 건</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- // 잔여업무 요약 -->
|
||||
<!-- 운영중인 강의 -->
|
||||
<section class="panel panel-default">
|
||||
<header class="panel-heading"><strong><i class="fa fa-bars"></i> 운영중인 강의<span class=""></span></strong></header>
|
||||
<div style="padding: 8px 10px;">@Html.Partial("./Partial/Text", Model.stringval, Helpers.DicText(new NP.Model.TextDic() { Name = "stringval", Value = Model.stringval, PH = "강좌명을 입력하시고 Enter키를 입력하세요.", CssClass = "ff" }))</div>
|
||||
|
|
@ -44,29 +47,34 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody1">
|
||||
@foreach (var d in Model.CMs)
|
||||
{
|
||||
<tr>
|
||||
<td>@d.tmname</td>
|
||||
<td>@d.cgname</td>
|
||||
<td>@d.cshapename</td>
|
||||
<td class="text-left">@d.cnameclassno</td>
|
||||
<td>@d.sssename</td>
|
||||
<td><a href="#" onclick="golink(0, @d.cmno)" class="btn btn-xxs btn-select">강좌관리</a></td>
|
||||
<td><a href="#" onclick="golink(1, @d.cmno)" class="btn btn-xxs btn-info">신청관리</a></td>
|
||||
<td><a href="#" onclick="golink(2, @d.cmno)" class="btn btn-xxs btn-primary">성적관리</a></td>
|
||||
</tr>
|
||||
}
|
||||
@foreach (var d in Model.CMs)
|
||||
{
|
||||
<tr>
|
||||
<td>@d.tmname</td>
|
||||
<td>@d.cgname</td>
|
||||
<td>@d.cshapename</td>
|
||||
<td class="text-left">@d.cnameclassno</td>
|
||||
<td>@d.sssename</td>
|
||||
<td><a href="javascript:;" onclick="golink(0, @d.cmno)" class="btn btn-xxs btn-select">강좌관리</a></td>
|
||||
<td><a href="javascript:;" onclick="golink(1, @d.cmno)" class="btn btn-xxs btn-info">신청관리</a></td>
|
||||
<td><a href="javascript:;" onclick="golink(2, @d.cmno)" class="btn btn-xxs btn-primary">성적관리</a></td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- // 운영중인 강의 -->
|
||||
<form id="mform" method="post">
|
||||
<input type="hidden" name="intval" id="intval" />
|
||||
</form>
|
||||
@section styles{
|
||||
<style type="text/css">
|
||||
.link.emphasis a{font-weight: bold; color: red !important;font-size: 13px !important;}
|
||||
.link.emphasis a {
|
||||
font-weight: bold;
|
||||
color: red !important;
|
||||
font-size: 13px !important;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
@section scriptsHeader{
|
||||
|
|
@ -74,18 +82,20 @@
|
|||
}
|
||||
@section scripts{
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(document).ready(function () {
|
||||
if ('@(ViewBag.SSPWC)' == 'True') {
|
||||
showramemainlayer('/user/pwchange');
|
||||
$("#mainlayerframe").css("width", "520px");
|
||||
$("#mainlayerframe").css("height", "520px");
|
||||
}
|
||||
});
|
||||
$("#stringval").on('keydown', function(e) {
|
||||
|
||||
$("#stringval").on('keydown', function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
capp("/acommon/cmget", {ismaster:0, cname: val("stringval"), iscurrent:1,orderby : "a.setime desc, t.tyear desc,t.tseq desc,a.cname,a.classno"}, "cbget");
|
||||
capp("/acommon/cmget", { ismaster: 0, cname: val("stringval"), iscurrent: 1, orderby: "a.setime desc, t.tyear desc,t.tseq desc,a.cname,a.classno" }, "cbget");
|
||||
}
|
||||
});
|
||||
|
||||
function cbget() {
|
||||
$("#tbody1").find("tr").remove();
|
||||
if (capResult.obj.length > 0) {
|
||||
|
|
@ -99,6 +109,7 @@
|
|||
msg("결과가 없습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
function golink(idx, no) {
|
||||
if (idx == 0) {
|
||||
setv("intval", no);
|
||||
|
|
@ -114,5 +125,39 @@
|
|||
submit();
|
||||
}
|
||||
}
|
||||
|
||||
@*
|
||||
/* 잔여업무 요약 클릭 시 링크
|
||||
* @param {string} tabNo - 탭 번호 (1: 미열람쪽지, 2: 홈페이지Q&A미답변, 3: 강의Q&A미답변, 4: 환불요청, 5: 계산서미확인)
|
||||
* */
|
||||
*@
|
||||
function taskSummaryPendingLink(tabNo) {
|
||||
switch (tabNo) {
|
||||
case 1:
|
||||
window.location.href = "/cc/memos";
|
||||
break;
|
||||
case 2:
|
||||
var p = {};
|
||||
p.stringval6 = 'Y';
|
||||
postSubmit('/cc/homes', p);
|
||||
break;
|
||||
case 3:
|
||||
var p = {};
|
||||
p.stringval6 = 'Y';
|
||||
postSubmit('/cc/rooms', p);
|
||||
break;
|
||||
case 4:
|
||||
window.location.href = "/croom/pay";
|
||||
break;
|
||||
case 5:
|
||||
var p = {};
|
||||
p.stringval6 = '';
|
||||
p.stringval7 = '';
|
||||
p.stringval12 = '0';
|
||||
postSubmit('/croom/tax', p);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
}
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
@RenderSection("stylecdn", required: false)
|
||||
@Scripts.Render("~/bundles/jquery")
|
||||
@Scripts.Render("~/bundles/scripts")
|
||||
<script src="/js/site.js?v=250402"></script>
|
||||
<script src="/js/site.js?v=250410"></script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="/js/ie/html5shiv.js"></script>
|
||||
<script src="/js/ie/respond.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
}
|
||||
<div>
|
||||
<ul class="pagination pagination-md" style="margin: 0;">
|
||||
<li class="active"><a href="#" data-toggle="tab">요청현황</a></li>
|
||||
<li class="active"><a href="#" data-toggle="tab">요청현황</a></li>
|
||||
@*<li><a href="#" onclick="gotab();" data-toggle="tab">스마트빌</a></li>*@
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1679,6 +1679,92 @@ function cbeditorupload() {
|
|||
$(_uploadeditorimageitem).summernote('editor.insertImage', _uploadeditorimagertn.obj.uri);
|
||||
}
|
||||
}
|
||||
|
||||
/* Post방식으로 동적폼을 생성하여 Submit
|
||||
* parameter :
|
||||
* url : action URL
|
||||
* parameters : JSON Object
|
||||
* target : 대상페이지 형태 (생략가능, '_blank', '_self')
|
||||
* Exec :
|
||||
* var p = {};
|
||||
* p.userid = 'kim09';
|
||||
* p.hakbunID = 'S000000001';
|
||||
*
|
||||
* postSubmit('/home/index', p);
|
||||
* */
|
||||
function postSubmit(url, parameters, target) {
|
||||
if (typeof (parameters) === 'string') {
|
||||
parameters = queryToJSON(parameters);
|
||||
}
|
||||
else if (parameters === undefined || parameters === null) {
|
||||
parameters = {};
|
||||
}
|
||||
|
||||
// _hiddenPostForm 이 존재하면 제거
|
||||
var existingForm = document.getElementById('__hiddenPostForm');
|
||||
if (existingForm) {
|
||||
existingForm.remove();
|
||||
}
|
||||
|
||||
// 새로운 form 요소 생성
|
||||
var form = document.createElement('form');
|
||||
form.id = '__hiddenPostForm';
|
||||
form.action = url;
|
||||
form.method = 'post';
|
||||
form.target = (target === null || target === undefined) ? '_self' : target;
|
||||
|
||||
// parameters 처리
|
||||
if (parameters !== null) {
|
||||
for (var key in parameters) {
|
||||
if (parameters.hasOwnProperty(key)) {
|
||||
var input = document.createElement('input');
|
||||
input.type = 'hidden';
|
||||
input.value = parameters[key];
|
||||
input.name = key;
|
||||
input.id = key;
|
||||
form.appendChild(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// form을 body에 추가
|
||||
document.body.appendChild(form);
|
||||
|
||||
// form 제출
|
||||
form.submit();
|
||||
}
|
||||
|
||||
/* GetQuery 문자열을 JSON으로 변환
|
||||
* parameter :
|
||||
* query : URL의 쿼리스트링 (studentcode=S123456&id=kim01&grade=4)
|
||||
* Exec :
|
||||
* queryToJSON('studentcode=S123456&id=kim01&grade=4')
|
||||
* Return :
|
||||
* {studentcode: "S123456", id: "kim01", grade: "4"}
|
||||
* */
|
||||
function queryToJSON(query) {
|
||||
// URL에서 '?' 제거
|
||||
query = query.replace('?', '');
|
||||
|
||||
// '&'로 분리하여 키-값 쌍 배열 생성
|
||||
var keyValueParts = query.split('&');
|
||||
var jsonResult = {};
|
||||
|
||||
// 각 키-값 쌍에 대해 반복 처리
|
||||
for (var i = 0; i < keyValueParts.length; i++) {
|
||||
// '='로 나누어 키와 값을 분리
|
||||
var keyValue = keyValueParts[i].split('=');
|
||||
var key = keyValue[0];
|
||||
var value = keyValue.length > 1 ? decodeURIComponent(keyValue[1]) : ''; // 값이 없으면 빈 문자열로 처리
|
||||
|
||||
// 결과 객체에 키-값 추가
|
||||
jsonResult[key] = value;
|
||||
}
|
||||
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
|
||||
var focusoutobj;
|
||||
$(document).ready(function () {
|
||||
//$("").on("click", hideFindCode);
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@
|
|||
<Compile Include="Filter\AuthFilter.cs" />
|
||||
<Compile Include="Lib\ENUM.cs" />
|
||||
<Compile Include="Lib\Excel2Entity.cs" />
|
||||
<Compile Include="Lib\IPUtility.cs" />
|
||||
<Compile Include="Lib\KISA256.cs" />
|
||||
<Compile Include="Lib\Logger.cs" />
|
||||
<Compile Include="Lib\Logging.cs" />
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ using OfficeOpenXml;
|
|||
using System.Collections;
|
||||
using System.Net.Mail;
|
||||
using System.Net;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace NP.Base
|
||||
{
|
||||
|
|
@ -106,6 +107,7 @@ namespace NP.Base
|
|||
{
|
||||
MENUS = null;
|
||||
}
|
||||
|
||||
public string GetUserIP()
|
||||
{
|
||||
string ipAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
|
||||
|
|
@ -123,6 +125,8 @@ namespace NP.Base
|
|||
}
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
|
||||
string EncKey = "YNP.net";
|
||||
/// <summary>
|
||||
/// AES to Base64 암호화
|
||||
|
|
|
|||
|
|
@ -0,0 +1,396 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NP.Base.Lib
|
||||
{
|
||||
/// <summary>
|
||||
/// IP 주소 획득 유틸리티 클래스
|
||||
/// </summary>
|
||||
public static class IPUtility
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 클라이언트의 실제 IP 주소를 가져옵니다.
|
||||
/// 컨트롤러나 Razor 뷰 어디서든 호출 가능합니다.
|
||||
/// </summary>
|
||||
/// <returns>클라이언트 IP 주소</returns>
|
||||
public static string GetUserIP()
|
||||
{
|
||||
// 현재 HttpContext 가져오기 (컨트롤러나 Razor 뷰 모두에서 동작)
|
||||
HttpContextBase httpContext = GetCurrentContext();
|
||||
|
||||
if (httpContext == null)
|
||||
{
|
||||
return "0.0.0.0"; // HttpContext를 얻을 수 없는 경우
|
||||
}
|
||||
|
||||
return GetUserIPFromContext(httpContext);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 주어진 HttpContext에서 클라이언트 IP를 추출합니다.
|
||||
/// </summary>
|
||||
/// <param name="httpContext">HttpContext 객체</param>
|
||||
/// <returns>클라이언트 IP 주소</returns>
|
||||
public static string GetUserIPFromContext(HttpContextBase httpContext)
|
||||
{
|
||||
if (httpContext == null)
|
||||
return "0.0.0.0";
|
||||
|
||||
// IP를 수집할 리스트
|
||||
List<string> potentialIPs = new List<string>();
|
||||
|
||||
// 1. 모든 서버 변수 확인
|
||||
string[] headerKeys = new[]
|
||||
{
|
||||
"HTTP_X_FORWARDED_FOR",
|
||||
"X-Forwarded-For",
|
||||
"HTTP_X_REAL_IP",
|
||||
"X-Real-IP",
|
||||
"HTTP_CLIENT_IP",
|
||||
"HTTP_X_FORWARDED",
|
||||
"HTTP_X_CLUSTER_CLIENT_IP",
|
||||
"HTTP_FORWARDED_FOR",
|
||||
"HTTP_FORWARDED",
|
||||
"HTTP_VIA",
|
||||
"Proxy-Client-IP",
|
||||
"WL-Proxy-Client-IP",
|
||||
"CF-Connecting-IP", // Cloudflare
|
||||
"True-Client-IP", // Akamai, Cloudflare
|
||||
"X-Client-IP",
|
||||
"REMOTE_ADDR"
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
// 서버 변수에서 IP 확인
|
||||
foreach (string key in headerKeys)
|
||||
{
|
||||
try
|
||||
{
|
||||
string headerValue = httpContext.Request.ServerVariables[key];
|
||||
|
||||
if (!string.IsNullOrEmpty(headerValue))
|
||||
{
|
||||
// 쉼표로 구분된 여러 IP 처리
|
||||
string[] addresses = headerValue.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (string address in addresses)
|
||||
{
|
||||
string trimmedIP = address.Trim();
|
||||
if (!string.IsNullOrEmpty(trimmedIP))
|
||||
{
|
||||
potentialIPs.Add(trimmedIP);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 특정 서버 변수에 접근할 수 없는 경우 계속 진행
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Headers 컬렉션에서 확인
|
||||
foreach (string key in headerKeys)
|
||||
{
|
||||
try
|
||||
{
|
||||
var headerValue = httpContext.Request.Headers[key];
|
||||
|
||||
if (!string.IsNullOrEmpty(headerValue))
|
||||
{
|
||||
string[] addresses = headerValue.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (string address in addresses)
|
||||
{
|
||||
string trimmedIP = address.Trim();
|
||||
if (!string.IsNullOrEmpty(trimmedIP))
|
||||
{
|
||||
potentialIPs.Add(trimmedIP);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 특정 헤더에 접근할 수 없는 경우 계속 진행
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 3. UserHostAddress 확인
|
||||
try
|
||||
{
|
||||
string userHostAddress = httpContext.Request.UserHostAddress;
|
||||
if (!string.IsNullOrEmpty(userHostAddress))
|
||||
{
|
||||
potentialIPs.Add(userHostAddress);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// UserHostAddress에 접근할 수 없는 경우 무시
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// 전체 처리 중 예외 발생 시 기본값 반환
|
||||
return "0.0.0.0";
|
||||
}
|
||||
|
||||
// 수집된 IP 검증 및 필터링
|
||||
foreach (string ip in potentialIPs)
|
||||
{
|
||||
// 유효한 IP 확인
|
||||
if (IsValidClientIP(ip))
|
||||
{
|
||||
return ip;
|
||||
}
|
||||
}
|
||||
|
||||
// 기본 IP (아무것도 찾지 못한 경우)
|
||||
return "0.0.0.0";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 현재 HttpContext를 가져옵니다.
|
||||
/// 컨트롤러와 Razor 뷰 모두에서 동작합니다.
|
||||
/// </summary>
|
||||
/// <returns>현재 HttpContext</returns>
|
||||
private static HttpContextBase GetCurrentContext()
|
||||
{
|
||||
// 컨트롤러 또는 Razor 뷰에서 접근 가능한 현재 HttpContext 가져오기
|
||||
if (HttpContext.Current != null)
|
||||
{
|
||||
return new HttpContextWrapper(HttpContext.Current);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IP 주소가 유효한지 확인합니다.
|
||||
/// </summary>
|
||||
/// <param name="ip">확인할 IP 주소</param>
|
||||
/// <returns>유효한 경우 true, 그렇지 않으면 false</returns>
|
||||
private static bool IsValidClientIP(string ip)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ip))
|
||||
return false;
|
||||
|
||||
// 알려진 특수 IP 처리
|
||||
if (ip.ToLower() == "unknown")
|
||||
return false;
|
||||
|
||||
// 로컬 IP 허용 여부 (필요에 따라 수정)
|
||||
if (ip == "::1" || ip == "127.0.0.1")
|
||||
return true;
|
||||
|
||||
// 프라이빗 IP 필터링 여부 (필요에 따라 수정)
|
||||
if (IsPrivateIP(ip))
|
||||
return true; // 프라이빗 IP 허용
|
||||
|
||||
// 표준 IP 형식 검증
|
||||
IPAddress address;
|
||||
if (!IPAddress.TryParse(ip, out address))
|
||||
return false;
|
||||
|
||||
// IP 기본 검증 - 비어있는 주소 거부
|
||||
byte[] bytes = address.GetAddressBytes();
|
||||
if (bytes.All(b => b == 0))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 주어진 IP가 프라이빗 IP인지 확인합니다.
|
||||
/// </summary>
|
||||
/// <param name="ipAddress">확인할 IP 주소</param>
|
||||
/// <returns>프라이빗 IP인 경우 true, 그렇지 않으면 false</returns>
|
||||
private static bool IsPrivateIP(string ipAddress)
|
||||
{
|
||||
try
|
||||
{
|
||||
// IP 파싱
|
||||
IPAddress address;
|
||||
if (!IPAddress.TryParse(ipAddress, out address))
|
||||
return false;
|
||||
|
||||
// IPv4 프라이빗 주소 범위 확인
|
||||
if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
|
||||
{
|
||||
byte[] bytes = address.GetAddressBytes();
|
||||
|
||||
// 10.0.0.0/8
|
||||
if (bytes[0] == 10)
|
||||
return true;
|
||||
|
||||
// 172.16.0.0/12
|
||||
if (bytes[0] == 172 && bytes[1] >= 16 && bytes[1] <= 31)
|
||||
return true;
|
||||
|
||||
// 192.168.0.0/16
|
||||
if (bytes[0] == 192 && bytes[1] == 168)
|
||||
return true;
|
||||
|
||||
// 169.254.0.0/16 (링크-로컬)
|
||||
if (bytes[0] == 169 && bytes[1] == 254)
|
||||
return true;
|
||||
}
|
||||
|
||||
// IPv6 프라이빗 주소 체크
|
||||
else if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
|
||||
{
|
||||
// IPv6 로컬 주소 확인 (fc00::/7)
|
||||
byte[] bytes = address.GetAddressBytes();
|
||||
return (bytes[0] & 0xFE) == 0xFC;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 외부 API를 사용하여 공인 IP 주소를 가져옵니다.
|
||||
/// </summary>
|
||||
/// <returns>공인 IP 주소</returns>
|
||||
public static string GetPublicIP()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 여러 IP 확인 서비스 목록
|
||||
string[] ipServices = new[]
|
||||
{
|
||||
"https://api.ipify.org",
|
||||
"https://icanhazip.com",
|
||||
"https://ipinfo.io/ip",
|
||||
"https://checkip.amazonaws.com",
|
||||
"https://wtfismyip.com/text"
|
||||
};
|
||||
|
||||
foreach (string service in ipServices)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var client = new WebClient())
|
||||
{
|
||||
string ip = client.DownloadString(service).Trim();
|
||||
|
||||
// IP 형식 검증
|
||||
if (IsValidIPFormat(ip))
|
||||
{
|
||||
return ip;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 한 서비스가 실패하면 다음 서비스 시도
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return "IP 확인 실패";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "오류: " + ex.Message;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 비동기 방식으로 공인 IP 주소를 가져옵니다.
|
||||
/// </summary>
|
||||
/// <returns>공인 IP 주소</returns>
|
||||
public static async Task<string> GetPublicIPAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 여러 IP 확인 서비스 목록
|
||||
string[] ipServices = new[]
|
||||
{
|
||||
"https://api.ipify.org",
|
||||
"https://icanhazip.com",
|
||||
"https://ipinfo.io/ip",
|
||||
"https://checkip.amazonaws.com",
|
||||
"https://wtfismyip.com/text"
|
||||
};
|
||||
|
||||
foreach (string service in ipServices)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.Timeout = TimeSpan.FromSeconds(3); // 3초 타임아웃
|
||||
string ip = (await client.GetStringAsync(service)).Trim();
|
||||
|
||||
// IP 형식 검증
|
||||
if (IsValidIPFormat(ip))
|
||||
{
|
||||
return ip;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 한 서비스가 실패하면 다음 서비스 시도
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return "IP 확인 실패";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "오류: " + ex.Message;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 문자열이 유효한 IP 형식인지 확인합니다.
|
||||
/// </summary>
|
||||
private static bool IsValidIPFormat(string ip)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ip))
|
||||
return false;
|
||||
|
||||
// IPv4 형식 확인 (간단한 정규식)
|
||||
string pattern = @"^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$";
|
||||
return Regex.IsMatch(ip, pattern);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 클라이언트의 IP를 가져오되, 로컬 테스트 환경일 경우 공인 IP를 조회합니다.
|
||||
/// </summary>
|
||||
public static string GetClientIPWithFallback()
|
||||
{
|
||||
string ip = GetUserIP();
|
||||
|
||||
// 로컬 IP인 경우 공인 IP 조회 시도
|
||||
if (ip == "127.0.0.1" || ip == "::1" || ip.StartsWith("192.168.") || ip.StartsWith("10.") || (ip.StartsWith("172.") && ip.Split('.').Length > 1 && int.Parse(ip.Split('.')[1]) >= 16 && int.Parse(ip.Split('.')[1]) <= 31))
|
||||
{
|
||||
string publicIP = GetPublicIP();
|
||||
if (IsValidIPFormat(publicIP))
|
||||
{
|
||||
return publicIP;
|
||||
}
|
||||
}
|
||||
|
||||
return ip;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -125,53 +125,94 @@
|
|||
<update id="board.bmassign.save2" parameterClass="hashtable">
|
||||
update boardmaster set <include refid="sql.up"></include>,isopen=0 where bmno in (select bmno from (select bmno from boardmaster where asno=#asno# and isdefault=3) a)
|
||||
</update>
|
||||
<select id="board.bs" parameterClass="hashtable" resultClass="board">
|
||||
select a.rno,a.pagetotalcount,a.pcno
|
||||
,e.asname
|
||||
,c.bmno,c.bmname,c.isuseopening,c.isreply,c.bmtype
|
||||
,f.opname
|
||||
,b.cno,b.bno,b.pbno,b.subject,b.istop,b.issecr,b.cdt,d.username cnoname,d.userid cnoid
|
||||
,b.rcount,b.rpcount,b.fgno,b.fgnothumb,case when #getcontents# is null then '' else b.contents end contents
|
||||
,d.usertype
|
||||
,g.fileurl
|
||||
from (
|
||||
select a.*
|
||||
from (
|
||||
select b.bno
|
||||
,row_number() over(order by <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">b.istop desc,case when b.pbno is null then b.cdt else b2.cdt end desc,case when b.pbno is null then 0 else 1 end</isNull>) rno
|
||||
,count(a.cno) over() pagetotalcount,b2.cno pcno
|
||||
from boardmaster a
|
||||
inner join board b on b.bmno=a.bmno
|
||||
<isNotNull property="bno">and b.bno=#bno#</isNotNull>
|
||||
and b.isdel=0
|
||||
<isNotNull property="opno">and b.opno=#opno#</isNotNull>
|
||||
<isNotNull property="isopen">and b.isopen=#isopen#</isNotNull>
|
||||
<isNotNull property="issecr">and b.issecr=#issecr#</isNotNull>
|
||||
<isNotNull property="opno">and b.opno=#opno#</isNotNull>
|
||||
<isNotNull property="isbase" prepend="and">b.pbno is null</isNotNull>
|
||||
<isNotNull property="cno" prepend="and">b.cno=#cno#</isNotNull>
|
||||
<isNotNull property="cmno" prepend="and">b.cmno=#cmno#</isNotNull>
|
||||
<isNotNull property="bmposition" prepend="and">a.bmposition=#bmposition#</isNotNull>
|
||||
left outer join board b2 on b.pbno is not null and b2.bno=b.pbno
|
||||
inner join users c on c.userno=b.cno
|
||||
<dynamic prepend="where">
|
||||
<isNotNull property="bmno" prepend="and">a.bmno=#bmno#</isNotNull>
|
||||
<isNotNull property="asno" prepend="and">a.asno=#asno#</isNotNull>
|
||||
<isNotNull property="scc" prepend="and">(b.subject like concat('%',#scc#,'%') or b.contents like concat('%',#scc#,'%') or c.username=#scc#)</isNotNull>
|
||||
</dynamic>
|
||||
) a
|
||||
|
||||
<!-- 커뮤니케이션 > 홈페이지 게시판 리스트-->
|
||||
<select id="board.bs" parameterClass="hashtable" resultClass="board">
|
||||
SELECT a.rno, a.pagetotalcount, a.pcno
|
||||
, e.asname
|
||||
, c.bmno, c.bmname, c.isuseopening, c.isreply, c.bmtype
|
||||
, f.opname
|
||||
, b.cno, b.bno, b.pbno, b.subject, b.istop, b.issecr, b.cdt, d.username cnoname, d.userid cnoid
|
||||
, b.rcount, b.rpcount, b.fgno, b.fgnothumb, CASE WHEN #getcontents# IS NULL THEN '' ELSE b.contents END contents
|
||||
, d.usertype
|
||||
, g.fileurl
|
||||
FROM (
|
||||
SELECT a.*
|
||||
FROM (
|
||||
SELECT b.bno
|
||||
, ROW_NUMBER() OVER(ORDER BY <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">b.istop DESC, CASE WHEN b.pbno IS NULL THEN b.cdt ELSE b2.cdt END DESC, CASE WHEN b.pbno IS NULL THEN 0 ELSE 1 END</isNull>) rno
|
||||
, COUNT(a.cno) OVER() pagetotalcount, b2.cno pcno
|
||||
FROM boardmaster a
|
||||
INNER JOIN board b ON b.bmno = a.bmno
|
||||
<isNotNull property="bno">AND b.bno = #bno#</isNotNull>
|
||||
AND b.isdel = 0
|
||||
<isNotNull property="opno">AND b.opno = #opno#</isNotNull>
|
||||
<isNotNull property="isopen">AND b.isopen = #isopen#</isNotNull>
|
||||
<isNotNull property="issecr">AND b.issecr = #issecr#</isNotNull>
|
||||
<isNotNull property="opno">AND b.opno = #opno#</isNotNull>
|
||||
<isNotNull property="isbase" prepend="AND">b.pbno IS NULL</isNotNull>
|
||||
<isNotNull property="cno" prepend="AND">b.cno = #cno#</isNotNull>
|
||||
<isNotNull property="cmno" prepend="AND">b.cmno = #cmno#</isNotNull>
|
||||
<isNotNull property="bmposition" prepend="AND">a.bmposition = #bmposition#</isNotNull>
|
||||
LEFT OUTER JOIN board b2 ON b.pbno IS NOT NULL AND b2.bno = b.pbno
|
||||
INNER JOIN users c ON c.userno = b.cno
|
||||
<dynamic prepend="WHERE">
|
||||
<isNotNull property="bmno" prepend="AND">a.bmno = #bmno#</isNotNull>
|
||||
<isNotNull property="asno" prepend="AND">a.asno = #asno#</isNotNull>
|
||||
<isNotNull property="scc" prepend="AND">(b.subject LIKE CONCAT('%',#scc#,'%') OR b.contents LIKE CONCAT('%',#scc#,'%') OR c.username = #scc#)</isNotNull>
|
||||
</dynamic>
|
||||
) a
|
||||
<include refid="sql.pagedynamic"></include>
|
||||
) a
|
||||
INNER JOIN board b ON b.bno = a.bno
|
||||
INNER JOIN boardmaster c ON c.bmno = b.bmno
|
||||
INNER JOIN users d ON d.userno = b.cno
|
||||
LEFT OUTER JOIN assign e ON e.asno = c.asno
|
||||
LEFT OUTER JOIN boardmasteropening f ON f.opno = b.opno
|
||||
LEFT OUTER JOIN fileinfo g ON g.fgno = b.fgnothumb AND g.isdel = 0
|
||||
ORDER BY a.rno
|
||||
</select>
|
||||
|
||||
<!-- 커뮤니케이션 > 홈페이지 게시판 리스트 중 미답변만 (메인 > 잔여 업무 요약에서 접근) -->
|
||||
<select id="board.bsnoReplies" parameterClass="hashtable" resultClass="board">
|
||||
SELECT a.rno, a.pagetotalcount, a.pcno
|
||||
, e.asname
|
||||
, c.bmno, c.bmname, c.isuseopening, c.isreply, c.bmtype
|
||||
, f.opname
|
||||
, b.cno, b.bno, b.pbno, b.subject, b.istop, b.issecr, b.cdt, d.username cnoname, d.userid cnoid
|
||||
, b.rcount, b.rpcount, b.fgno, b.fgnothumb
|
||||
, (CASE WHEN #getcontents# IS NULL THEN '' ELSE b.contents END) contents
|
||||
, d.usertype
|
||||
, g.fileurl
|
||||
FROM (
|
||||
SELECT a.*
|
||||
FROM (
|
||||
SELECT b.bno
|
||||
, ROW_NUMBER() OVER(ORDER BY <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">b.istop DESC, CASE WHEN b.pbno IS NULL THEN b.cdt ELSE b2.cdt END DESC, CASE WHEN b.pbno IS NULL THEN 0 ELSE 1 END</isNull>) rno
|
||||
, COUNT(a.cno) OVER() pagetotalcount, b2.cno pcno
|
||||
FROM boardmaster a
|
||||
INNER JOIN board b ON b.bmno = a.bmno AND b.isdel = 0
|
||||
LEFT OUTER JOIN board b2 ON b.bno = b2.pbno AND b2.isdel = 0
|
||||
INNER JOIN users c ON c.userno = b.cno
|
||||
WHERE a.bmtype = 2
|
||||
<isNotNull property="bmposition" prepend="AND">a.bmposition = #bmposition#</isNotNull>
|
||||
AND a.isopen = 1
|
||||
AND b.pbno IS NULL
|
||||
AND b2.pbno IS NULL
|
||||
AND a.disptype = 0
|
||||
) a
|
||||
<include refid="sql.pagedynamic"></include>
|
||||
) a
|
||||
inner join board b on b.bno=a.bno
|
||||
<!--left outer join board b2 on b2.pbno=b.bno and b2.isdel=0-->
|
||||
inner join boardmaster c on c.bmno=b.bmno
|
||||
inner join users d on d.userno=b.cno
|
||||
left outer join assign e on e.asno=c.asno
|
||||
left outer join boardmasteropening f on f.opno=b.opno
|
||||
left outer join fileinfo g on g.fgno=b.fgnothumb and g.isdel=0
|
||||
order by a.rno
|
||||
) a
|
||||
INNER JOIN board b ON b.bno = a.bno
|
||||
INNER JOIN boardmaster c ON c.bmno = b.bmno
|
||||
INNER JOIN users d ON d.userno = b.cno
|
||||
LEFT OUTER JOIN assign e ON e.asno = c.asno
|
||||
LEFT OUTER JOIN boardmasteropening f ON f.opno = b.opno
|
||||
LEFT OUTER JOIN fileinfo g ON g.fgno = b.fgnothumb AND g.isdel = 0
|
||||
ORDER BY a.rno
|
||||
</select>
|
||||
<select id="board.bs.bypbnos" parameterClass="string" resultClass="board">
|
||||
|
||||
<select id="board.bs.bypbnos" parameterClass="string" resultClass="board">
|
||||
select f.opname,a.bno,a.pbno,a.subject,a.cdt,b.username cnoname,a.rpcount,a.issecr,a.cno
|
||||
,case when #getcontents# is null then '' else a.contents end contents
|
||||
,b.usertype
|
||||
|
|
@ -180,46 +221,94 @@
|
|||
left outer join boardmasteropening f on f.opno=a.opno
|
||||
where a.pbno in ($pbnos$) and a.isopen=1 and a.isdel=0
|
||||
</select>
|
||||
<select id="board.roombs" parameterClass="hashtable" resultClass="board">
|
||||
select a.rno,a.pagetotalcount
|
||||
,e.asname
|
||||
,c.bmno,c.bmname,c.isuseopening,c.isreply
|
||||
,f.opname
|
||||
<!--,b.bno,b.pbno,b.subject,b.istop,b.issecr,b.cdt,d.username cnoname,b.rcount,b.fgno,b.fgnothumb,b.cmno-->
|
||||
,b.bno,b.pbno,b.subject,b.istop,b.issecr,b.cdt,d.username cnoname,d.userid cnoid, b.rcount,b.fgno,b.fgnothumb,b.cmno
|
||||
,g.cname,g.classno
|
||||
,h.tyear,h.tseq
|
||||
from (
|
||||
select a.*
|
||||
from (
|
||||
select b.bno
|
||||
,row_number() over(order by <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">b.istop desc,case when b.pbno is null then b.cdt else b2.cdt end desc,case when b.pbno is null then 0 else 1 end</isNull>) rno
|
||||
,count(a.cno) over() pagetotalcount
|
||||
from boardmaster a
|
||||
inner join board b on b.bmno=a.bmno and b.isdel=0 <isNotNull property="cmno">and b.cmno=#cmno#</isNotNull>
|
||||
left outer join board b2 on b.pbno is not null and b2.bno=b.pbno
|
||||
inner join users c on c.userno=b.cno
|
||||
inner join cm d on d.cmno=b.cmno
|
||||
inner join term e on e.tmno=d.tmno <isNotNull property="tmno">and d.tmno=#tmno#</isNotNull> <isNotNull property="tyear">and e.tyear=#tyear#</isNotNull>
|
||||
<isNotNull property="teacherno">
|
||||
inner join cmprof cp on cp.cmno=b.cmno and cp.userno=#teacherno#
|
||||
</isNotNull>
|
||||
where a.bmposition=1
|
||||
<isNotNull property="bmno" prepend="and">a.bmno=#bmno#</isNotNull>
|
||||
<isNotNull property="asno" prepend="and">a.asno=#asno#</isNotNull>
|
||||
<isNotNull property="scc" prepend="and">(b.subject like concat('%',#scc#,'%') or b.contents like concat('%',#scc#,'%') or c.username=#scc#)</isNotNull>
|
||||
) a
|
||||
<include refid="sql.pagedynamic"></include>
|
||||
) a
|
||||
inner join board b on b.bno=a.bno
|
||||
inner join boardmaster c on c.bmno=b.bmno
|
||||
inner join users d on d.userno=b.cno
|
||||
inner join cm g on g.cmno=b.cmno
|
||||
inner join term h on h.tmno=g.tmno
|
||||
left outer join assign e on e.asno=c.asno
|
||||
left outer join boardmasteropening f on f.opno=b.opno
|
||||
order by a.rno
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 커뮤니케이션 > 강의실게시판 리스트 -->
|
||||
<select id="board.roombs" parameterClass="hashtable" resultClass="board">
|
||||
SELECT a.rno, a.pagetotalcount
|
||||
, e.asname
|
||||
, c.bmno, c.bmname, c.isuseopening, c.isreply
|
||||
, f.opname
|
||||
<!--,b.bno,b.pbno,b.subject,b.istop,b.issecr,b.cdt,d.username cnoname,b.rcount,b.fgno,b.fgnothumb,b.cmno-->
|
||||
, b.bno, b.pbno, b.subject, b.istop, b.issecr, b.cdt, d.username cnoname, d.userid cnoid, b.rcount, b.fgno, b.fgnothumb, b.cmno
|
||||
, g.cname, g.classno
|
||||
, h.tyear, h.tseq
|
||||
FROM (
|
||||
SELECT a.*
|
||||
FROM (
|
||||
SELECT b.bno
|
||||
, ROW_NUMBER() OVER(ORDER BY <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">b.istop DESC, CASE WHEN b.pbno IS NULL THEN b.cdt ELSE b2.cdt END DESC, CASE WHEN b.pbno IS NULL THEN 0 ELSE 1 END</isNull>) rno
|
||||
, COUNT(a.cno) OVER() pagetotalcount
|
||||
FROM boardmaster a
|
||||
INNER JOIN board b ON b.bmno = a.bmno AND b.isdel = 0 <isNotNull property="cmno">AND b.cmno = #cmno#</isNotNull>
|
||||
LEFT OUTER JOIN board b2 ON b.pbno IS NOT NULL AND b2.bno = b.pbno
|
||||
INNER JOIN users c ON c.userno = b.cno
|
||||
INNER JOIN cm d ON d.cmno = b.cmno
|
||||
INNER JOIN term e ON e.tmno = d.tmno <isNotNull property="tmno">AND d.tmno = #tmno#</isNotNull> <isNotNull property="tyear">AND e.tyear = #tyear#</isNotNull>
|
||||
<isNotNull property="teacherno">
|
||||
INNER JOIN cmprof cp ON cp.cmno = b.cmno AND cp.userno = #teacherno#
|
||||
</isNotNull>
|
||||
WHERE a.bmposition = 1
|
||||
<isNotNull property="bmno" prepend="AND">a.bmno = #bmno#</isNotNull>
|
||||
<isNotNull property="asno" prepend="AND">a.asno = #asno#</isNotNull>
|
||||
<isNotNull property="scc" prepend="AND">(b.subject LIKE CONCAT('%',#scc#,'%') OR b.contents LIKE CONCAT('%',#scc#,'%') OR c.username = #scc#)</isNotNull>
|
||||
) a
|
||||
<include refid="sql.pagedynamic"></include>
|
||||
) a
|
||||
INNER JOIN board b ON b.bno = a.bno
|
||||
INNER JOIN boardmaster c ON c.bmno = b.bmno
|
||||
INNER JOIN users d ON d.userno = b.cno
|
||||
INNER JOIN cm g ON g.cmno = b.cmno
|
||||
INNER JOIN term h ON h.tmno = g.tmno
|
||||
LEFT OUTER JOIN assign e ON e.asno = c.asno
|
||||
LEFT OUTER JOIN boardmasteropening f ON f.opno = b.opno
|
||||
LEFT OUTER JOIN board pb ON b.bno = pb.pbno AND pb.isdel = 0
|
||||
ORDER BY a.rno
|
||||
</select>
|
||||
|
||||
<!-- 커뮤니케이션 > 강의실게시판 리스트 중 미답변만 (메인 > 잔여 업무 요약에서 접근) -->
|
||||
<select id="board.roombsnoReplies" parameterClass="hashtable" resultClass="board">
|
||||
SELECT a.rno, a.pagetotalcount
|
||||
, e.asname
|
||||
, c.bmno, c.bmname, c.isuseopening, c.isreply
|
||||
, f.opname
|
||||
, b.bno, b.pbno, b.subject, b.istop, b.issecr, b.cdt
|
||||
, d.username cnoname, d.userid cnoid
|
||||
, b.rcount, b.fgno, b.fgnothumb, b.cmno
|
||||
, g.cname, g.classno
|
||||
, h.tyear, h.tseq
|
||||
FROM (
|
||||
SELECT a.*
|
||||
FROM (
|
||||
SELECT b.bno
|
||||
, ROW_NUMBER() OVER(ORDER BY <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">b.istop DESC, CASE WHEN b.pbno IS NULL THEN b.cdt ELSE b2.cdt END DESC, CASE WHEN b.pbno IS NULL THEN 0 ELSE 1 END</isNull>) rno
|
||||
, COUNT(a.cno) OVER() pagetotalcount
|
||||
FROM boardmaster a
|
||||
INNER JOIN board b ON a.bmno = b.bmno AND b.isdel = 0
|
||||
LEFT OUTER JOIN board b2 ON b.bno = b2.pbno AND b2.isdel = 0
|
||||
INNER JOIN users c ON c.userno = b.cno
|
||||
INNER JOIN cm d ON d.cmno = b.cmno
|
||||
WHERE a.bmposition = 1
|
||||
AND a.bmtype = 2
|
||||
AND a.isopen = 1
|
||||
AND b.pbno IS NULL
|
||||
AND b2.pbno IS NULL
|
||||
AND a.disptype = 0
|
||||
) a
|
||||
<include refid="sql.pagedynamic"></include>
|
||||
) a
|
||||
INNER JOIN board b ON b.bno = a.bno
|
||||
INNER JOIN boardmaster c ON c.bmno = b.bmno
|
||||
INNER JOIN users d ON d.userno = b.cno
|
||||
INNER JOIN cm g ON g.cmno = b.cmno
|
||||
INNER JOIN term h ON h.tmno = g.tmno
|
||||
LEFT OUTER JOIN assign e ON e.asno = c.asno
|
||||
LEFT OUTER JOIN boardmasteropening f ON f.opno = b.opno
|
||||
LEFT OUTER JOIN board pb ON b.bno = pb.pbno AND pb.isdel = 0
|
||||
ORDER BY a.rno
|
||||
</select>
|
||||
|
||||
|
||||
<select id="board.get" parameterClass="long" resultClass="board">
|
||||
select e.asname
|
||||
,c.bmno,c.bmname,c.isuseopening,c.isreply,c.disptype,c.bmtype
|
||||
|
|
|
|||
|
|
@ -1,49 +1,52 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NP.Model
|
||||
{
|
||||
public class VMCRoom : VMBase
|
||||
{
|
||||
public Int64 cmino{ get; set; }
|
||||
#region Request
|
||||
|
||||
public long cmino { get; set; }
|
||||
public int ctno { get; set; }
|
||||
public int cpno { get; set; }
|
||||
public Int64 lectno { get; set; }
|
||||
public long lectno { get; set; }
|
||||
public int pseq { get; set; }
|
||||
public int ismobile { get; set; }
|
||||
public int istaste { get; set; }
|
||||
public int status { get; set; }
|
||||
public int todayLectinningCount { get; set; }
|
||||
public int daylectinninglimit { get; set; }
|
||||
public int croomcmno { get; set; }
|
||||
public int croomusertype { get; set; }
|
||||
public string croomparam { get; set; }
|
||||
public int croombmno { get; set; }
|
||||
public int? opno { get; set; }
|
||||
public string scc { get; set; }
|
||||
public int estno { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Data
|
||||
|
||||
public CMInning CMInning { get; set; }
|
||||
public IList<LectInning> LectInnings { get; set; }
|
||||
public LectInningPage lip { get; set; }
|
||||
public IList<CTPage> Pages { get; set; }
|
||||
public CTPage Page { get; set; }
|
||||
|
||||
public Int64 croomlectno { get; set; }
|
||||
public int croomcmno { get; set; }
|
||||
public int croomusertype { get; set; }
|
||||
public String croomparam { get; set; }
|
||||
public Int64 BNo { get; set; }
|
||||
public Int64? PBNo { get; set; }
|
||||
public IList<Data> Datas { get; set; }
|
||||
public CMEV CMEV { get; set; }
|
||||
public Lect Lect { get; set; }
|
||||
public IList<CMPR> CMPRs { get; set; }
|
||||
public CM CM { get; set; }
|
||||
public IList<CMRS> CMRSes { get; set; }
|
||||
|
||||
public int croombmno { get; set; }
|
||||
public BoardMaster BM { get; set; }
|
||||
public IList<BoardMasterOpening> BMOs { get; set; }
|
||||
public int? opno { get; set; }
|
||||
public String scc { get; set; }
|
||||
public IList<Board> Boards { get; set; }
|
||||
public Board Board { get; set; }
|
||||
public IList<BoardCMT> BoardCMTs { get; set; }
|
||||
public Int64 BNo { get; set; }
|
||||
public Int64? PBNo { get; set; }
|
||||
public int estno { get; set; }
|
||||
public LectEX LectEX { get; set; }
|
||||
public IList<LectEXQ> UserExamDatas { get; set; }
|
||||
public IList<QuestionItem> QuestionItems { get; set; }
|
||||
|
|
@ -60,9 +63,8 @@ namespace NP.Model
|
|||
public IList<Lect> Lects { get; set; }
|
||||
public IList<Completion> Completions { get; set; }
|
||||
public Data ErrLi { get; set; }
|
||||
public int todayLectinningCount { get; set; }
|
||||
public int daylectinninglimit { get; set; }
|
||||
public Excellog excellog { get; set; }
|
||||
|
||||
public Excellog excellog { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue