시험응시 문구 수정 및 토스 도메인 변경

This commit is contained in:
iyak 2025-01-24 06:41:39 +00:00
parent d5c0b04f89
commit 6f234a18ac
3 changed files with 49 additions and 46 deletions

View File

@ -1069,48 +1069,54 @@ namespace NP.Base
/// <param name="sbj"></param> /// <param name="sbj"></param>
/// <param name="strFile"></param> /// <param name="strFile"></param>
/// <returns></returns> /// <returns></returns>
[Obsolete] [Obsolete]
protected int SendEmail(String smtphost, int smtpport, String smtpid, String smtppw, int SendType, String rcvEmail, String sdEmail, String sdName, String title, String Html, String strFile = null, string bans = "") protected int SendEmail(String smtphost, int smtpport, String smtpid, String smtppw, int SendType, String rcvEmail, String sdEmail, String sdName, String title, String Html, String strFile = null, string bans = "")
{ {
System.Web.Mail.MailMessage mail = null;
switch (SendType) switch (SendType)
{ {
case 1: break; case 1: break;
default: break; default:
}
break;
}
String result = rcvEmail; String result = rcvEmail;
try try
{ {
var mail = new System.Web.Mail.MailMessage(); mail = new System.Web.Mail.MailMessage();
mail.Subject = title; mail.Subject = title;
mail.From = "donetreplay@cte.or.kr"; // sdEmail; //보내는 사람 설정 mail.From = sdEmail; //보내는 사람 설정
mail.To = rcvEmail; // 받는 사람 설정 mail.To = rcvEmail; // 받는 사람 설정
mail.BodyEncoding = System.Text.Encoding.UTF8; mail.BodyEncoding = System.Text.Encoding.UTF8;
mail.BodyFormat = MailFormat.Html; mail.BodyFormat = MailFormat.Html;
if ("" != bans) if ("" != bans)
{ {
Html = Html.Replace("^ban0^", bans.Split(':')[0]).Replace("^ban1^", bans.Split(':')[1]); Html = Html.Replace("^ban0^", bans.Split(':')[0]).Replace("^ban1^", bans.Split(':')[1]);
} }
var files = new NP.Model.VMBase() { }; var files = new NP.Model.VMBase() { };
mail.Body = Html.Replace("src=\"" + files.Files + "/Editor", "src=\"" + GetConfig("fronturl") + "/Files/Editor"); mail.Body = Html.Replace("src=\"" + files.Files + "/Editor", "src=\"" + GetConfig("fronturl") + "/Files/Editor");
if (!string.IsNullOrEmpty(strFile)) if (!string.IsNullOrEmpty(strFile))
{ {
System.Web.Mail.MailAttachment attachment;//첨부파일 만들기 System.Web.Mail.MailAttachment attachment;//첨부파일 만들기
attachment = new System.Web.Mail.MailAttachment(strFile);//첨부파일 붙이기 attachment = new System.Web.Mail.MailAttachment(strFile);//첨부파일 붙이기
mail.Attachments.Add(attachment);//첨부파일 붙이기 mail.Attachments.Add(attachment);//첨부파일 붙이기
} }
int cdoBasic = 1;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", true); mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", true);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", smtpport); mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", smtpport);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1); mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", smtpid); mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", smtpid);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", smtppw); mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", smtppw);
SmtpMail.SmtpServer = smtphost; SmtpMail.SmtpServer = smtphost;
SmtpMail.Send(mail); SmtpMail.Send(mail);
//using (System.Net.Mail.SmtpClient SmtpServer = new System.Net.Mail.SmtpClient(smtphost, smtpport))
//{
// SmtpServer.Credentials = new System.Net.NetworkCredential(smtpid, smtppw);
// //SmtpServer.EnableSsl = true;
// SmtpServer.Send(mail);
//}
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -15,14 +15,18 @@
.SingleOrDefault(); .SingleOrDefault();
// 예외처리 과정코드들? // 예외처리 과정코드들?
List<long> allowLectNos = Array //List<long> allowLectNos = Array
.ConvertAll("104069,102553,105325,104402,106226,62683,104419".Split(','), long.Parse) // .ConvertAll("104069,102553,105325,104402,106226,62683,104419".Split(','), long.Parse)
.ToList(); // .ToList();
//ViewBag.exCheck = allowLectNos.IndexOf(Model.croomlectno) > -1 ? true : false;
// 현재 진도율 // 현재 진도율
int currentProgresRate = Model.Datas.Where(w => w.dtype == -1).FirstOrDefault().intval5; int currentProgresRate = Model.Datas.Where(w => w.dtype == -1).FirstOrDefault().intval5;
// 시험응시가능여부
bool isExCheck = ViewBag.exCheck != null ? (bool)ViewBag.exCheck : false;
} }
<ul class="lctpTab col3"> <ul class="lctpTab col3">
<li class="@(Model.tabidx == 0 ? "current" : "")"><a onclick="gotab(0, this)" style="@(Model.tabidx == 0 ? "cursor: default;" : "")" href="#;">전체</a></li> <li class="@(Model.tabidx == 0 ? "current" : "")"><a onclick="gotab(0, this)" style="@(Model.tabidx == 0 ? "cursor: default;" : "")" href="#;">전체</a></li>
@ -33,19 +37,19 @@
<input type="hidden" id="hdndType1StudyTime" value="@dType1CmStudyTime" /> <input type="hidden" id="hdndType1StudyTime" value="@dType1CmStudyTime" />
<input type="hidden" id="hdnlectSDate" value="@dType1LectSDate" /> <input type="hidden" id="hdnlectSDate" value="@dType1LectSDate" />
<input type="hidden" id="hdnCurrentProgresRate" value="@currentProgresRate" /> <input type="hidden" id="hdnCurrentProgresRate" value="@currentProgresRate" />
<input type="hidden" id="hdnExCheck" value="@isExCheck.ToString()" />
<table> <table>
<tbody> <tbody>
@foreach (var d in Model.Datas.Where(w => w.dtype > -1)) @foreach (var d in Model.Datas.Where(w => w.dtype > -1))
{ {
ViewBag.exCheck = allowLectNos.IndexOf(Model.croomlectno) > -1 ? true : false;
<tr> <tr>
<th> <th>
@* @*
// 당구장 설명 // 당구장 설명
/* /*
① 16시간 교육O or 신청일이 2024-08-19 이전: 참여조건 표기 ① 16시간 교육O or 신청일이 2024-08-19 이전: 참여조건 표기
② 16시간 교육X or 신청일이 2024-08-19 이후: ※ 집체교육일에 교육장에서 평가진행 ② 16시간 교육X or 신청일이 2024-08-19 이후: ※ 집체교육일에 교육장에서 평가진행
// 3월이후에 아래 내용으로 복원한다 (dtype = 1 안에 if 문 조정) // 3월이후에 아래 내용으로 복원한다 (dtype = 1 안에 if 문 조정)
@ -56,9 +60,9 @@
<b>@(d.dtype == 0 ? "진행평가" : d.dtype == 1 ? "최종평가" : d.dtype == 2 ? "과제" : d.dtype == 3 ? "토론" : "")</b><span> @d.strval</span> <b>@(d.dtype == 0 ? "진행평가" : d.dtype == 1 ? "최종평가" : d.dtype == 2 ? "과제" : d.dtype == 3 ? "토론" : "")</b><span> @d.strval</span>
</h5> </h5>
@if (d.dtype == 1) @if (d.dtype == 1)
{ // 최종평가 { // 최종평가
if (d.intval6 == 16 && d.time2 < Convert.ToDateTime("2024-08-19 00:00:00")) if (d.intval6 == 16 || (d.time2 < Convert.ToDateTime("2024-08-19")))
{ {
<p>참여조건 : 진도율 @(d.intval2)% 이상 / 집체교육 참석일 (@d.time.ToShortDateString()) 전 까지</p> <p>참여조건 : 진도율 @(d.intval2)% 이상 / 집체교육 참석일 (@d.time.ToShortDateString()) 전 까지</p>
} }
@ -73,7 +77,6 @@
} }
</th> </th>
@* @*
// 시험 응시 버튼 // 시험 응시 버튼
/* /*
@ -92,11 +95,9 @@
@if (d.dtype == 1) @if (d.dtype == 1)
{ {
// 최총 평가일 때 // 최총 평가일 때
if ( if ((currentProgresRate >= d.intval2) // 조건 ①
((currentProgresRate >= d.intval2) && IsDateInRange(d.time2, d.time)) || && IsDateInRange(d.time2, d.time) // 조건 ②
ViewBag.exCheck || && (ViewBag.exCheck || dType1CmStudyTime == 16)) // 조건 ③ 또는 조건 ④ <-- 요 부분을 다시 물어보자
dType1CmStudyTime == 16
)
{ {
<td> <td>
<input type="hidden" name="cmEcondition" value="@d.intval2" /> <input type="hidden" name="cmEcondition" value="@d.intval2" />
@ -113,10 +114,10 @@
<input type="hidden" name="cmEcondition" value="@d.intval2" /> <input type="hidden" name="cmEcondition" value="@d.intval2" />
<input type="hidden" name="lectSDate" value="@d.time2" /> <input type="hidden" name="lectSDate" value="@d.time2" />
<input type="hidden" name="lectEDate" value="@d.time" /> <input type="hidden" name="lectEDate" value="@d.time" />
<input type="hidden" name="isDateInRange" value="@IsDateInRange(d.time2, d.time).ToString()" />
<a href="javascript:;" onclick="msg('24년 8월 22일 부터 건설기술진흥법 변경으로 <br>집체교육 당일 교육장에서 시험평가가 진행됩니다.')" <a href="javascript:;" onclick="msg('24년 8월 22일 부터 건설기술진흥법 변경으로 <br>집체교육 당일 교육장에서 시험평가가 진행됩니다.')"
class="evaType@(d.intval4 == 1 ? "04" : d.intval3 == 1 ? "03" : d.intval3 == 0 && d.intval >= d.intval2 ? "02" : "01")">@(d.intval4 == 1 ? "[평가완료]" : d.intval3 == 1 ? "[참여완료]" : d.intval3 == 0 && d.intval >= d.intval2 ? "[참여가능]" : "[참여불가]")</a> class="evaType@(d.intval4 == 1 ? "04" : d.intval3 == 1 ? "03" : d.intval3 == 0 && d.intval >= d.intval2 ? "02" : "01")">@(d.intval4 == 1 ? "[평가완료]" : d.intval3 == 1 ? "[참여완료]" : d.intval3 == 0 && d.intval >= d.intval2 ? "[참여가능]" : "[참여불가]")</a>
</td> </td>
} }
} }
else else
@ -126,16 +127,13 @@
<a href="javascript:;" onclick="eva(@d.dtype, @d.intval10, @(d.intval4 == 1 ? 4 : d.intval3 == 1 ? 3 : d.intval3 == 0 && d.intval >= d.intval2 ? 2 : 1))" <a href="javascript:;" onclick="eva(@d.dtype, @d.intval10, @(d.intval4 == 1 ? 4 : d.intval3 == 1 ? 3 : d.intval3 == 0 && d.intval >= d.intval2 ? 2 : 1))"
class="evaType@(d.intval4 == 1 ? "04" : d.intval3 == 1 ? "03" : d.intval3 == 0 && d.intval >= d.intval2 ? "02" : "01")">@(d.intval4 == 1 ? "[평가완료]" : d.intval3 == 1 ? "[참여완료]" : d.intval3 == 0 && d.intval >= d.intval2 ? "[참여가능]" : "[참여불가]")</a> class="evaType@(d.intval4 == 1 ? "04" : d.intval3 == 1 ? "03" : d.intval3 == 0 && d.intval >= d.intval2 ? "02" : "01")">@(d.intval4 == 1 ? "[평가완료]" : d.intval3 == 1 ? "[참여완료]" : d.intval3 == 0 && d.intval >= d.intval2 ? "[참여가능]" : "[참여불가]")</a>
</td> </td>
} }
</tr> </tr>
} }
@* @*
// 하단 문구 // 하단 문구
// - 16시간 교육X or 신청일이 2024-08-19 이후
*@ *@
@if (Model.Datas.Where(w => w.dtype > -1).Count() < 1) @if (Model.Datas.Where(w => w.dtype > -1).Count() < 1)
{ {
<tr> <tr>
@ -145,12 +143,16 @@
</tr> </tr>
} }
else else
{ {
<tr> <tr>
<th colspan="2" style="text-align: center; font-weight: normal; height: 100px;"> <th colspan="2" style="text-align: center; font-weight: normal; height: 100px;">
@if (Model.tabidx == 0 || Model.tabidx == 1) @if (Model.tabidx == 0 || Model.tabidx == 1)
{ // 전체, 시험 탭 { // 전체, 시험 탭
if (dType1CmStudyTime != 16 && dType1LectSDate > Convert.ToDateTime("2024-08-19 23:59:59")) if (dType1CmStudyTime == 16 || dType1LectSDate < Convert.ToDateTime("2024-08-19"))
{
// 기준이 애매해서 if와 else를 바꿈 (임시사용)
}
else
{ {
<p><b>※ 24년 8월 22일 부터 건설기술진흥법 변경으로 집체교육 당일 교육장에서 시험평가가 진행됩니다.</b></p> <p><b>※ 24년 8월 22일 부터 건설기술진흥법 변경으로 집체교육 당일 교육장에서 시험평가가 진행됩니다.</b></p>
} }
@ -171,16 +173,13 @@
@Html.HiddenFor(m => m.estno) @Html.HiddenFor(m => m.estno)
</form> </form>
@section scriptsHeader{ @section scriptsHeader{ }
}
@section scripts{ @section scripts{
<script> <script>
$(document).ready(function () { $(document).ready(function () {
}); });
/** /**
@ -215,11 +214,9 @@
/// <param name="endDate">종료일</param> /// <param name="endDate">종료일</param>
/// <returns>true/false</returns> /// <returns>true/false</returns>
public bool IsDateInRange(DateTime startDate, DateTime endDate) public bool IsDateInRange(DateTime startDate, DateTime endDate)
{ {
// 현재일자
DateTime currentDate = DateTime.Now;
// 현재일자가 시작일 이상 && 종료일 이하인지 확인 // 현재일자가 시작일 이상 && 종료일 이하인지 확인
return startDate <= currentDate && currentDate <= endDate; return startDate <= DateTime.Now && DateTime.Now <= endDate;
} }
} }

View File

@ -2,12 +2,12 @@
@if (ViewBag.isPayTest == "1") @if (ViewBag.isPayTest == "1")
{ {
//테스트일 경우 //테스트일 경우
<script language="javascript" src="https://pretest.tosspayments.com:7443/xpay/js/xpay_crossplatform.js" type="text/javascript"></script> <script language="javascript" src="https://xpay-sandbox.tosspayments.com/xpay/js/xpay_crossplatform.js" type="text/javascript"></script>
} }
else else
{ {
//서비스일 경우 //서비스일 경우
<script language="javascript" src="https://xpayvvip.tosspayments.com/xpay/js/xpay_crossplatform.js" type="text/javascript"></script> <script language="javascript" src="https://xpay.tosspayments.com/xpay/js/xpay_crossplatform.js" type="text/javascript"></script>
} }
<br /> <br />
<div style="border: 1px solid #ddd; color: red; font-weight: bold; font-size: 13px; text-align: center; padding: 15px;">결제 진행중입니다. 잠시만 기다려주세요.</div> <div style="border: 1px solid #ddd; color: red; font-weight: bold; font-size: 13px; text-align: center; padding: 15px;">결제 진행중입니다. 잠시만 기다려주세요.</div>
@ -59,4 +59,4 @@ else
} }
} }
</script> </script>