コード例 #1
0
    private void CreateDataGrid()
    {
        TemplateColumn templeatCol = null;

        DeptInfos deptInfo = new DeptInfos();

        dsDept = deptInfo.GetEstDeptListByLevel(int.Parse(DeptID));

        foreach (DataRow dr in dsDept.Tables[0].Rows)
        {
            /* 2011-08-29 수정 : DataGrid에서 UltraDataGrid로 변환으로 변경 필요
             * templeatCol                             = new TemplateColumn();
             * templeatCol.HeaderTemplate              = new DGridTemplete(ListItemType.Header, dr["DEPT_NAME"].ToString(), "");
             * templeatCol.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
             * templeatCol.ItemTemplate                = new DGridTemplete(ListItemType.Item, "C_" + dr["EST_DEPT_REF_ID"].ToString());
             * templeatCol.ItemStyle.HorizontalAlign   = HorizontalAlign.Center;
             * DataGrid1.Columns.Add(templeatCol);
             */
            Infragistics.WebUI.UltraWebGrid.TemplatedColumn tempCol = new Infragistics.WebUI.UltraWebGrid.TemplatedColumn();
            DataGrid1.Bands[0].Columns.Add(tempCol);
        }
    }
コード例 #2
0
    private void SavePDTData()
    {
        Biz_PDTAndAHPStgEstDeptDatas pDTAndAHPStgEstDeptDatas = new Biz_PDTAndAHPStgEstDeptDatas();

        DataTable stgdData = new DataTable();
        DataRow   dr       = null;

        stgdData.Columns.Add("STG_REF_ID", typeof(int));
        stgdData.Columns.Add("UP_STG_ID", typeof(int));
        stgdData.Columns.Add("STG_MAP_YN", typeof(string));
        stgdData.Columns.Add("F_YN", typeof(string));
        stgdData.Columns.Add("C_YN", typeof(string));
        stgdData.Columns.Add("P_YN", typeof(string));
        stgdData.Columns.Add("L_YN", typeof(string));

        /* 2011-08-29 수정 : Grid에서 UltraWebGrid로 변경에 따른 수정 필요
         * foreach (DataGridItem item in DataGrid1.Items)
         * {
         *  dr                  = stgdData.NewRow();
         *  dr["STG_REF_ID"]    = (item.Cells[0].FindControl("lblStgRefID") as Label).Text;
         *  dr["UP_STG_ID"]     = 0;
         *  dr["STG_MAP_YN"]    = ((item.Cells[1].FindControl("cBoxStgMap") as CheckBox).Checked) ? "Y":"N";
         *  dr["F_YN"]          = ((item.Cells[2].FindControl("cBoxF") as CheckBox).Checked)? "Y":"N";
         *  dr["C_YN"]          = ((item.Cells[2].FindControl("cBoxC") as CheckBox).Checked)? "Y":"N";
         *  dr["P_YN"]          = ((item.Cells[2].FindControl("cBoxP") as CheckBox).Checked)? "Y":"N";
         *  dr["L_YN"]          = ((item.Cells[2].FindControl("cBoxL") as CheckBox).Checked)? "Y":"N";
         *  stgdData.Rows.Add(dr);
         * }
         */

        DataTable estDeptData = new DataTable();

        estDeptData.Columns.Add("EST_DEPT_REF_ID", typeof(int));
        estDeptData.Columns.Add("STG_REF_ID", typeof(int));
        estDeptData.Columns.Add("CHECK_YN", typeof(string));

        DeptInfos deptInfo = new DeptInfos();

        if (txtDeptID.Text != "")
        {
            DataSet ds = deptInfo.GetEstDeptListByLevel(int.Parse(txtDeptID.Text));

            foreach (DataRow deptRow in ds.Tables[0].Rows)
            {
                /* 2011-08-29 수정 : Grid에서 UltraWebGrid로 변경에 따른 수정 필요
                 * foreach (DataGridItem item in DataGrid1.Items)
                 * {
                 *  CheckBox cBox_YN = item.FindControl("C_" + deptRow["EST_DEPT_REF_ID"].ToString()) as CheckBox;
                 *
                 *  if (cBox_YN != null)
                 *  {
                 *      dr                      = estDeptData.NewRow();
                 *      dr["EST_DEPT_REF_ID"]   = deptRow["EST_DEPT_REF_ID"].ToString();
                 *      dr["STG_REF_ID"]        = (item.Cells[0].FindControl("lblStgRefID") as Label).Text;
                 *      dr["CHECK_YN"]          = (cBox_YN.Checked) ? "Y" : "N";
                 *      dr["CHECK_YN"]          = (!cBox_YN.Visible) ? "N" : dr["CHECK_YN"].ToString();
                 *      estDeptData.Rows.Add(dr);
                 *  }
                 * }
                 */
            }
        }
        else
        {
        }

        bool isOK = pDTAndAHPStgEstDeptDatas.AddPDTAndAHPStgEstDeptDatas(PageUtility.GetIntByValueDropDownList(ddlStgVersion)
                                                                         , PageUtility.GetIntByValueDropDownList(ddlEstTermInfo)
                                                                         , stgdData
                                                                         , estDeptData
                                                                         , int.Parse(DeptID)
                                                                         , EMP_REF_ID);



        if (isOK)
        {
            ltrScript.Text = JSHelper.GetAlertScript("정상적으로 등록되었습니다.", false);
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("처리 중 오류가 발생하였습니다.", false);
        }
    }