/* --------------------------------------------------------------------- ÀÀ±Þ¼ö¼úÇöȲ Åë°è (SSMNP01100.xfm - JScript ) - Version : 1) : Ver.1.00.01 : Create By taebum : 2008-11-19 ¿ÀÈÄ 3:07:20 ---------------------------------------------------------------------- */ /** * @group : * @ver : 2008-09-23 ¿ÀÈÄ 4:20:36 * @by : * @--------------------------------------------------- * @type : function * @access : public * @desc : ÃʱâÈ­ * @param : * @return : * @--------------------------------------------------- */ function fInit(){ model.setValue("/root/hidden/condition/frdd", getCurrentDate()); model.setValue("/root/hidden/condition/todd" , getCurrentDate()); model.refresh(); //2010-03-10 ¿ÀÈÄ 6:06:58 taebum add ¿¬À¸·Î¸¸ Á¶È¸µÊ ¿À·ù ¿Ã¶ó¿Â°Ç °ü·Ã ¼öÁ¤ÀÛ¾÷ model.setValue("/root/temp/org_searfromdd", getCurrentDate()); model.refresh(); model.setValue("/root/init/tab", "dept"); model.toggle("case1"); model.removeNodeSet("/root/main/deptlists/deptlist"); datagrid1.refresh(); model.removeNodeSet("/root/main/monthlists/monthlist"); datagrid2.refresh(); model.removeNodeSet("/root/main/roomlists/roomlist"); datagrid3.refresh(); model.removeNodeSet("/root/main/weeklists/weeklist"); datagrid4.refresh(); } function fOnClickSearchBtn(){ var sCurrentTab = model.getValue("/root/init/tab"); if(sCurrentTab == "" || sCurrentTab == null || sCurrentTab == "undefined"){ return; } model.setValue("/root/send/frdd", model.getValue("/root/hidden/condition/frdd")); model.setValue("/root/send/todd", model.getValue("/root/hidden/condition/todd")); model.setValue("/root/send/anstflag1", model.getValue("/root/hidden/condition/anstflag1")); model.setValue("/root/send/anstflag2", model.getValue("/root/hidden/condition/anstflag2")); model.setValue("/root/send/anstflag3", model.getValue("/root/hidden/condition/anstflag3")); model.setValue("/root/send/etcflag1", model.getValue("/root/hidden/condition/etcflag1")); model.setValue("/root/send/etcflag2", model.getValue("/root/hidden/condition/etcflag2")); model.setValue("/root/send/etcflag3", model.getValue("/root/hidden/condition/etcflag3")); switch(sCurrentTab){ case "dept" : if(model.getValue("/root/send/frdd") == "" || model.getValue("/root/send/todd") == ""){ messageBox("½ÃÀÛÀÏ, Á¾·áÀÏÀº ÇʼöÀÔ·Â »çÇ×ÀÔ´Ï´Ù.", "I000"); return; } if((model.getValue("/root/send/frdd")).length < 8){ messageBox("½ÃÀÛÀÏ ÀÔ·ÂÇü½ÄÀº ³â-¿ù-ÀÏ ÀÔ´Ï´Ù.", "I000"); return; } model.removeNodeSet("/root/main/deptlists/deptlist"); datagrid1.refresh(); if(submit("TRSNP01100")){ //Áø·á°ú °¹¼ö¸¦ countÇÏ¿© Áø·á°ú¸íÀÌ ¾ø´Â LineÀº width¸¦ 0À¸·Î ÁÙÀδÙ. var iGridCnt = getNodesetCnt(model, "/root/main/deptlists/deptlist"); fHiddenGridCol(iGridCnt, datagrid1); } break; case "month" : if(model.getValue("/root/send/frdd") == "" || (model.getValue("/root/send/frdd")).length < 4){ messageBox("³âµµ´Â ÇʼöÀÔ·Â »çÇ×ÀÔ´Ï´Ù.", "I000"); return; } model.removeNodeSet("/root/main/monthlists/monthlist"); datagrid2.refresh(); submit("TRSNP01101"); break; case "room" : if(model.getValue("/root/send/frdd") == "" || model.getValue("/root/send/todd") == ""){ messageBox("½ÃÀÛÀÏ, Á¾·áÀÏÀº ÇʼöÀÔ·Â »çÇ×ÀÔ´Ï´Ù.", "I000"); return; } if((model.getValue("/root/send/frdd")).length < 8){ messageBox("½ÃÀÛÀÏ ÀÔ·ÂÇü½ÄÀº ³â-¿ù-ÀÏ ÀÔ´Ï´Ù.", "I000"); return; } model.removeNodeSet("/root/main/roomlists/roomlist"); datagrid3.refresh(); if(submit("TRSNP01102")){ var iGridCnt = getNodesetCnt(model, "/root/main/roomlists/roomlist"); fHiddenGridCol(iGridCnt, datagrid3); } break; case "day" : if(model.getValue("/root/send/frdd") == "" || model.getValue("/root/send/todd") == ""){ messageBox("½ÃÀÛÀÏ, Á¾·áÀÏÀº ÇʼöÀÔ·Â »çÇ×ÀÔ´Ï´Ù.", "I000"); return; } if((model.getValue("/root/send/frdd")).length < 8){ messageBox("½ÃÀÛÀÏ ÀÔ·ÂÇü½ÄÀº ³â-¿ù-ÀÏ ÀÔ´Ï´Ù.", "I000"); return; } model.removeNodeSet("/root/main/weeklists/weeklist"); datagrid4.refresh(); submit("TRSNP01103"); break; default : break; } } /** * ÅÇ ¹öư Ŭ¸¯½Ã À̺¥Æ® * */ function fClickTab(pFlag){ if(pFlag == "dept"){ model.setValue("/root/init/tab", "dept"); ipt_refcond.visible = true; caption1.visible = true; input1.visible = true; ipt_refcond.attribute("maxlength")= 8; ipt_refcond.attribute("format")= "yyyy-mm-dd"; //2010-03-10 ¿ÀÈÄ 6:06:58 taebum add ¿¬À¸·Î¸¸ Á¶È¸µÊ ¿À·ù ¿Ã¶ó¿Â°Ç °ü·Ã ¼öÁ¤ÀÛ¾÷ if((model.getValue("/root/hidden/condition/frdd")).length < 5){ model.setValue("/root/hidden/condition/frdd", model.getValue("/root/temp/org_searfromdd")); model.refresh(); } }else if(pFlag == "month"){ model.setValue("/root/init/tab", "month"); ipt_refcond.visible = true; caption1.visible = false; input1.visible = false; ipt_refcond.attribute("maxlength")= 4; ipt_refcond.attribute("format")= "yyyy"; model.setValue("/root/hidden/condition/frdd", (model.getValue("/root/hidden/condition/frdd").substr(0,4))); ipt_refcond.refresh(); }else if(pFlag == "room"){ model.setValue("/root/init/tab", "room"); ipt_refcond.visible = true; caption1.visible = true; input1.visible = true; ipt_refcond.attribute("maxlength")= 8; ipt_refcond.attribute("format")= "yyyy-mm-dd"; //2010-03-10 ¿ÀÈÄ 6:06:58 taebum add ¿¬À¸·Î¸¸ Á¶È¸µÊ ¿À·ù ¿Ã¶ó¿Â°Ç °ü·Ã ¼öÁ¤ÀÛ¾÷ if((model.getValue("/root/hidden/condition/frdd")).length < 7){ model.setValue("/root/hidden/condition/frdd", model.getValue("/root/temp/org_searfromdd")); model.refresh(); } }else if(pFlag == "day"){ model.setValue("/root/init/tab", "day"); ipt_refcond.visible = true; caption1.visible = true; input1.visible = true; ipt_refcond.attribute("maxlength")= 8; ipt_refcond.attribute("format")= "yyyy-mm-dd"; //2010-03-10 ¿ÀÈÄ 6:06:58 taebum add ¿¬À¸·Î¸¸ Á¶È¸µÊ ¿À·ù ¿Ã¶ó¿Â°Ç °ü·Ã ¼öÁ¤ÀÛ¾÷ if((model.getValue("/root/hidden/condition/frdd")).length < 7){ model.setValue("/root/hidden/condition/frdd", model.getValue("/root/temp/org_searfromdd")); model.refresh(); } } } /** * @group : * @ver : 2007.10.17 * @by : Grace * @--------------------------------------------------- * @type : function * @access : public * @desc : Exel ÀúÀå * @param : * @return : * @--------------------------------------------------- */ function fSaveExcel(){ var sCurrentTab = model.getValue("/root/init/tab"); if(sCurrentTab == "" || sCurrentTab == null || sCurrentTab == "undefined"){ return; } var fileName = null; switch(sCurrentTab){ case "dept" : fileName = window.fileDialog("save", ",", false, "ÀÀ±Þ¼ö¼úÇöȲ_Áýµµ°úº°_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls"); if (fileName != "" && fileName != null) { datagrid1.saveExcel(fileName, "SheetName", true, true, "", "", false); } break; case "month" : fileName = window.fileDialog("save", ",", false, "ÀÀ±Þ¼ö¼úÇöȲ_¿ùº°_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls"); if (fileName != "" && fileName != null) { datagrid2.saveExcel(fileName, "SheetName", true, true, "", "", false); } break; case "room" : fileName = window.fileDialog("save", ",", false, "ÀÀ±Þ¼ö¼úÇöȲ_¹æº°_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls"); if (fileName != "" && fileName != null) { datagrid3.saveExcel(fileName, "SheetName", true, true, "", "", false); } break; case "day" : fileName = window.fileDialog("save", ",", false, "ÀÀ±Þ¼ö¼úÇöȲ_¿äÀϺ°_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls"); if (fileName != "" && fileName != null) { datagrid3.saveExcel(fileName, "SheetName", true, true, "", "", false); } break; default : break; } } /** * @group : * @ver : 2007.10.17 * @by : * @--------------------------------------------------- * @type : function * @access : public * @desc : ±×¸®µåÀÇ 1Çà¿¡ µ¥ÀÌÅÍ ¾ø´Â ¿­ °¨Ãß±â * @param : * @return : * @--------------------------------------------------- */ function fHiddenGridCol(iGridCnt, pGrid){ if(iGridCnt >1){ for(var i = 1; i < pGrid.cols; i++){ if(pGrid.valuematrix(1, i) == ""){ pGrid.colwidth(i) = 0; } } } }