public JsonResult SetCommCode(CommLibraryModel commcode) { try { int resultInt = 0; if (commcode.idx == null) { commcode.create_us = Convert.ToInt32(Session["USER_IDX"]); resultInt = (int)Mapper.Instance().Insert("Common.insCommCode", commcode); commcode.idx = resultInt; LogCtrl.SetLog(commcode, eActionType.DataInsert, this.HttpContext, commcode.kor_nm); } else { resultInt = Mapper.Instance().Update("Common.udtCommCode", commcode); LogCtrl.SetLog(commcode, eActionType.DataUpdate, this.HttpContext, commcode.kor_nm); } return(Json(resultInt)); } catch (Exception ex) { logger.Error(string.Format("ERROR : 공통코드 저장"), ex); return(Json(new ResultJsonModel { isError = true, resultMessage = ex.Message, resultDescription = ex.ToString() })); } }
public JsonResult GetCommonCode(CommLibraryModel searchModel) { try { var commCodeGroupList = Mapper.Instance().QueryForList <CommLibraryModel>("Common.selCommCode", searchModel); return(Json(commCodeGroupList)); } catch (Exception ex) { logger.Error(string.Format("ERROR CODE GROUP: "), ex); return(Json(new ResultJsonModel { isError = true, resultMessage = ex.Message, resultDescription = ex.ToString() })); } }
public PartialViewResult EditCommonCode(int?commCodeIDX, int?parentIdx) { CommLibraryModel commCode = null; if (commCodeIDX != null) { commCode = Mapper.Instance().QueryForObject <CommLibraryModel>("Common.selCommCode", new CommLibraryModel { idx = commCodeIDX }); } else { commCode = new CommLibraryModel(); } ViewBag.parentIdx = parentIdx; ViewBag.commCode = commCode; return(PartialView("Dialog/dlgEditCommCode")); }