기존 자바스크립트 document.Form1.clock... 가 null 떠서 --

변환후 소스를 보니 <form id="xx" > .. 허걱.. 보통 생기는 name이 없어서 였다.

IIS설정 죽자고 찾아봐도 잘안나오고..

그냥 .. --

web.config 항목에.. <system.web> 사이에

저한줄 넣으면 됨..

<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>

 

Posted by 말없제이
,

/// <summary>
  ///  자율관리-품질지적 일때
  /// </summary>
  /// <param name="curr_page">현제 페이지</param>
  /// <param name="page_size">페이지당 갯수</param>
  public DataSet Select_CMM_INDI_MST_ddlSearch_QUALITY_1(string pjt_cd, string mdul_cd, string nod_cd, string subc_idx, string str, string RegNm, string ComNm, string GjongNm, string GbnNm, string DocStatus, int curr_page, int page_size)
  {
   // 페이지 항목
   string strPage = "";
   // 검색항목
   string strWhere = " WHERE (C1.PJT_CD = @pjt_cd) AND (C1.MDUL_CD = @mdul_cd) AND (C1.NOD_CD LIKE @nod_cd) ";

   if (str == "C")
   {
    strWhere += @" AND (C1.SUBC_IDX = " + subc_idx.Replace("'", "''") + ") ";
   }
   else
   {
    strWhere += "";
   }

   if (RegNm != null && RegNm != "")
   {
    strWhere += "         AND C1.REG_ID LIKE '%" + RegNm.Replace("'", "''") + "%' ";
   }

   if (ComNm != null && ComNm != "")
   {
    strWhere += "         AND C1.SUBC_IDX LIKE '%" + ComNm.Replace("'", "''") + "%' ";
   }

   if (GjongNm != null && GjongNm != "")
   {
    strWhere += "         AND C1.SAFTY_GJONG_CD LIKE '%" + GjongNm.Replace("'", "''") + "%' ";
   }

   if (GbnNm != null && GbnNm != "")
   {
    strWhere += "         AND C1.SAFTY_GBN_CD LIKE '%" + GbnNm.Replace("'", "''") + "%' ";
   }

   if (DocStatus != null && DocStatus != "")
   {
    strWhere += "         AND C1.DOC_STATUS LIKE '%" + DocStatus.Replace("'", "''") + "%' ";
   }

   // 페이지 조건
   if (page_size > 0)
   {
    strPage = "  ROW_NO BETWEEN " + (curr_page * page_size + 1) + " AND " + ((curr_page + 1) * page_size) + " ";
   }

   // 기본 정의 SQL
   string strBaseSql = @" FROM       CMM_INDI_MST AS C1
INNER JOIN SYS_ENTCD_MST S1
 ON  C1.SAFTY_GJONG_CD = S1.ENTCD
   AND S1.PJT_CD = C1.PJT_CD
   AND S1.CLS_CD = 'QGON'
INNER JOIN SYS_ENTCD_MST S2
 ON  C1.SAFTY_GBN_CD = S2.ENTCD
   AND S2.PJT_CD = C1.PJT_CD
   AND S2.CLS_CD = 'QTYP'
";
   // 넘겨줄 SQL
   string SQL = @"
-- 페이지항목만 임시테이블변수로 저장
SELECT C1.ORI_ROW_NO AS ROW_NO, C1.INDI_IDX
INTO #T_SEARCH
FROM
(
SELECT
 ROW_NUMBER() OVER(ORDER BY C1.INDI_IDX) AS ORI_ROW_NO  -- 반환할 Row_no
 , ROW_NUMBER() OVER(ORDER BY C1.INDI_IDX DESC) AS ROW_NO -- 페이지 비교할 Row_No.
 , C1.INDI_IDX
"
+ strBaseSql + strWhere +
" ) AS C1 WHERE "
+ strPage+
@"

-- 조회값 Table[0]
SELECT TS.ROW_NO, C2.COM_NM, SUBSTRING(CONVERT(VARCHAR, C1.INDI_DD, 121), 1, 10) AS INDI_DD, C1.REG_ID, C1.SUBC_IDX, C1.TTL, SUBSTRING(CONVERT(VARCHAR,
 C1.DISP_RR, 121), 1, 10) AS DISP_RR, C1.DOC_STATUS, C1.INDI_IDX, C1.MDUL_CD, C1.NOD_CD, C3.MSURE_IDX, U1.USER_NM, C1.PJT_CD,
 C1.SAFTY_GJONG_CD, C1.SAFTY_GBN_CD, S1.CD_NM AS SAFTY_GJONG_NM, S2.CD_NM AS SAFETY_GBN_NM,
(CASE WHEN C1.SAFTY_GJONG_CD = '1' THEN '품질'
 WHEN C1.SAFTY_GJONG_CD = '2' THEN '안전'
 WHEN C1.SAFTY_GJONG_CD = '3' THEN '환경' ELSE '' END) AS GJONG_NM
FROM       CMM_INDI_MST AS C1
INNER JOIN #T_SEARCH AS TS
 ON  C1.INDI_IDX = TS.INDI_IDX
LEFT OUTER JOIN CDR_SUBC_MST AS C2
 ON  C1.SUBC_IDX = C2.SUBC_IDX
  AND C2.DEL_YN = 'N'
LEFT OUTER JOIN CMM_INDI_RSPN AS C3
 ON  C3.INDI_IDX = C1.INDI_IDX
LEFT OUTER JOIN SYS_USER_MST AS U1
 ON  C1.REG_ID = U1.USER_ID
INNER JOIN SYS_ENTCD_MST S1
 ON  C1.SAFTY_GJONG_CD = S1.ENTCD
  AND S1.PJT_CD = C1.PJT_CD
  AND S1.CLS_CD = 'QGON'
INNER JOIN SYS_ENTCD_MST S2
 ON  C1.SAFTY_GBN_CD = S2.ENTCD
  AND S2.PJT_CD = C1.PJT_CD
  AND S2.CLS_CD = 'QTYP'
ORDER BY ROW_NO DESC
";
   SQL += @"

-- 총카운터 Table[1]
SELECT COUNT(*) AS CNT
"

Posted by 말없제이
,

년도 구하고 윤달구해야 한다고 복잡하게 생각했는데..  그냥 0일로 넣으면 월의 마지막날이 나옴 - -

<script>
alert(new Date('2012','03','0').getDate());
alert(new Date('2012','02','0'));
</script>
<html>
<head></head>
<body>
<input type="text"
<input id="txtNo" type="password" style="display:none;" />
<script>
 alert(document.getElementById("txtNo").value);
</script>
</body>
</html>

 

Posted by 말없제이
,

구글검색 DataTable.Select에 그룹방법(DISTINCT)
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/e6f7e2d7-662c-49d1-b56e-71dcd06ddbf5

Q : How??
myTable is a DataTable
DataRow[] DataRows = myTable.Select("DISTINCT FirstName");
return DataRows

A : DataTable.Select is not.
DataTable nonDistinctTable;
// fill the non distinct table...

// If the table has all the data and doesn't need filtering you can do the following...
DataTable distinctTable = table.DefaultView.ToTable("DistinctTable", true, "Col1");

// If the table needs further filtering you can use the DataView to filter, then 'convert' to a DataTable...
DataView view = table.DefaultView;
// set the row filtering on the view...
view.RowFilter = "Col1 = 'XYZ'";
// then get the distinct table...
DataTable distinctTable = view.ToTable("DistinctTable", true, "Col1");

ex --------------------------

  string strDivYstNig = "";

  DataTable dtRepYstNigGrp = ds.Tables[1].DefaultView.ToTable("DistinctTable", true, "CD_NM");
  for (int i = 0; i < dtRepYstNigGrp.Rows.Count; i++)
  {
   string strColNm = dtRepYstNigGrp.Rows[i]["CD_NM"].ToString();
   int iColNm = ds.Tables[1].Select(string.Format(" CD_NM = '{0}' ", strColNm)).Length;
   strDivYstNig += strColNm + ";" + iColNm.ToString() + ";";
  }

  lblMangerNm.Text = strDivYstNig;

Posted by 말없제이
,

DataTable 부분합.

DevTool/C# 2012. 5. 7. 09:33

DataTable 부분합.

 

부분합.
protected int intORDR_QTY = 0;
protected int intORDR_QTY_T = 0;
protected int intST_QTY = 0;
protected int intST_QTY_T = 0;
protected int intIN_QTY = 0;
protected int intIN_QTY_T = 0;
protected int intPLAC_QTY = 0;
protected int intPLAC_QTY_T = 0;

protected string strCOM_CD = string.Empty;
 

DataTable dt = Biz.SELECT_RSC_RM_IS_PL_LST_3(Dic);

        if (dt != null)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {


                if (strCOM_CD == dt.Rows[i]["COM_CD"].ToString())
                {
                    intORDR_QTY += int.Parse(dt.Rows[i]["ORDR_QTY"].ToString());
                    intST_QTY += int.Parse(dt.Rows[i]["ST_QTY"].ToString());
                    intIN_QTY += int.Parse(dt.Rows[i]["IN_QTY"].ToString());
                    intPLAC_QTY += int.Parse(dt.Rows[i]["PLAC_QTY"].ToString());
                }
                else
                {
                    if (!string.IsNullOrEmpty(strCOM_CD))
                    {
                        DataRow dr = dt.NewRow();
                        dr["COM_NM"] = "소계";
                        dr["COM_CD"] = "SUB";
                        dr["ORDR_QTY"] = intORDR_QTY.ToString();
                        dr["ST_QTY"] = intST_QTY.ToString();
                        dr["IN_QTY"] = intIN_QTY.ToString();
                        dr["PLAC_QTY"] = intPLAC_QTY.ToString();

                        dt.Rows.InsertAt(dr, i);
                        i++;
                    }

                    intORDR_QTY_T += intORDR_QTY;
                    intST_QTY_T += intST_QTY;
                    intIN_QTY_T += intIN_QTY;
                    intPLAC_QTY_T += intPLAC_QTY;

                    strCOM_CD = dt.Rows[i]["COM_CD"].ToString();

                    intORDR_QTY = int.Parse(dt.Rows[i]["ORDR_QTY"].ToString());
                    intST_QTY = int.Parse(dt.Rows[i]["ST_QTY"].ToString());
                    intIN_QTY = int.Parse(dt.Rows[i]["IN_QTY"].ToString());
                    intPLAC_QTY = int.Parse(dt.Rows[i]["PLAC_QTY"].ToString());
                }
            }

            if (!string.IsNullOrEmpty(strCOM_CD))
            {
                DataRow dr = dt.NewRow();
                dr["COM_NM"] = "소계";
                dr["COM_CD"] = "SUB";
                dr["ORDR_QTY"] = intORDR_QTY.ToString();
                dr["ST_QTY"] = intST_QTY.ToString();
                dr["IN_QTY"] = intIN_QTY.ToString();
                dr["PLAC_QTY"] = intPLAC_QTY.ToString();

                dt.Rows.InsertAt(dr, dt.Rows.Count);

                intORDR_QTY_T += intORDR_QTY;
                intST_QTY_T += intST_QTY;
                intIN_QTY_T += intIN_QTY;
                intPLAC_QTY_T += intPLAC_QTY;

                DataRow dr_T = dt.NewRow();
                dr_T["COM_NM"] = "합계";
                dr_T["COM_CD"] = "TOTAL";
                dr_T["ORDR_QTY"] = intORDR_QTY_T.ToString();
                dr_T["ST_QTY"] = intST_QTY_T.ToString();
                dr_T["IN_QTY"] = intIN_QTY_T.ToString();
                dr_T["PLAC_QTY"] = intPLAC_QTY_T.ToString();

                dt.Rows.InsertAt(dr_T, dt.Rows.Count);

                lblTotalST_QTY.Text = intST_QTY_T.ToString();
                lblTotalIN_QTY.Text = intIN_QTY_T.ToString();
            }

Posted by 말없제이
,
SelectBox Item(셀렉터박스) 아이템

<html>
<head>
 <title>http://www.blueb.co.kr</title>


<SCRIPT LANGUAGE="JavaScript">
<!--
function move(fbox,tbox) {
 var i = 0;
 if(fbox.value != "") {
 var no = new Option();
  no.value = fbox.value;
  no.text = fbox.value;
  tbox.options[tbox.options.length] = no;
  fbox.value = "";
   }
}
function remove(box) {
 for(var i=0; i<box.options.length; i++) {
 if(box.options[i].selected && box.options[i] != "") {
  box.options[i].value = "";
  box.options[i].text = "";
    }
 }
 BumpUp(box);
}
function BumpUp(abox) {
 for(var i = 0; i < abox.options.length; i++) {
 if(abox.options[i].value == "")  {
 for(var j = i; j < abox.options.length - 1; j++)  {
  abox.options[j].value = abox.options[j + 1].value;
  abox.options[j].text = abox.options[j + 1].text;
 }
 var ln = i;
 break;
   }
}
 if(ln < abox.options.length)  {
  abox.options.length -= 1;
  BumpUp(abox);
   }
}
function Moveup(dbox) {
 for(var i = 0; i < dbox.options.length; i++) {
 if (dbox.options[i].selected && dbox.options[i] != "" && dbox.options[i] != dbox.options[0]) {
 var tmpval = dbox.options[i].value;
 var tmpval2 = dbox.options[i].text;
  dbox.options[i].value = dbox.options[i - 1].value;
  dbox.options[i].text = dbox.options[i - 1].text
  dbox.options[i-1].value = tmpval;
  dbox.options[i-1].text = tmpval2;
      }
   }
}
function Movedown(ebox) {
 for(var i = 0; i < ebox.options.length; i++) {
 if (ebox.options[i].selected && ebox.options[i] != "" && ebox.options[i+1] != ebox.options[ebox.options.length]) {
 var tmpval = ebox.options[i].value;
 var tmpval2 = ebox.options[i].text;
  ebox.options[i].value = ebox.options[i+1].value;
  ebox.options[i].text = ebox.options[i+1].text
  ebox.options[i+1].value = tmpval;
  ebox.options[i+1].text = tmpval2;
      }
   }
}
//-->
</script>

</HEAD>

<BODY>

<form ACTION="" METHOD="POST">
<table>
<tr>
 <td colspan=2>
  <input type="text" name="list1" size=21 value=""> <input type="button" value="추가" onclick="move(this.form.list1,this.form.list2)" name="B1" style="width:60">

 </td>
</tr>
<tr>
 <td>
  <select multiple size=7 name="list2" style="width:160">
  <option value="one">하나</option>
  <option value="two">둘</option>
  <option value="three">셋</option>
  <option value="four">넷</option>
  <option value="five">다섯</option>
  <option value="six">여섯</option>
  </select>
 </td>
 <td>
  <input type="button" value="삭제" onclick="remove(this.form.list2)" name="B2" style="width:60">

  <input type="button" value="위로" onclick="Moveup(this.form.list2)" name="B3" style="width:60">

  <input type="button" value="아래로" onclick="Movedown(this.form.list2)" name="B4" style="width:60">
 </td>
</tr>
</table>
</form>

</BODY>
</HTML>

selectBox-ex.html

Posted by 말없제이
,

DIV 스크롤.

DevTool/HTML 2012. 4. 18. 11:05

<div style="width:740px; height:410px; overflow-y:scroll;" >
</div>

Posted by 말없제이
,

function isHangul(sVal)
{
  var sBit = '';

  for(i=0;i<sVal.length;i++)
  {
    sBit = sVal.charAt(i);
    if(escape( sBit ).length <= 4)
    {
   alert("한글만 입력하십시오.");
      return false;
    }
  }
  return true;
}

 

Posted by 말없제이
,

// 문자 Count
function cal_byte()
{
    var aquery = document.getElementById("<%=txtMessage.ClientID%>").value;
 var tmpStr;
 var temp=0;
 var onechar;
 var tcount;
 tcount = 0;

 tmpStr = new String(aquery);
 temp = tmpStr.length;

 for (k = 0; k < temp; k++)
 {
  onechar = tmpStr.charAt(k);
  
  if (escape(onechar) =='%0D')
  {
  }
  else if(escape(onechar).length > 4)
  {
      tcount += 2;
  }
  else
  {
      tcount++;
        }
 }
   
    document.getElementById("<%=txtByte.ClientID %>").innerHTML = tcount;
   
    if(tcount > 80)
    {
  reserve = tcount - 78;
  alert("문자는 80바이트를 넘을수 없습니다." );
  cutText(); 
 } 
}

// OverFlow 문자 자르기
function cutText()
{
 nets_check(document.getElementById("<%=txtMessage.ClientID%>").value);
}

// OverFlow 문자 자르기
function nets_check(aquery)
{
 var tmpStr;
 var temp=0;
 var onechar;
 var tcount;
 tcount = 0;

 tmpStr = new String(aquery);
 temp = tmpStr.length;

 for(k = 0; k < temp; k++)
 {
  onechar = tmpStr.charAt(k);

  if(escape(onechar).length > 4)
  {
   tcount += 2;
  }
  else
  {
   tcount++;
  }

  if(tcount > 80)
  {
   tmpStr = tmpStr.substring(0, k);
   break;
  }
 }
  
 document.getElementById("<%=txtMessage.ClientID%>").value = tmpStr;
 cal_byte();
}

Posted by 말없제이
,

//원하는 케릭터형 모드 Replace
String.prototype.trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/gi, "");
}

String.prototype.replaceAll = function(str1, str2)
{
    var temp_str = "";
   
    if(this.trim() != "" && str1 != str2)
    {
        temp_str = this.trim();
       
        while(temp_str.indexOf(str1) > -1)
        {
            temp_str = temp_str.replace(str1, str2);
        }
    }
   
    return temp_str;
}

Posted by 말없제이
,