/// <summary>
        /// Interface Info And Interface Column 처리
        /// </summary>
        /// <param name="con"></param>
        /// <param name="trx"></param>
        /// <param name="idicode"></param>
        /// <param name="iname"></param>
        /// <param name="idefinition"></param>
        /// <param name="iuse_yn"></param>
        /// <param name="itxr_user"></param>
        /// <param name="iDtCol">COLUMN_ID, COLUMN_ALIAS, LOV_YN, SORT_ORDER, DECIMAL_POINTS, GRID_WIDTH, USE_YN</param>
        /// <returns></returns>
        public bool InsertDiCodeColumn(IDbConnection con, IDbTransaction trx, string idicode, string iname, int isource_id, string iinput_type, string idefinition, string iuse_yn, string iquery, int itxr_user, DataTable iDtCol, string idailykpi_yn)
        {
            MicroBSC.Integration.BSC.Dac.Dac_Bsc_Interface_Dicode dacBscDI = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Interface_Dicode();

            if (con == null)
            {
                con = DbAgentHelper.CreateDbConnection();
                con.Open();
            }

            if (trx == null)
            {
                trx = con.BeginTransaction();
            }

            bool blnRtn = false;
            int  iRtn   = 0;

            try
            {
                //iRtn = base.UpdateData_Dac(con, trx, idicode, iname, isource_id, iinput_type, idefinition, iuse_yn, iquery, itxr_user, idailykpi_yn);
                DataTable dt = dacBscDI.Select_DB(con, trx, idicode);
                if (dt.Rows.Count > 0)
                {
                    iRtn = dacBscDI.Update_DB(con, trx, iname, isource_id, iinput_type, idefinition, iuse_yn, iquery, itxr_user, idailykpi_yn, idicode);
                }
                else
                {
                    iRtn = dacBscDI.Insert_DB(con, trx, idicode, iname, isource_id, iinput_type, idefinition, iuse_yn, iquery, itxr_user, idailykpi_yn);
                }


                //if (base.Transaction_Result == "Y")
                if (iRtn > 0)
                {
                    Biz_Bsc_Interface_Column objCol = new Biz_Bsc_Interface_Column();
                    for (int i = 0; i < iDtCol.Rows.Count; i++)
                    {
                        objCol.IColumn_Id      = iDtCol.Rows[i]["COLUMN_ID"].ToString();
                        objCol.IColumn_Alias   = iDtCol.Rows[i]["COLUMN_ALIAS"].ToString();
                        objCol.ILov_Yn         = iDtCol.Rows[i]["LOV_YN"].ToString();
                        objCol.ISort_Order     = Convert.ToInt32(iDtCol.Rows[i]["SORT_ORDER"].ToString());
                        objCol.IUnit_Ref_Id    = Convert.ToInt32(iDtCol.Rows[i]["UNIT_REF_ID"].ToString());
                        objCol.IDecimal_Points = Convert.ToInt32(iDtCol.Rows[i]["DECIMAL_POINTS"].ToString());
                        objCol.IGrid_Width     = Convert.ToInt32(iDtCol.Rows[i]["GRID_WIDTH"].ToString());
                        objCol.IUse_Yn         = iDtCol.Rows[i]["USE_YN"].ToString();


                        iRtn += objCol.UpdateData
                                    (con
                                    , trx
                                    , idicode
                                    , objCol.IColumn_Id
                                    , objCol.IColumn_Alias
                                    , objCol.ILov_Yn
                                    , objCol.ISort_Order
                                    , objCol.IUnit_Ref_Id
                                    , objCol.IDecimal_Points
                                    , objCol.IGrid_Width
                                    , objCol.IUse_Yn
                                    , itxr_user);

                        if (objCol.Transaction_Result == "N")
                        {
                            base.Transaction_Message = objCol.Transaction_Message;
                            trx.Rollback();
                            blnRtn = false;
                        }
                    }

                    trx.Commit();
                    blnRtn = true;
                }
                else
                {
                    trx.Rollback();
                    blnRtn = false;
                }
            }
            catch (Exception e)
            {
                base.Transaction_Message = e.Message;
                trx.Rollback();
                blnRtn = false;
            }
            finally
            {
                con.Close();
                con.Dispose();
            }

            return(blnRtn);
        }
Example #2
0
    private void DoBinding()
    {
        try
        {
            ugrdResult.Clear();
            Dundas.Charting.WebControl.Chart objChart = this.chat1;

            Dundas.Charting.WebControl.SeriesChartType scType;
            scType = FindChartType();

            //objChart.ChartAreas.Clear();

            MicroBSC.Estimation.Biz.Biz_TermInfos objTerms = new MicroBSC.Estimation.Biz.Biz_TermInfos(PageUtility.GetIntByValueDropDownList(ddlEstTerm));
            string sYMD = objTerms.Est_StartDate.Year.ToString() + PageUtility.GetByValueDropDownList(ddlMonth);
            string ymd1 = string.Empty;
            string ymd3 = string.Empty;
            if (sYMD.Substring(4, 2) == "01")
            {
                ymd1 = (DataTypeUtility.GetToInt32(sYMD.Substring(0, 4)) - 1).ToString() + "12";
                ymd3 = sYMD.Substring(0, 4) + (DataTypeUtility.GetToInt32(sYMD.Substring(4, 2)) + 1).ToString("00");
            }
            else if (sYMD.Substring(4, 2) == "12")
            {
                ymd1 = sYMD.Substring(0, 4) + (DataTypeUtility.GetToInt32(sYMD.Substring(4, 2)) - 1).ToString("00");
                ymd3 = (DataTypeUtility.GetToInt32(sYMD.Substring(0, 4)) + 1).ToString() + "01";
            }
            else
            {
                ymd1 = sYMD.Substring(0, 4) + (DataTypeUtility.GetToInt32(sYMD.Substring(4, 2)) - 1).ToString("00");
                ymd3 = sYMD.Substring(0, 4) + (DataTypeUtility.GetToInt32(sYMD.Substring(4, 2)) + 1).ToString("00");
            }
            MicroBSC.BSC.Biz.Biz_Bsc_Interface_Column objUnit = new MicroBSC.BSC.Biz.Biz_Bsc_Interface_Column();
            lblUnit.Text = "";
            DataTable dtUnit = objUnit.GetOneList(PageUtility.GetByValueDropDownList(ddlDiCode), "DVALUES1", 0).Tables[0];

            if (dtUnit.Rows.Count > 0)
            {
                MicroBSC.Biz.Common.UnitTypeInfos objUnitInfo = new MicroBSC.Biz.Common.UnitTypeInfos(DataTypeUtility.GetToInt32(dtUnit.Rows[0]["UNIT_REF_ID"]));
                lblUnit.Text = "단위 : " + objUnitInfo.Unit;
            }

            MicroBSC.BSC.Biz.Biz_Bsc_Interface_Data objInterface = new MicroBSC.BSC.Biz.Biz_Bsc_Interface_Data();
            DataTable dtResult = objInterface.GetInterfaceDataForDayResult(PageUtility.GetByValueDropDownList(ddlDiCode), sYMD, PageUtility.GetByValueDropDownList(ddlSumType));

            ugrdResult.DataSource = dtResult;
            ugrdResult.DataBind();

            dtResult = objInterface.GetInterfaceDataForDayResultGraph(PageUtility.GetByValueDropDownList(ddlDiCode), sYMD, PageUtility.GetByValueDropDownList(ddlSumType));

            MicroCharts.DundasCharts.DundasChartBase(objChart, Dundas.Charting.WebControl.ChartImageType.Flash, 980, 420
                                                     , Dundas.Charting.WebControl.BorderSkinStyle.Emboss, System.Drawing.Color.FromArgb(181, 64, 1), 2
                                                     , System.Drawing.Color.FromArgb(0xFF, 0xFF, 0xFE)
                                                     , System.Drawing.Color.FromArgb(0xFF, 0xFF, 0xFE)
                                                     , System.Drawing.Color.FromArgb(0x20, 0x80, 0xD0)
                                                     , Dundas.Charting.WebControl.ChartDashStyle.Solid
                                                     , -1
                                                     , Dundas.Charting.WebControl.ChartHatchStyle.None
                                                     , Dundas.Charting.WebControl.GradientType.TopBottom
                                                     , Dundas.Charting.WebControl.AntiAliasing.None);

            objChart.DataSource = dtResult;
            objChart.Series.Clear();

            Dundas.Charting.WebControl.Series series1
                = MicroCharts.DundasCharts.CreateSeries(objChart
                                                        , "sp1"
                                                        , "Default"
                                                        , (PageUtility.GetByValueDropDownList(ddlSumType) == "1" ? ymd1.Substring(0, 4) + "년 " + ymd1.Substring(4, 2) + "월" : "3개월 합계")
                                                        , null
                                                        , scType
                                                        , 3
                                                        , System.Drawing.Color.FromArgb(240, 87, 112, 218)
                                                        , System.Drawing.Color.FromArgb(180, 26, 59, 105)
                                                        , System.Drawing.Color.Transparent
                                                        , 1
                                                        , 9
                                                        , System.Drawing.Color.FromArgb(64, 64, 64));
            Dundas.Charting.WebControl.Series series2 = MicroCharts.DundasCharts.CreateSeries(objChart, "sp2", "Default", sYMD.Substring(0, 4) + "년 " + sYMD.Substring(4, 2) + "월", null, scType, 3, System.Drawing.Color.FromArgb(240, 248, 134, 6), System.Drawing.Color.FromArgb(180, 26, 59, 105), System.Drawing.Color.Transparent, 1, 9, System.Drawing.Color.FromArgb(64, 64, 64));
            Dundas.Charting.WebControl.Series series3 = MicroCharts.DundasCharts.CreateSeries(objChart, "sp3", "Default", ymd3.Substring(0, 4) + "년 " + ymd3.Substring(4, 2) + "월", null, scType, 3, System.Drawing.Color.FromArgb(240, 10, 190, 207), System.Drawing.Color.FromArgb(180, 26, 59, 105), System.Drawing.Color.Transparent, 1, 9, System.Drawing.Color.FromArgb(64, 64, 64));

            series1.ValueMembersY = "RESULT1";

            int rowArea  = 0;
            int rowArea2 = 0;
            int rowArea3 = 0;
            int rowArea1 = Convert.ToInt32(dtResult.Compute("MAX(RESULT1)", ""));
            rowArea = rowArea1;

            series2.ValueMembersY = "RESULT2";
            series3.ValueMembersY = "RESULT3";
            rowArea3 = Convert.ToInt32(dtResult.Compute("MAX(RESULT3)", ""));
            rowArea2 = Convert.ToInt32(dtResult.Compute("MAX(RESULT2)", ""));

            if (rowArea < rowArea2)
            {
                rowArea = rowArea2;
            }
            if (rowArea < rowArea3)
            {
                rowArea = rowArea3;
            }

            series1.ValueMemberX = "RESULTDAY";

            string rowAreaCalc = rowArea.ToString();
            string rowAreazero = string.Empty;
            for (int i = 0; i < rowArea.ToString().Length - 1; i++)
            {
                rowAreazero += "0";
            }
            rowAreaCalc = rowAreaCalc.Substring(0, 1) + rowAreazero;
            rowArea     = Convert.ToInt32(rowAreaCalc) / 10;

            foreach (Dundas.Charting.WebControl.Series series in objChart.Series)
            {
                objChart.ChartAreas[objChart.Series[series.Name].ChartArea].AxisX.Margin   = false;
                objChart.ChartAreas[objChart.Series[series.Name].ChartArea].AxisY2.Enabled = Dundas.Charting.WebControl.AxisEnabled.False;
                objChart.ChartAreas[objChart.Series[series.Name].ChartArea].AxisY.Interval = rowArea;
                //series.Href = HttpContext.Current.Request.Url.ToString().Substring(0, HttpContext.Current.Request.Url.ToString().LastIndexOf('/')) + "/BSC0404S1.ASPX";
            }

            objChart.DataBind();
        }
        catch (Exception ex)
        {
            ltrScript.Text = JSHelper.GetAlertScript(ex.Message);
        }
    }