private void DoBinding_JeonSa()
    {
        MicroBSC.Integration.COM.Biz.Biz_NHIT bizNHIT = new MicroBSC.Integration.COM.Biz.Biz_NHIT();
        DataTable dtNHIT = bizNHIT.GetJeonSa(GRP_ONE_ID.A.ToString()
                                             , (int)GRP_TWO_ID.GTO_10
                                             , CR_YEAR
                                             , CR_MONTH
                                             , "T");

        UltraWebGrid1.DataSource = dtNHIT;
        UltraWebGrid1.DataBind();

        //dtNHIT = bizNHIT.GetJeonSa(GRP_ONE_ID.A.ToString()
        //                           , (int)GRP_TWO_ID.GTO_10
        //                           , GRP_THREE_ID.ME.ToString()
        //                           , CR_YEAR
        //                           , CR_MONTH);

        DoDrawingJunsaChart1(dtNHIT, chart1);

        dtNHIT = bizNHIT.GetJeonSa(GRP_ONE_ID.A.ToString()
                                   , (int)GRP_TWO_ID.GTO_10
                                   , GRP_THREE_ID.DN.ToString()
                                   , CR_YEAR
                                   , ""
                                   , "T");

        DoDrawingJunsaChart2(dtNHIT, chartMM);
    }
    private void DoBinding_JeonSa()
    {
        MicroBSC.Integration.COM.Biz.Biz_NHIT bizNHIT = new MicroBSC.Integration.COM.Biz.Biz_NHIT();
        DataTable dtNHIT = bizNHIT.GetJeonSa(GRP_ONE_ID.A.ToString()
                                             , (int)GRP_TWO_ID.GTO_10
                                             , CR_YEAR
                                             , CR_MONTH
                                             , TG_GUBUN);

        UltraWebGrid1.DataSource = dtNHIT;
        UltraWebGrid1.DataBind();
    }
    private void DoCompute()
    {
        MicroBSC.Integration.COM.Biz.Biz_NHIT bizNHIT = new MicroBSC.Integration.COM.Biz.Biz_NHIT();
        DataTable dtNHIT = bizNHIT.GetJeonSa("A"
                                             , 10
                                             , ""
                                             , "", TG_GUBUN);

        //object objMaxYear =  dtNHIT.Compute("MAX(CR_YEAR)", "");
        //object objMaxMonth = dtNHIT.Compute("MAX(CR_MONTH)", string.Format(" CR_YEAR = '{0}' ", objMaxYear));

        object objMaxYear  = CR_YEAR;
        object objMaxMonth = CR_MONTH;

        DataRow[] rows = dtNHIT.Select(string.Format(" CR_YEAR = '{0}' AND CR_MONTH = '{1}' ", objMaxYear, objMaxMonth), " SORT_ORDER ");

        if (rows.Length > 0)
        {
            lblYearMonth.Text = string.Format("{0}년 {1}월", objMaxYear, objMaxMonth);

            double rate1p = 0;
            double rate2p = 0;
            double rate3p = 0;


            lblMeDon.Text = String.Format("{0:##,##0}", DataTypeUtility.GetToInt32(rows[0][10]));
            lblMePer.Text = String.Format("{0:##,##0.00}", DataTypeUtility.GetToDouble(rows[0][11]) * 100) + "%";

            lblYoungDon.Text = String.Format("{0:##,##0}", DataTypeUtility.GetToInt32(rows[1][10]));
            lblYoungPer.Text = String.Format("{0:##,##0.00}", DataTypeUtility.GetToDouble(rows[1][11]) * 100) + "%";

            lblDangDon.Text = String.Format("{0:##,##0}", DataTypeUtility.GetToInt32(rows[2][10]));
            lblDangPer.Text = String.Format("{0:##,##0.00}", DataTypeUtility.GetToDouble(rows[2][11]) * 100) + "%";

            rate1p = DataTypeUtility.GetToDouble(rows[0][11]) * 100 * 0.5;
            rate2p = DataTypeUtility.GetToDouble(rows[1][11]) * 100 * 0.5;
            rate3p = DataTypeUtility.GetToDouble(rows[2][11]) * 100 * 0.5;

            //if (rate < rate1p)
            //{
            //    rate = rate1p;
            //}

            //if (rate < rate2p)
            //{
            //    rate = rate2p;
            //}

            //if (rate < rate3p)
            //{
            //    rate = rate3p;
            //}

            //if (rate > 100)
            //{
            //    rate1p = (rate1p == 0) ? rate1p : (rate1p / rate * 100);
            //    rate2p = (rate2p == 0) ? rate2p : (rate2p / rate * 100);
            //    rate3p = (rate3p == 0) ? rate3p : (rate3p / rate * 100);
            //}

            if (rate1p < 0)
            {
                rate1p = 0;
            }
            if (rate1p > 100)
            {
                rate1p = 100;
            }

            if (rate2p < 0)
            {
                rate2p = 0;
            }
            if (rate2p > 100)
            {
                rate2p = 100;
            }

            if (rate3p < 0)
            {
                rate3p = 0;
            }
            if (rate3p > 100)
            {
                rate3p = 100;
            }

            string wid1        = @"width:{0}%";
            string widthvalue1 = string.Format(wid1, rate1p);
            divMe.Attributes.Add("style", widthvalue1);

            string wid2        = @"width:{0}%";
            string widthvalue2 = string.Format(wid2, rate2p);
            divYoung.Attributes.Add("style", widthvalue2);

            string wid3        = @"width:{0}%";
            string widthvalue3 = string.Format(wid3, rate3p);
            divDang.Attributes.Add("style", widthvalue3);

            double avg       = (rate1p + rate2p + rate2p / 3);
            string grade     = "U";
            string colorCode = "#b8b8b8";

            if (avg >= 100)
            {
                grade     = "S";
                colorCode = "#6fe1e0";
            }
            else if (avg >= 90 && avg < 100)
            {
                grade     = "A";
                colorCode = "#6fe1e0";
            }
            else if (avg >= 80 && avg < 90)
            {
                grade     = "B";
                colorCode = "#a8f620";
            }
            else if (avg >= 70 && avg < 80)
            {
                grade     = "C";
                colorCode = "#f6c739";
            }
            else if (avg < 70)
            {
                grade     = "D";
                colorCode = "#fb7716";
            }
            //else if(avg <= 50)
            //{
            //    grade = "U";
            //    colorCode = "#b8b8b8";
            //}


            lblG.Text      = grade;
            lblG.ForeColor = Color.FromName(colorCode);

            //            .fcols{color: #8fc9fa;}
            //.fcola{color: #6fe1e0;}
            //.fcolb{color: #a8f620;}
            //.fcolc{color: #f6c739;}
            //.fcold{color: #fb7716;}
            //.fcolu{color: #b8b8b8;}
        }
    }
Beispiel #4
0
    private void SetIndiGrid()
    {
        writeLog(string.Format("{0} : SetIndiGrid() Start", Request.PhysicalPath));

        MicroBSC.Integration.COM.Biz.Biz_NHIT bizNHIT = new MicroBSC.Integration.COM.Biz.Biz_NHIT();
        DataTable dtNHIT = bizNHIT.GetJeonSa("A"
                                             , 10
                                             , ""
                                             , "", "T");

        object objMaxYear  = dtNHIT.Compute("MAX(CR_YEAR)", "");
        object objMaxMonth = dtNHIT.Compute("MAX(CR_MONTH)", string.Format(" CR_YEAR = '{0}' ", objMaxYear));

        DataRow[] rows = dtNHIT.Select(string.Format(" CR_YEAR = '{0}' AND CR_MONTH = '{1}' ", objMaxYear, objMaxMonth), " SORT_ORDER ");

        if (rows.Length > 0)
        {
            double rate   = 0;
            double rate1p = 0;
            double rate2p = 0;
            double rate3p = 0;


            amt1.Text  = String.Format("{0:##,##0}", DataTypeUtility.GetToInt32(rows[0][10]));
            rate1.Text = String.Format("{0:##,##0.00}", DataTypeUtility.GetToDouble(rows[0][11]) * 100);

            amt2.Text  = String.Format("{0:##,##0}", DataTypeUtility.GetToInt32(rows[1][10]));
            rate2.Text = String.Format("{0:##,##0.00}", DataTypeUtility.GetToDouble(rows[1][11]) * 100);

            amt3.Text  = String.Format("{0:##,##0}", DataTypeUtility.GetToInt32(rows[2][10]));
            rate3.Text = String.Format("{0:##,##0.00}", DataTypeUtility.GetToDouble(rows[2][11]) * 100);

            rate1p = DataTypeUtility.GetToDouble(rows[0][11]) * 100 * 0.5;
            rate2p = DataTypeUtility.GetToDouble(rows[1][11]) * 100 * 0.5;
            rate3p = DataTypeUtility.GetToDouble(rows[2][11]) * 100 * 0.5;

            //if (rate < rate1p)
            //{
            //    rate = rate1p;
            //}

            //if (rate < rate2p)
            //{
            //    rate = rate2p;
            //}

            //if (rate < rate3p)
            //{
            //    rate = rate3p;
            //}

            //if (rate > 100)
            //{
            //    rate1p = (rate1p == 0) ? rate1p : (rate1p / rate * 100);
            //    rate2p = (rate2p == 0) ? rate2p : (rate2p / rate * 100);
            //    rate3p = (rate3p == 0) ? rate3p : (rate3p / rate * 100);
            //}

            if (rate1p < 0)
            {
                rate1p = 0;
            }
            if (rate1p > 100)
            {
                rate1p = 100;
            }

            if (rate2p < 0)
            {
                rate2p = 0;
            }
            if (rate2p > 100)
            {
                rate2p = 100;
            }

            if (rate3p < 0)
            {
                rate3p = 0;
            }
            if (rate3p > 100)
            {
                rate3p = 100;
            }

            string wid1        = @"width:{0}%";
            string widthvalue1 = string.Format(wid1, rate1p);
            ratediv1.Attributes.Add("style", widthvalue1);

            string wid2        = @"width:{0}%";
            string widthvalue2 = string.Format(wid2, rate2p);
            ratediv2.Attributes.Add("style", widthvalue2);

            string wid3        = @"width:{0}%";
            string widthvalue3 = string.Format(wid3, rate3p);
            ratediv3.Attributes.Add("style", widthvalue3);
        }

        writeLog(string.Format("{0} : SetIndiGrid() End", Request.PhysicalPath));
    }