コード例 #1
0
    public void SetPreviewGrid()
    {
        Biz_Bsc_Interface_Column objCol = new Biz_Bsc_Interface_Column();
        DataSet rDs = objCol.GetAllList(this.IDiCode, gUserInfo.Emp_Ref_ID);

        int    iRow      = 0;
        string sUseYn    = "N";
        string sColKey   = "";
        string sColName  = "";
        int    iDPoints  = 0;
        int    iGridWith = 0;

        UltraGridColumn ugCol;

        if (rDs.Tables.Count > 0)
        {
            iRow = rDs.Tables[0].Rows.Count;
            if (iRow > 0)
            {
                ugCol                           = new UltraGridColumn();
                ugCol.Key                       = "YMD";
                ugCol.BaseColumnName            = "YMD";
                ugCol.Header.Caption            = "평가월";
                ugCol.Width                     = Unit.Pixel(50);
                ugCol.AllowUpdate               = AllowUpdate.No;
                ugCol.DataType                  = "System.String";
                ugCol.CellStyle.HorizontalAlign = HorizontalAlign.Center;
                ugrdPreview.Columns.Add(ugCol);

                ugCol                           = new UltraGridColumn();
                ugCol.Key                       = "DD";
                ugCol.BaseColumnName            = "DD";
                ugCol.Header.Caption            = "발생일자";
                ugCol.Width                     = Unit.Pixel(35);
                ugCol.AllowUpdate               = AllowUpdate.Yes;
                ugCol.DataType                  = "System.String";
                ugCol.Header.Style.Wrap         = true;
                ugCol.CellStyle.HorizontalAlign = HorizontalAlign.Center;
                ugrdPreview.Columns.Add(ugCol);

                for (int i = 0; i < iRow; i++)
                {
                    sUseYn    = rDs.Tables[0].Rows[i]["USE_YN"].ToString();
                    sColKey   = rDs.Tables[0].Rows[i]["COLUMN_ID"].ToString();
                    sColName  = rDs.Tables[0].Rows[i]["COLUMN_ALIAS"].ToString();
                    iDPoints  = Convert.ToInt32(rDs.Tables[0].Rows[i]["DECIMAL_POINTS"].ToString());
                    iGridWith = Convert.ToInt32(rDs.Tables[0].Rows[i]["GRID_WIDTH"].ToString());
                    if (sUseYn == "Y")
                    {
                        if (sColKey.Substring(0, 7) == "SVALUES")
                        {
                            ugCol                           = new UltraGridColumn();
                            ugCol.Key                       = sColKey;
                            ugCol.BaseColumnName            = sColKey;
                            ugCol.Header.Caption            = sColName;
                            ugCol.Width                     = Unit.Pixel(iGridWith);
                            ugCol.DataType                  = "System.String";
                            ugCol.AllowUpdate               = AllowUpdate.Yes;
                            ugCol.CellStyle.HorizontalAlign = HorizontalAlign.Left;
                            ugrdPreview.Columns.Add(ugCol);
                        }
                        else
                        {
                            ugCol                           = new UltraGridColumn();
                            ugCol.Key                       = sColKey;
                            ugCol.BaseColumnName            = sColKey;
                            ugCol.Header.Caption            = sColName;
                            ugCol.Width                     = Unit.Pixel(iGridWith);
                            ugCol.AllowUpdate               = AllowUpdate.Yes;
                            ugCol.DataType                  = "System.Double";
                            ugCol.Format                    = "#,###,###,###,###,###,###,##0" + this.GetFormatPoints(iDPoints);
                            ugCol.CellStyle.HorizontalAlign = HorizontalAlign.Right;
                            ugrdPreview.Columns.Add(ugCol);
                        }
                    }
                }
            }
        }

        Biz_Bsc_Term_Detail objTerm = new Biz_Bsc_Term_Detail();
        string sEstMon = objTerm.GetReleasedMonth();

        Random rndObj = new Random();

        for (int i = 0; i < 11; i++)
        {
            ugrdPreview.Rows.Add();
            for (int j = 0; j < ugrdPreview.Columns.Count; j++)
            {
                if (ugrdPreview.Columns[j].DataType == "System.String")
                {
                    if (ugrdPreview.Columns[j].Key == "YMD")
                    {
                        ugrdPreview.Rows[i].Cells.FromKey(ugrdPreview.Columns[j].Key).Value = sEstMon;
                    }
                    else if (ugrdPreview.Columns[j].Key == "DD")
                    {
                        ugrdPreview.Rows[i].Cells.FromKey(ugrdPreview.Columns[j].Key).Value = Convert.ToString(rndObj.Next(1, 31)).PadLeft(2, '0');
                    }
                    else
                    {
                        ugrdPreview.Rows[i].Cells.FromKey(ugrdPreview.Columns[j].Key).Value = "String" + i.ToString();
                    }
                }
                else if (ugrdPreview.Columns[j].DataType == "System.Date")
                {
                    ugrdPreview.Rows[i].Cells.FromKey(ugrdPreview.Columns[j].Key).Value = DateTime.Now;
                }
                else if (ugrdPreview.Columns[j].DataType == "System.Double")
                {
                    ugrdPreview.Rows[i].Cells.FromKey(ugrdPreview.Columns[j].Key).Value = rndObj.NextDouble() * rndObj.Next(1000, 1000000);
                }
            }
        }

        ugrdPreview.Visible = true;
    }
コード例 #2
0
ファイル: BSC0604S1.aspx.cs プロジェクト: schifflee/bscgit
    public void SetInterfaceGrid()
    {
        Biz_Bsc_Interface_Kpi_Query objQry = new Biz_Bsc_Interface_Kpi_Query(this.IKpiRefID, "");

        this.IDiCode = objQry.IDicode;

        if (this.IDiCode == "")
        {
            ltrScript.Text = JSHelper.GetAlertScript("정의된 Interface가 없습니다.", false);
            return;
        }

        Biz_Bsc_Interface_Column objCol = new Biz_Bsc_Interface_Column();
        DataSet rDs = objCol.GetAllList(this.IDiCode, gUserInfo.Emp_Ref_ID);

        int    iRow      = 0;
        string sUseYn    = "N";
        string sColKey   = "";
        string sColName  = "";
        int    iDPoints  = 0;
        int    iGridWith = 0;

        UltraGridColumn ugCol;

        if (rDs.Tables.Count > 0)
        {
            iRow = rDs.Tables[0].Rows.Count;
            if (iRow > 0)
            {
                ugCol                           = new UltraGridColumn();
                ugCol.Key                       = "TRX_DATE";
                ugCol.BaseColumnName            = "TRX_DATE";
                ugCol.Header.Caption            = "발생일자";
                ugCol.Width                     = Unit.Pixel(100);
                ugCol.AllowUpdate               = AllowUpdate.Yes;
                ugCol.DataType                  = "System.String";
                ugCol.CellStyle.HorizontalAlign = HorizontalAlign.Left;
                ugrdInterface.Columns.Add(ugCol);

                for (int i = 0; i < iRow; i++)
                {
                    sUseYn    = rDs.Tables[0].Rows[i]["USE_YN"].ToString();
                    sColKey   = rDs.Tables[0].Rows[i]["COLUMN_ID"].ToString();
                    sColName  = rDs.Tables[0].Rows[i]["COLUMN_ALIAS"].ToString();
                    iDPoints  = Convert.ToInt32(rDs.Tables[0].Rows[i]["DECIMAL_POINTS"].ToString());
                    iGridWith = Convert.ToInt32(rDs.Tables[0].Rows[i]["GRID_WIDTH"].ToString());
                    if (sUseYn == "Y")
                    {
                        if (sColKey.Substring(0, 7) == "SVALUES")
                        {
                            ugCol                           = new UltraGridColumn();
                            ugCol.Key                       = sColKey;
                            ugCol.BaseColumnName            = sColKey;
                            ugCol.Header.Caption            = sColName;
                            ugCol.Width                     = Unit.Pixel(iGridWith);
                            ugCol.DataType                  = "System.String";
                            ugCol.AllowUpdate               = AllowUpdate.Yes;
                            ugCol.CellStyle.HorizontalAlign = HorizontalAlign.Left;
                            ugrdInterface.Columns.Add(ugCol);
                        }
                        else
                        {
                            ugCol                           = new UltraGridColumn();
                            ugCol.Key                       = sColKey;
                            ugCol.BaseColumnName            = sColKey;
                            ugCol.Header.Caption            = sColName;
                            ugCol.Width                     = Unit.Pixel(iGridWith);
                            ugCol.AllowUpdate               = AllowUpdate.Yes;
                            ugCol.DataType                  = "System.Double";
                            ugCol.Format                    = "#,###,###,###,###,###,###,##0" + this.GetFormatPoints(iDPoints);
                            ugCol.CellStyle.HorizontalAlign = HorizontalAlign.Right;
                            ugrdInterface.Columns.Add(ugCol);
                        }
                    }
                }
            }
        }

        string  sRtnMsg    = "";
        bool    bIsSuccess = false;
        decimal dRtnVal    = 0;
        DataSet rDsQry     = objQry.GetInterfaceData(this.IKpiRefID, this.IYMD, out sRtnMsg, out bIsSuccess);

        ugrdInterface.Clear();
        ugrdInterface.DataSource = rDsQry;
        ugrdInterface.DataBind();

        //dRtnVal = objQry.GetInterfaceResultMs(this.IKpiRefID, this.IYMD, out sRtnMsg, out bIsSuccess);
        //txtResult_Ms.Text = (bIsSuccess) ? dRtnVal.ToString() : "0";

        //dRtnVal = objQry.GetInterfaceResultTs(this.IKpiRefID, this.IYMD.Substring(0,4)+"01", this.IYMD, out sRtnMsg, out bIsSuccess);
        //txtResult_Ts.Text = (bIsSuccess) ? dRtnVal.ToString() : "0";
    }
コード例 #3
0
    /// <summary>
    /// 조회필드 조건필드 설정
    /// </summary>
    public void SetColumnList()
    {
        Biz_Bsc_Interface_Column objCol = new Biz_Bsc_Interface_Column();
        DataSet rDs = objCol.GetAllList(this.IDiCode, gUserInfo.Emp_Ref_ID);

        lstField.Items.Clear();
        lstCondition.Items.Clear();
        lstListField.Items.Clear();

        // Dicode Column 정보 세팅
        if (rDs.Tables.Count > 0)
        {
            int    iRow   = rDs.Tables[0].Rows.Count;
            string sKey   = "";
            string sVal   = "";
            string sUse   = "N";
            bool   bDigit = false;

            for (int i = 0; i < iRow; i++)
            {
                sKey   = rDs.Tables[0].Rows[i]["COLUMN_ID"].ToString();
                sVal   = rDs.Tables[0].Rows[i]["COLUMN_ALIAS"].ToString();
                sUse   = rDs.Tables[0].Rows[i]["USE_YN"].ToString();
                bDigit = (sKey.Substring(0, 7) == "DVALUES") ? true : false;

                if (sUse == "Y" && bDigit)
                {
                    lstField.Items.Add(new ListItem(sVal, sKey));
                    lstCondition.Items.Add(new ListItem(sVal, sKey));
                }
                else if (sUse == "Y" && !bDigit)
                {
                    lstCondition.Items.Add(new ListItem(sVal, sKey));
                }

                lstListField.Items.Add(new ListItem(sVal, sKey));
            }
        }

        // 조건식의 경우 조회조건 파라미터 추가
        if (lstField.Items.Count > 0)
        {
            lstCondition.Items.Add(new ListItem("평가월", "RDTERM"));
            lstCondition.Items.Add(new ListItem("@평가시작월", QueryOperator.ParamFirstYmd));
            lstCondition.Items.Add(new ListItem("@현재평가월", QueryOperator.ParamCurrYmd));
        }

        // 실적데이터 리스트 필드 세팅
        // dicode 정의 후 지표에서 컬럼설정시 정의된 컬럼은 그대로 사용하고 조건식만 변경한다.
        // 즉 같은 dicode를 사용하는 지표의 컬럼은 모두 동일하다
        string sField_Ss = "";
        int    iFRow     = lstListField.Items.Count;

        for (int i = 0; i < iFRow; i++)
        {
            if (i == 0)
            {
                sField_Ss += QueryOperator.LBracket + lstListField.Items[i].Text + QueryOperator.RBracket;
            }
            else
            {
                sField_Ss += ", " + QueryOperator.LBracket + lstListField.Items[i].Text + QueryOperator.RBracket;
            }
        }

        txtField_Ss.Text = sField_Ss;
    }