Example #1
0
    private void BindingItem_P(DataListItemEventArgs e)
    {
        DataRowView dr = (DataRowView)e.Item.DataItem;

        string q_sbj_id     = DataTypeUtility.GetValue(dr["Q_SBJ_ID"]);
        string q_sbj_name   = DataTypeUtility.GetValue(dr["Q_SBJ_NAME"]);
        string q_sbj_define = DataTypeUtility.GetValue(dr["Q_SBJ_DEFINE"]);
        double weight       = DataTypeUtility.GetToDouble(dr["WEIGHT"]);

        Literal         ltrSbjName   = e.Item.FindControl("ltrLevelSbjName") as Literal;
        Literal         ltrSbjDefine = e.Item.FindControl("ltrLevelSbjDefine") as Literal;
        RadioButtonList rBtnList     = e.Item.FindControl("rBtnList") as RadioButtonList;
        TextBox         txtValue     = e.Item.FindControl("txtLevelValue") as TextBox;
        Literal         ltrPointData = e.Item.FindControl("ltrLevelPointData") as Literal;
        DataList        dtList       = e.Item.FindControl("DataList3") as DataList;
        HtmlTableRow    trTextValue  = e.Item.FindControl("trTextValue") as HtmlTableRow;
        HtmlTableCell   tdHeader     = null;
        HtmlTableCell   tdContent    = null;

        if (dtList == null)
        {
            //tdHeader      = Page.FindControl("tdHeader") as HtmlTableCell;
            tdContent = e.Item.FindControl("tdContent") as HtmlTableCell;
        }
        else
        {
            //tdHeader      = e.Item.FindControl("tdHeader") as HtmlTableCell;
            tdContent = dtList.FindControl("tdContent") as HtmlTableCell;
        }

        //TextBoxCommon.SetOnlyInteger(txtValue);

        ltrSbjName.Text   = q_sbj_name;
        ltrSbjDefine.Text = q_sbj_define;

        Biz_QuestionItems questionItems = new Biz_QuestionItems();
        DataSet           ds            = questionItems.GetQuestionItem("", q_sbj_id, Q_OBJ_ID);

        if (ds.Tables[0].Rows.Count == 0)
        {
            rBtnList.Visible = false;
            txtValue.Visible = false;
            txtValue.Width   = Unit.Percentage(100);
        }
        else if (ds.Tables[0].Rows[0]["SUBJECT_ITEM_YN"].ToString() == "1")
        {
            rBtnList.Visible = false;
            txtValue.Visible = true;
            txtValue.Width   = Unit.Percentage(100);
        }
        else
        {
            rBtnList.Visible = true;

            // 만약 질의항목에 설명을 표시할 경우
            if (_q_item_desc_use_yn.Equals("Y"))
            {
                rBtnList.RepeatLayout  = RepeatLayout.Table;
                rBtnList.DataTextField = "Q_ITEM_DESC";
                //tdHeader.Style.Add("width", "260px");

                if (tdContent != null)
                {
                    tdContent.Style.Add("width", "262px");
                }
            }

            // 만약 피드백을 적용할 경우
            if (_feedback_yn.Equals("Y"))
            {
                if (EST_TGT_TYPE.Equals("TGT"))
                {
                    txtValue.ReadOnly = true;
                    rBtnList.Enabled  = false;
                }

                trTextValue.Visible = true;
            }

            rBtnList.DataSource = ds;
            rBtnList.DataBind();

            Biz_QuestionDatas questionDatas = new Biz_QuestionDatas(COMP_ID
                                                                    , EST_ID
                                                                    , ESTTERM_REF_ID
                                                                    , ESTTERM_SUB_ID
                                                                    , this.IESTTERM_STEP_PREVIOUS_SELECT
                                                                    , 0
                                                                    , 0
                                                                    , TGT_DEPT_ID
                                                                    , TGT_EMP_ID
                                                                    , q_sbj_id);
            // 데이타 바인딩
            WebUtility.FindByValueRadioButtonList(rBtnList, questionDatas.Q_Itm_ID);

            if (questionDatas.Point > 0)
            {
                ltrPointData.Text = "<font color=#BF0000>" + DataTypeUtility.GetToInt32_String(questionDatas.Point, "##.#0") + "</font>점";
            }

            //----------------- 라디오버튼 유효성 검사 시작 -------------------

            string clientIDs = "";

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                if (i != 0)
                {
                    clientIDs += ";";
                }

                clientIDs += rBtnList.ClientID + "_" + i.ToString();
            }

            VALID_SCRIPT += string.Format("if(ValidQuestion('{0}', '{1}') == false) return false;", dr["Q_SBJ_NAME"], clientIDs);

            //----------------- 라디오버튼 유효성 검사 끝 -------------------
        }
    }
Example #2
0
    private void BindingItem(DataListItemEventArgs e)
    {
        DataRowView dr = (DataRowView)e.Item.DataItem;

        string q_sbj_id     = DataTypeUtility.GetValue(dr["Q_SBJ_ID"]);
        string q_sbj_name   = DataTypeUtility.GetValue(dr["Q_SBJ_NAME"]);
        string q_sbj_define = DataTypeUtility.GetValue(dr["Q_SBJ_DEFINE"]);
        double weight       = DataTypeUtility.GetToDouble(dr["WEIGHT"]);

        quizWeight.Columns.Add(q_sbj_id, typeof(double));
        if (quizWeight.Rows.Count == 0)
        {
            quizWeight.Rows.Add(weight / 100);
        }
        else
        {
            quizWeight.Rows[0][q_sbj_id] = weight / 100;
        }


        Literal         ltrSbjName   = e.Item.FindControl("ltrLevelSbjName") as Literal;
        Literal         ltrSbjDefine = e.Item.FindControl("ltrLevelSbjDefine") as Literal;
        RadioButtonList rBtnList     = e.Item.FindControl("rBtnList") as RadioButtonList;
        TextBox         txtValue     = e.Item.FindControl("txtLevelValue") as TextBox;
        HiddenField     hdfSubItmYN  = e.Item.FindControl("tmpSubItmYN") as HiddenField;
        Literal         ltrPointData = e.Item.FindControl("ltrLevelPointData") as Literal;
        DataList        dtList       = e.Item.FindControl("DataList3") as DataList;
        HtmlTableCell   tdHeader     = e.Item.FindControl("tdHeader") as HtmlTableCell;
        HtmlTableCell   tdContent    = null;



        if (dtList == null)
        {
            tdContent = e.Item.FindControl("tdContent") as HtmlTableCell;
        }
        else
        {
            tdContent = dtList.FindControl("tdContent") as HtmlTableCell;
        }

        TextBoxCommon.SetOnlyPercent(txtValue);

        ltrSbjName.Text   = q_sbj_name;
        ltrSbjDefine.Text = q_sbj_define;

        Biz_QuestionItems questionItems = new Biz_QuestionItems();
        DataSet           ds            = questionItems.GetQuestionItem("", q_sbj_id, Q_OBJ_ID);

        SUBJECT_ITEM_YN   = ds.Tables[0].Rows[0]["SUBJECT_ITEM_YN"].ToString();
        hdfSubItmYN.Value = SUBJECT_ITEM_YN;

        if (ds.Tables[0].Rows.Count == 0)
        {
            rBtnList.Visible = false;
            txtValue.Visible = false;
            txtValue.Width   = Unit.Percentage(100);
        }
        else if (SUBJECT_ITEM_YN == "1")
        {
            rBtnList.Visible = false;
            txtValue.Visible = true;
            txtValue.Width   = Unit.Percentage(100);

            Biz_Prj_QuestionData questionDatas = new Biz_Prj_QuestionData(COMP_ID
                                                                          , EST_ID
                                                                          , ESTTERM_REF_ID
                                                                          , ESTTERM_SUB_ID
                                                                          , ESTTERM_STEP_ID
                                                                          , EST_DEPT_ID
                                                                          , EST_EMP_ID
                                                                          , PRJ_REF_ID
                                                                          , q_sbj_id);

            txtValueText  = questionDatas.Text_Value;
            txtValue.Text = txtValueText;
        }
        else
        {
            rBtnList.Visible = true;
            txtValue.Visible = false;

            // 만약 질의항목에 설명을 표시할 경우
            if (_q_item_desc_use_yn.Equals("Y"))
            {
                rBtnList.RepeatLayout  = RepeatLayout.Table;
                rBtnList.DataTextField = "Q_ITEM_DESC";
                tdHeader.Style.Add("width", "260px");

                if (tdContent != null)
                {
                    tdContent.Style.Add("width", "262px");
                }
            }

            rBtnList.DataSource = ds;
            rBtnList.DataBind();

            if (READ_ONLY_YN.Equals("N"))
            {
                //Biz_Prj_QuestionData questionDatas = new Biz_Prj_QuestionData(COMP_ID
                //                                                            , EST_ID
                //                                                            , ESTTERM_REF_ID
                //                                                            , ESTTERM_SUB_ID
                //                                                            , ESTTERM_STEP_ID
                //                                                            , EST_DEPT_ID
                //                                                            , EST_EMP_ID
                //                                                            , PRJ_REF_ID
                //                                                            , q_sbj_id);
                //// 데이타 바인딩
                //WebUtility.FindByValueRadioButtonList(rBtnList, questionDatas.Q_Itm_ID);

                Biz_Prj_QuestionData questionDatas = new Biz_Prj_QuestionData(COMP_ID
                                                                              , EST_ID
                                                                              , ESTTERM_REF_ID
                                                                              , ESTTERM_SUB_ID
                                                                              , ESTTERM_STEP_ID
                                                                              , EST_DEPT_ID
                                                                              , EST_EMP_ID
                                                                              , TGT_EMP_ID
                                                                              , PRJ_REF_ID
                                                                              , q_sbj_id);
                // 데이타 바인딩
                WebUtility.FindByValueRadioButtonList(rBtnList, questionDatas.Q_Itm_ID);

                groupNumber += questionDatas.Point;

                if (questionDatas.Point.Equals(0))
                {
                    noneSelectCount = noneSelectCount + 1;
                }


                if (questionDatas.Point > 0)
                {
                    ltrPointData.Text = "<font color=#BF0000>" + DataTypeUtility.GetToInt32_String(questionDatas.Point, "##.#0") + "</font>점";
                    //TOTALPOINT += questionDatas.Point * weight;
                }

                //----------------- 라디오버튼 유효성 검사 시작 -------------------

                string clientIDs = "";

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    if (i != 0)
                    {
                        clientIDs += ";";
                    }

                    clientIDs += rBtnList.ClientID + "_" + i.ToString();
                }

                VALID_SCRIPT += string.Format("if(ValidQuestion('{0}', '{1}') == false) return false;", dr["Q_SBJ_NAME"], clientIDs);

                //----------------- 라디오버튼 유효성 검사 끝 -------------------
            }
        }
    }
Example #3
0
    private void BindingItem_P(DataListItemEventArgs e)
    {
        DataRowView dr           = (DataRowView)e.Item.DataItem;
        string      q_dfn_id     = DataTypeUtility.GetValue(dr["Q_DFN_ID"]);
        string      q_sbj_id     = DataTypeUtility.GetValue(dr["Q_SBJ_ID"]);
        string      q_obj_id     = DataTypeUtility.GetValue(dr["Q_OBJ_ID"]);
        string      q_sbj_define = DataTypeUtility.GetValue(dr["Q_SBJ_DEFINE"]);
        string      q_sbj_desc   = DataTypeUtility.GetValue(dr["Q_SBJ_DESC"]);
        double      weight       = DataTypeUtility.GetToDouble(dr["WEIGHT"]);

        Literal         ltrDefine     = e.Item.FindControl("ltrLevelDefine") as Literal;
        Literal         ltrDesc       = e.Item.FindControl("ltrLevelDesc") as Literal;
        RadioButtonList rBtnList      = e.Item.FindControl("rBtnList") as RadioButtonList;
        TextBox         txtValue      = e.Item.FindControl("txtLevelValue") as TextBox;
        HiddenField     hAttachNo     = e.Item.FindControl("hAttachNo") as HiddenField;
        DropDownList    ddlFileUpload = e.Item.FindControl("ddlFileUpload") as DropDownList;
        ImageButton     ibnDownload   = e.Item.FindControl("ibnDownload") as ImageButton;
        ImageButton     iBtnAttach    = e.Item.FindControl("iBtnAttach") as ImageButton;
        Literal         ltrUpload     = e.Item.FindControl("ltrUpload") as Literal;
        TextBox         txtTextValue  = e.Item.FindControl("txtLevelTextValue") as TextBox;
        TextBox         txtOpinion    = e.Item.FindControl("txtLevelOpinion") as TextBox;
        Literal         ltrPointData  = e.Item.FindControl("ltrLevelPointData") as Literal;
        Label           lblCnt        = e.Item.FindControl("lblCnt") as Label;

        TextBoxCommon.SetOnlyInteger(txtValue);

        ltrUpload.Text = string.Format("<a href='#null' onclick=\"mfUpload('{0}');\"><img src='../images/icon/icon_gr_po05.gif' align='absmiddle' border='0'/></a>", hAttachNo.ClientID);

        ibnDownload.CausesValidation = false;
        ibnDownload.CommandName      = ddlFileUpload.UniqueID;

        ltrDefine.Text = q_sbj_define;
        ltrDesc.Text   = q_sbj_desc;

        DropDownListCommom.BindDefaultValue(ddlFileUpload, "--------------------", "");

        Biz_QuestionItems questionItems = new Biz_QuestionItems();
        DataSet           ds            = questionItems.GetQuestionItem("", q_sbj_id, Q_OBJ_ID);

        if (ds.Tables[0].Rows.Count == 0)
        {
            rBtnList.Visible = false;
            txtValue.Visible = false;
            txtValue.Width   = Unit.Percentage(100);
        }
        else if (ds.Tables[0].Rows[0]["SUBJECT_ITEM_YN"].ToString() == "1")
        {
            rBtnList.Visible = false;
            txtValue.Visible = true;
            txtValue.Width   = Unit.Percentage(100);
        }
        else
        {
            // 평가자인지 피평가인지 따라
            if (EST_TGT_TYPE.Equals("EST"))
            {
                ibnDownload.Visible = true;
                ltrUpload.Visible   = false;
            }
            else if (EST_TGT_TYPE.Equals("TGT"))
            {
                ibnDownload.Visible = true;
                ltrUpload.Visible   = true;
                rBtnList.Visible    = false;
                txtOpinion.Visible  = false;
            }

            txtValue.Visible = false;

            // 만약 질의항목에 설명을 표시할 경우
            if (_q_item_desc_use_yn.Equals("Y"))
            {
                rBtnList.RepeatLayout  = RepeatLayout.Table;
                rBtnList.DataTextField = "Q_ITEM_DESC";
            }

            rBtnList.DataSource = ds;
            rBtnList.DataBind();

            Biz_QuestionDatas questionDatas = new Biz_QuestionDatas(COMP_ID
                                                                    , EST_ID
                                                                    , ESTTERM_REF_ID
                                                                    , ESTTERM_SUB_ID
                                                                    , this.IESTTERM_STEP_PREVIOUS_SELECT
                                                                    , 0
                                                                    , 0
                                                                    , TGT_DEPT_ID
                                                                    , TGT_EMP_ID
                                                                    , q_sbj_id);
            // 데이타 바인딩

            WebUtility.FindByValueRadioButtonList(rBtnList, questionDatas.Q_Itm_ID);
            TOTALPOINT += questionDatas.Point * weight;

            txtTextValue.Text = questionDatas.Text_Value;
            txtOpinion.Text   = questionDatas.Opinion;
            ltrPointData.Text = DataTypeUtility.GetToInt32_String(questionDatas.Point, "##.#0");
            hAttachNo.Value   = questionDatas.Attach_NO;

            SetUploadFileInfo(hAttachNo.Value, ddlFileUpload);

            if (ddlFileUpload.Items.Count > 1)
            {
                lblCnt.Text = string.Format("({0}건)", ddlFileUpload.Items.Count - 1);
            }

            //----------------- 라디오버튼 유효성 검사 시작 -------------------

            string clientIDs = "";

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                if (i != 0)
                {
                    clientIDs += ";";
                }

                clientIDs += rBtnList.ClientID + "_" + i.ToString();
            }

            VALID_SCRIPT += string.Format("if(ValidQuestion('{0}', '{1}') == false) return false;", dr["Q_SBJ_NAME"], clientIDs);

            //----------------- 라디오버튼 유효성 검사 끝 -------------------
        }
    }