YNICTE/BO/Views/cm/cgs.cshtml

173 lines
8.5 KiB
Plaintext

@model NP.Model.VMCM
<form id="mform" method="post" action="/cm/cgs">
<section class="panel panel-default clearfix devsearch" data-cleartbody="tbody1">
@Html.Partial("./Partial/SearchCaption")
<div class="step-content">
<div class="step-pane active form-inline">
<div class="form-group">
@Html.Partial("./Partial/Text", Model.searchtext, Helpers.DicText(new NP.Model.TextDic() { Name = "searchtext", Value = Model.searchtext, PH = "분류명 혹은 코드를 입력하세요.", CssClass = "ff" }))
@Html.Partial("./Partial/Button", new NP.Model.Button() { Special = "search" })
</div>
</div>
</div>
</section>
<div class="tar buttonbox">
@Html.Partial("./Partial/pagerow", new ViewDataDictionary { { "tbodyid", "tbody1" }, { "searchmethod", "submit()" }, { "pagesize", Model.pagerowcount } })
<a href="#" onclick="javascript:reg(0);" class="btn btn-s-xs btn-info">등록</a>
</div>
<section class="panel panel-default">
<div class="table-responsive" id="excel1">
<table class="table table-striped b-t b-light">
<thead>
<tr>
<th width="20">No</th>
<th>상위분류</th>
<th>과정분류명</th>
<th>코드</th>
<th>사용여부</th>
<th>등록일</th>
</tr>
</thead>
<tbody class="data" id="tbody1">
@foreach (var item in Model.CGs)
{
<tr>
<td>@item.rnorvt</td>
<td class="text-left">@(item.pcgname??"-")</td>
<td class="link"><a href="#" onclick="reg(@item.cgno)">@item.cgname</a></td>
<td>@item.cgcode</td>
<td>@item.isuseyn</td>
<td>@item.cdtymd</td>
</tr>
}
</tbody>
</table>
</div>
@Html.Pager((int)Model.pagenum, 10, Model.pagerowcount, Model.pagetotalcount)
</section>
</form>
<div id="thisbox" class="findbox draggable regbox summernoteparentfixedbox" style="width: 500px; height: 500px; z-index: 1041; top: 60px; bottom: 30px; overflow: auto;">
<h4><i class="fa fa-bars"></i> <span id="pcap">타이틀</span><a href="#" class="btn btn-default btn-xs f-r closethisbox">닫기</a></h4>
<table class="regtable">
<colgroup><col style="width:150px;" /><col /></colgroup>
<tr id="trisparent">
<th>상위분류</th>
<td>@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "1:있음;0:없음" }, { "checked", 1 }, { "name", "isparent" } })</td>
</tr>
<tr id="trpcgno">
<th class="req">상위분류선택</th>
<td>@Html.Partial("./Partial/Select", Model.CGs2, new ViewDataDictionary { { "special", "reg" }, { "name", "pcgno" }, { "selected", "" }, { "df", ":-분류선택" } })</td>
</tr>
<tr>
<th class="req">과정분류명</th>
<td>@Html.TextBox("cgname", "", new { @class = "form-control ff", @maxlength = "20" })</td>
</tr>
<tr>
<th class="req">과정분류코드</th>
<td>@Html.TextBox("cgcode", "", new { @class = "form-control", @maxlength = "20" })</td>
</tr>
<tr id="triscover" style="display:none;">
<th>보수교육여부</th>
<td>@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "0:N;1:Y" }, { "checked", 1 }, { "name", "iscover" } })</td>
</tr>
<tr>
<th>사용여부</th>
<td>@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "1:Y;0:N" }, { "checked", 1 }, { "name", "isuse" } })</td>
</tr>
</table>
<div class="findboxbtnbox">
<a href="#" class="btn btn-primary hideme" id="btnsave" onclick="save();">저장</a>
<a href="#" class="btn btn-danger hideme" id="btndel" onclick="del();">삭제</a>
</div>
<label class="regbox" style="font-size:12px;">
* 등록 안내<br />
- 상위분류선택 : 상위분류 있음 선택 시 반드시 상위분류를 지정,<br /> 그 밑에 분류를 생성합니다.<br />
- 과정분류명 : 20자 이내로 입력합니다.<br />
- 과정분류코드 : 영문,숫자,한글 혼용 가능하며 20자 이내로 입력합니다.<br /> 중복 지정은 불가하며 중복 체크 시에는 대소문자를 구별하지 않습니다.
</label>
</div>
@section scriptsHeader{
<script src="~/js/jquery-ui.min.js"></script>
}
@section scripts{
<script>
$(document).ready(function () {
$("input[name='isparent']").on("change", function () {
$("#pcgno").val("");
$("#trpcgno").show();
$("#iscover").val("0");
if ($(this).val() == 0) {
$("#trpcgno").hide();
}
});
});
var _key;
function reg(no) {
_key = no;
$("#pcgno,#cgname,#cgcode").val("");
$("#isparent1,#isuse1").prop("checked", true);
$("#pcap").text("과정분류코드 수정");
$("#btndel,#trpcgno,#trisparent").show();
if (no < 1) {
$("#btndel").hide();
$("#pcap").text("과정분류코드 등록");
bglayer();
$("#thisbox").slideDown("fast", function () { $("#thisbox").scrollTop(0); $('#cgname').focus(); });
}
else {
//$("#trisparent").hide();
capp("/acommon/cgget", { cgno: no}, "cbgetdata", null, null, null, true);
}
}
function cbgetdata() {
if (capResult.obj != null) {
var d = capResult.obj;
setv("pcgno", d.pcgno);
//$("#triscover").show();
if (d.pcgno == null) {
$("#isparent0").prop("checked", true);
$("#trpcgno").hide();
//$("#triscover").hide();
}
setv("cgname", d.cgname);
setv("cgcode", d.cgcode);
$(".hideme").show();
if ('@ViewBag.Fixed'.indexOf(';' + d.cgcode + ';') > -1) {
$(".hideme").hide();
}
$("#iscover" + d.isuse).prop("checked", true);
$("#isuse" + d.isuse).prop("checked", true);
bglayer();
$("#thisbox").slideDown("fast", function () { $("#thisbox").scrollTop(0); $('#cgname').focus(); });
}
}
function save() {
if ($("#isparent1").prop("checked") && check("pcgno", null, "상위분류를 선택해주세요.", true)) { }
else if (check("cgname", null, "상위분류명을 입력해주세요.", true)) { }
else if (check("cgcode", null, "상위분류코드를 입력해주세요.", true)) { }
else if (confirm("저장하시겠습니까?")) {
capp("/acommon/cgsave", { cgno: _key, pcgno: val("pcgno"), cgname: val("cgname"), cgcode: val("cgcode"), iscover: getcheckv("iscover"), isuse: getcheckv("isuse") }, "cbsave", null, null, null, true);
}
}
function cbsave() {
if (capResult.code == 1000) {
msgok2(1, null, true);
submit(null, 700);
} else if (capResult.obj == -1) {
msg2("이미 사용중인 과정분류코드입니다.");
} else { msgdev(); }
}
function del() {
if (confirm("과정분류코드를 삭제하시겠습니까?\n(삭제된 코드는 재등록이 불가능하며, 이미 사용한 강좌는 그대로 조회됩니다.)")) {
capp("/acommon/cgsave", { cgno: _key, isdel: 1 }, "cbdel", null, null, null, true);
}
}
function cbdel() {
if (capResult.code == 1000) {
msgok2(0, null, true);
submit(null, 700);
} else { msgdev(); }
}
</script>
}