Ejemplo n.º 1
0
        private Boolean fnDataFind()
        {
            /****************************************************
            * Comment : DataBase에 저장된 데이터를 조회한다.
            *
            * Created By : bee-jae jung(2016-06-15-수요일)
            *
            * Modified By : bee-jae jung(2016-06-16-목요일)
            ****************************************************/
            String sPackage = "", sParameter = "";

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                LoadingPopUp.LoadIngPopUpShow(this);

                if (fnBusinessRule() == false)
                {
                    return(false);
                }

                // 2016-06-16-정비재 : Sheet / Listview를 초기화 한다.
                CmnInitFunction.ClearList(SS01, true);

                // 2016-06-16-정비재 : oracle package(procedure)를 이용하여 데이터를 조회한다.
                sPackage   = "PACKAGE_TRN090106.PROC_TRN090106";
                sParameter = "P_WORK_MONTH:" + cdvFromToDate.FromYearMonth.Value.ToString("yyyyMM")
                             + "│ P_CUSTOMER:" + (cdvCustomer.Text == "ALL" ? "%" : cdvCustomer.Text) + "%"
                             + "│ P_PACKAGE:" + (cdvPackage.Text == "ALL" ? "%" : cdvPackage.Text) + "%";

                DataTable dt = CmnFunction.oComm.fnExecutePackage("DYNAMIC", sPackage, sParameter);

                if (dt.Rows.Count <= 0)
                {
                    dt.Dispose();
                    LoadingPopUp.LoadingPopUpHidden();
                    CmnFunction.ShowMsgBox(RptMessages.GetMessage("STD010", GlobalVariable.gcLanguage));
                    return(false);
                }

                SS01.DataSource = dt;
                SS01.RPT_AutoFit(false);

                return(true);
            }
            catch (Exception ex)
            {
                LoadingPopUp.LoadingPopUpHidden();
                MessageBox.Show(ex.Message);
                return(false);
            }
            finally
            {
                LoadingPopUp.LoadingPopUpHidden();
                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 2
0
        private bool fnDataFind()
        {
            /****************************************************
            * Comment : DataBase에 저장된 데이터를 조회한다.
            *
            * Created By : KIM-MINWOO(2010-10-04-월요일)
            *
            * Modified By :KIM-MINWOO(2010-10-04-월요일)
            ****************************************************/
            DataTable dt = null;

            Miracom.SmartWeb.UI.Controls.udcFarPoint SS = null;
            string QRY = "";

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                LoadingPopUp.LoadIngPopUpShow(this);

                CmnInitFunction.ClearList(SS01, true);

                // 검색 날짜의 주차 가져오기
                DataTable dt1 = null;
                dt1 = null;
                dt1 = CmnFunction.oComm.GetFuncDataTable("DYNAMIC", MakeSqlString2(cdvBaseDate.Value.ToString("yyyyMMdd")));
                string week = dt1.Rows[0][0].ToString();
                // 검색 날짜의 주차 가져오기(-1)
                dt1 = null;
                dt1 = CmnFunction.oComm.GetFuncDataTable("DYNAMIC", MakeSqlString2(cdvBaseDate.Value.AddDays(-7).ToString("yyyyMMdd")));
                string week_1 = dt1.Rows[0][0].ToString();
                // 검색 날짜의 주차 가져오기(-2)
                dt1 = null;
                dt1 = CmnFunction.oComm.GetFuncDataTable("DYNAMIC", MakeSqlString2(cdvBaseDate.Value.AddDays(-14).ToString("yyyyMMdd")));
                string week_2 = dt1.Rows[0][0].ToString();
                // 검색 날짜의 주차 가져오기(-3)
                dt1 = null;
                dt1 = CmnFunction.oComm.GetFuncDataTable("DYNAMIC", MakeSqlString2(cdvBaseDate.Value.AddDays(-21).ToString("yyyyMMdd")));
                string week_3 = dt1.Rows[0][0].ToString();


                QRY = "SELECT  CUSTOMER \n"

                      + "		 , NVL(ROUND(DC_OUT_QTY_MM_2/DECODE(DC_IN_QTY_MM_2,0,1,DC_IN_QTY_MM_2) * 100,2),0) AS MM_2 \n"
                      + "		 , NVL(ROUND(DC_OUT_QTY_MM_1/DECODE(DC_IN_QTY_MM_1,0,1,DC_IN_QTY_MM_1) * 100,2),0) AS MM_1 \n"
                      + "		 , NVL(ROUND(DC_OUT_QTY_MM/DECODE(DC_IN_QTY_MM,0,1,DC_IN_QTY_MM) * 100,2),0) AS MM \n"
                      + "		 , ROUND(DC_OUT_QTY_WW_3/DECODE(DC_IN_QTY_WW_3,0,1,DC_IN_QTY_WW_3) * 100,2) AS WW_3 \n"
                      + "		 , ROUND(DC_OUT_QTY_WW_2/DECODE(DC_IN_QTY_WW_2,0,1,DC_IN_QTY_WW_2) * 100,2) AS WW_2 \n"
                      + "		 , ROUND(DC_OUT_QTY_WW_1/DECODE(DC_IN_QTY_WW_1,0,1,DC_IN_QTY_WW_1) * 100,2) AS WW_1 \n"
                      + "		 , ROUND(DC_OUT_QTY_WW/DECODE(DC_IN_QTY_WW,0,1,DC_IN_QTY_WW) * 100,2) AS WW \n"
                      + "		 , ROUND(DC_OUT_QTY_DD_6/DECODE(DC_IN_QTY_DD_6,0,1,DC_IN_QTY_DD_6) * 100,2) AS DD_6 \n"
                      + "		 , ROUND(DC_OUT_QTY_DD_5/DECODE(DC_IN_QTY_DD_5,0,1,DC_IN_QTY_DD_5) * 100,2) AS DD_5 \n"
                      + "		 , ROUND(DC_OUT_QTY_DD_4/DECODE(DC_IN_QTY_DD_4,0,1,DC_IN_QTY_DD_4) * 100,2) AS DD_4 \n"
                      + "		 , ROUND(DC_OUT_QTY_DD_3/DECODE(DC_IN_QTY_DD_3,0,1,DC_IN_QTY_DD_3) * 100,2) AS DD_3 \n"
                      + "		 , ROUND(DC_OUT_QTY_DD_2/DECODE(DC_IN_QTY_DD_2,0,1,DC_IN_QTY_DD_2) * 100,2) AS DD_2 \n"
                      + "		 , ROUND(DC_OUT_QTY_DD_1/DECODE(DC_IN_QTY_DD_1,0,1,DC_IN_QTY_DD_1) * 100,2) AS DD_1 \n"
                      + "		 , ROUND(DC_OUT_QTY_DD/DECODE(DC_IN_QTY_DD,0,1,DC_IN_QTY_DD) * 100,2) AS DD \n"
                      + "		   FROM( \n"



                      + "SELECT  CUSTOMER AS CUSTOMER \n"
                      + "		 , SUM(DECODE(WORK_MONTH,'"+ cdvBaseDate.Value.AddMonths(-2).ToString("yyyyMM") + "', DC_IN_QTY,0)) AS DC_IN_QTY_MM_2 \n"
                      + "		 , SUM(DECODE(WORK_MONTH,'"+ cdvBaseDate.Value.AddMonths(-1).ToString("yyyyMM") + "', DC_IN_QTY,0)) AS DC_IN_QTY_MM_1 \n"
                      + "		 , SUM(DECODE(WORK_MONTH,'"+ cdvBaseDate.Value.ToString("yyyyMM") + "', DC_IN_QTY,0)) AS DC_IN_QTY_MM \n"
                      + "		 , SUM(DECODE(WORK_MONTH,'"+ cdvBaseDate.Value.AddMonths(-2).ToString("yyyyMM") + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_MM_2 \n"
                      + "		 , SUM(DECODE(WORK_MONTH,'"+ cdvBaseDate.Value.AddMonths(-1).ToString("yyyyMM") + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_MM_1 \n"
                      + "		 , SUM(DECODE(WORK_MONTH,'"+ cdvBaseDate.Value.ToString("yyyyMM") + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_MM \n"
                      + "		 , SUM(DECODE(PLAN_WEEK,'"+ week_3 + "', DC_IN_QTY,0)) AS DC_IN_QTY_WW_3 \n"
                      + "		 , SUM(DECODE(PLAN_WEEK,'"+ week_2 + "', DC_IN_QTY,0)) AS DC_IN_QTY_WW_2 \n"
                      + "		 , SUM(DECODE(PLAN_WEEK,'"+ week_1 + "', DC_IN_QTY,0)) AS DC_IN_QTY_WW_1 \n"
                      + "		 , SUM(DECODE(PLAN_WEEK,'"+ week + "', DC_IN_QTY,0)) AS DC_IN_QTY_WW \n"
                      + "		 , SUM(DECODE(PLAN_WEEK,'"+ week_3 + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_WW_3 \n"
                      + "		 , SUM(DECODE(PLAN_WEEK,'"+ week_2 + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_WW_2 \n"
                      + "		 , SUM(DECODE(PLAN_WEEK,'"+ week_1 + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_WW_1 \n"
                      + "		 , SUM(DECODE(PLAN_WEEK,'"+ week + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_WW \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.AddDays(-6).ToString("yyyyMMdd") + "', DC_IN_QTY,0)) AS DC_IN_QTY_DD_6 \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.AddDays(-5).ToString("yyyyMMdd") + "', DC_IN_QTY,0)) AS DC_IN_QTY_DD_5 \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.AddDays(-4).ToString("yyyyMMdd") + "', DC_IN_QTY,0)) AS DC_IN_QTY_DD_4 \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.AddDays(-3).ToString("yyyyMMdd") + "', DC_IN_QTY,0)) AS DC_IN_QTY_DD_3 \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.AddDays(-2).ToString("yyyyMMdd") + "', DC_IN_QTY,0)) AS DC_IN_QTY_DD_2 \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.AddDays(-1).ToString("yyyyMMdd") + "', DC_IN_QTY,0)) AS DC_IN_QTY_DD_1 \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.ToString("yyyyMMdd") + "', DC_IN_QTY,0)) AS DC_IN_QTY_DD \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.AddDays(-6).ToString("yyyyMMdd") + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_DD_6 \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.AddDays(-5).ToString("yyyyMMdd") + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_DD_5 \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.AddDays(-4).ToString("yyyyMMdd") + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_DD_4 \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.AddDays(-3).ToString("yyyyMMdd") + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_DD_3 \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.AddDays(-2).ToString("yyyyMMdd") + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_DD_2 \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.AddDays(-1).ToString("yyyyMMdd") + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_DD_1 \n"
                      + "		 , SUM(DECODE(WORK_DATE,'"+ cdvBaseDate.Value.ToString("yyyyMMdd") + "', DC_OUT_QTY,0)) AS DC_OUT_QTY_DD \n"

                      + "	  FROM ("
                      + "	        SELECT A.*, B.PLAN_WEEK FROM RSUMDCLHIS A, MWIPCALDEF B  \n"
                      + "	         WHERE A.WORK_DATE = B.SYS_DATE \n"
                      + "	           ANd B.CALENDAR_ID = 'SE' \n"
                      + "            AND CUSTOMER = '" + cdvCustomer.Text + "' \n"
                      + "            AND LOT_ID LIKE '" + txtLotID.Text + "' \n"
                      + "            AND MAT_ID LIKE '" + txtSearchProduct.Text + "' \n";

                #region 상세 조회에 따른 SQL문 생성
                if (udcWIPCondition1.Text != "ALL" && udcWIPCondition1.Text != "")
                {
                    //QRY += "	           AND CUSTOMER " + udcWIPCondition1.SelectedValueToQueryString + "\n";

                    if (udcWIPCondition2.Text != "ALL" && udcWIPCondition2.Text != "")
                    {
                        QRY += "	           AND FAMILY "+ udcWIPCondition2.SelectedValueToQueryString + "\n";
                    }
                }

                if (udcWIPCondition3.Text != "ALL" && udcWIPCondition3.Text != "")
                {
                    QRY += "	           AND PKG "+ udcWIPCondition3.SelectedValueToQueryString + "\n";
                }

                if (udcWIPCondition4.Text != "ALL" && udcWIPCondition4.Text != "")
                {
                    QRY += "	           AND TYPE1 "+ udcWIPCondition4.SelectedValueToQueryString + "\n";
                }

                if (udcWIPCondition5.Text != "ALL" && udcWIPCondition5.Text != "")
                {
                    QRY += "	           AND TYPE2 "+ udcWIPCondition5.SelectedValueToQueryString + "\n";
                }

                if (udcWIPCondition6.Text != "ALL" && udcWIPCondition6.Text != "")
                {
                    QRY += "	           AND LD_COUNT "+ udcWIPCondition6.SelectedValueToQueryString + "\n";
                }

                if (udcWIPCondition7.Text != "ALL" && udcWIPCondition7.Text != "")
                {
                    QRY += "	           AND DENSITY "+ udcWIPCondition7.SelectedValueToQueryString + "\n";
                }

                if (udcWIPCondition8.Text != "ALL" && udcWIPCondition8.Text != "")
                {
                    QRY += "	           AND GENERATION "+ udcWIPCondition8.SelectedValueToQueryString + "\n";
                }

                if (udcRASCondition6.Text != "ALL" && udcRASCondition6.Text != "")
                {
                    QRY += "	           AND (BG_RES_ID "+ udcRASCondition6.SelectedValueToQueryString + "\n";
                    QRY += "	           OR   SAW_RES_ID "+ udcRASCondition6.SelectedValueToQueryString + "\n";
                    QRY += "	           OR   DA1_RES_ID "+ udcRASCondition6.SelectedValueToQueryString + "\n";
                    QRY += "	           OR   DA2_RES_ID "+ udcRASCondition6.SelectedValueToQueryString + "\n";
                    QRY += "	           OR   DA3_RES_ID "+ udcRASCondition6.SelectedValueToQueryString + "\n";
                    QRY += "	           OR   WB1_RES_ID "+ udcRASCondition6.SelectedValueToQueryString + "\n";
                    QRY += "	           OR   WB2_RES_ID "+ udcRASCondition6.SelectedValueToQueryString + "\n";
                    QRY += "	           OR   WB3_RES_ID "+ udcRASCondition6.SelectedValueToQueryString + "\n";
                    QRY += "	           OR   MD_RES_ID "+ udcRASCondition6.SelectedValueToQueryString + ")\n";
                }
                #endregion


                QRY += "	  )GROUP BY CUSTOMER)";


                if (GlobalVariable.gsUserGroup == "ADMIN_GROUP" || GlobalVariable.gsUserGroup == "HANA_ADMIN_GROUP")
                {
                    System.Windows.Forms.Clipboard.SetText(QRY.Replace((char)Keys.Tab, ' '));
                }

                dt = CmnFunction.oComm.GetFuncDataTable("DYNAMIC", QRY.Replace((char)Keys.Tab, ' '));

                if (dt.Rows.Count == 0)
                {
                    dt.Dispose();
                    LoadingPopUp.LoadingPopUpHidden();
                    CmnFunction.ShowMsgBox(RptMessages.GetMessage("STD010", GlobalVariable.gcLanguage));
                    return(false);
                }


                SS = SS01;

                SS.DataSource = dt;
                SS.RPT_AutoFit(false);

                fnMakeChart(SS, 0);

                return(true);
            }
            catch (Exception ex)
            {
                LoadingPopUp.LoadingPopUpHidden();
                MessageBox.Show(ex.Message);
                return(false);
            }
            finally
            {
                LoadingPopUp.LoadingPopUpHidden();
                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 4. 쿼리 생성
        /// </summary>
        /// <returns></returns>
        ///
        private Boolean fnDataFind()
        {
            /****************************************************
            * comment : 검색조건에 맞는 데이터를 조회한다.
            *
            * created by : bee-jae jung(2011-01-17-월요일)
            *
            * modified by : bee-jae jung(2011-01-17-월요일)
            ****************************************************/
            DataTable DT = null;
            String    QRY = "", sBoh_Date = "", sEoh_Date = "";

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                LoadingPopUp.LoadIngPopUpShow(this);

                // 2010-07-20-정비재 : Sheet / Listview를 초기화 한다.
                CmnInitFunction.ClearList(SS01, true);

                // 2011-01-17-정비재 : BOH, EOH 일자를 조회한다.
                if (rbBaseTime06.Checked == true)
                {
                    // 2011-01-17-정비재 : 06시 기준의 일자
                    sBoh_Date = cdvToDate.SelectedValue() + "06";
                    sEoh_Date = DateTime.Parse(cdvToDate.Value.ToString("yyyy-MM-dd")).AddDays(+1).ToString("yyyyMMdd") + "06";
                }
                else if (rbBaseTime22.Checked == true)
                {
                    // 2011-01-17-정비재 : 22시 기준의 일자
                    sBoh_Date = DateTime.Parse(cdvFromDate.Value.ToString("yyyy-MM-dd")).AddDays(-1).ToString("yyyyMMdd") + "22";
                    sEoh_Date = cdvToDate.SelectedValue() + "22";
                }

                QRY = "SELECT A.MAT_ID AS MAT_ID"
                      + "     , A.OPER AS OPER"
                      + "     , SUM(A.BOH_QTY) AS BOH_QTY"
                      + "     , SUM(A.OPER_IN_QTY) AS OPER_IN_QTY"
                      + "     , SUM(A.START_QTY) AS START_QTY"
                      + "     , SUM(A.END_QTY) AS END_QTY"
                      + "     , SUM(A.HOLD_QTY) AS HOLD_QTY"
                      + "     , SUM(A.LOSS_QTY) AS LOSS_QTY"
                      + "     , SUM(A.BONUS_QTY) AS BONUS_QTY"
                      + "     , SUM(A.EOH_QTY) AS EOH_QTY"
                      + "  FROM (SELECT MAT_ID AS MAT_ID"
                      + "             , OPER AS OPER"
                      + "             , 0 AS BOH_QTY"
                      + "             , SUM(S1_OPER_IN_QTY_1 + S2_OPER_IN_QTY_1 + S3_OPER_IN_QTY_1) AS OPER_IN_QTY"
                      + "             , SUM(S1_START_QTY_1 + S2_START_QTY_1 + S3_START_QTY_1) AS START_QTY"
                      + "             , SUM(S1_END_QTY_1 + S2_END_QTY_1 + S3_END_QTY_1) AS END_QTY"
                      + "             , SUM(S1_TO_HOLD_QTY_1 + S2_TO_HOLD_QTY_1 + S3_TO_HOLD_QTY_1) AS HOLD_QTY"
                      + "             , SUM(S1_LOSS_QTY_1 + S2_LOSS_QTY_1 + S3_LOSS_QTY_1) AS LOSS_QTY"
                      + "             , SUM(S1_BONUS_QTY_1 + S2_BONUS_QTY_1 + S3_BONUS_QTY_1) AS BONUS_QTY"
                      + "             , 0 AS EOH_QTY";
                if (rbBaseTime06.Checked == true)
                {
                    QRY += "          FROM CSUMWIPMOV";     // 2011-01-17-정비재 : 06시 기준
                }
                else if (rbBaseTime22.Checked == true)
                {
                    QRY += "          FROM RSUMWIPMOV";     // 2011-01-17-정비재 : 22시 기준
                }
                QRY += "         WHERE FACTORY IN ('" + GlobalVariable.gsAssyDefaultFactory + "', '" + GlobalVariable.gsTestDefaultFactory + "')"
                       + "           AND WORK_DATE >= '" + cdvFromDate.SelectedValue() + "'"
                       + "           AND WORK_DATE <= '" + cdvToDate.SelectedValue() + "'"
                       + "           AND LOT_TYPE = 'W'"
                       + "           AND MAT_ID LIKE '" + txtMatID.Text + "%'"
                       + "           AND CM_KEY_3 LIKE '" + txtLotType.Text + "%'"
                       + "         GROUP BY MAT_ID, OPER"
                       + "        UNION ALL"
                       + "        SELECT MAT_ID AS MAT_ID"
                       + "             , OPER AS OPER"
                       + "             , SUM(QTY_1) AS BOH_QTY"
                       + "             , 0 AS OPER_IN_QTY"
                       + "             , 0 AS START_QTY"
                       + "             , 0 AS END_QTY"
                       + "             , 0 AS HOLD_QTY"
                       + "             , 0 AS LOSS_QTY"
                       + "             , 0 AS BONUS_QTY"
                       + "             , 0 AS EOH_QTY"
                       + "          FROM RWIPLOTSTS_BOH"
                       + "         WHERE FACTORY IN ('" + GlobalVariable.gsAssyDefaultFactory + "', '" + GlobalVariable.gsTestDefaultFactory + "')"
                       + "           AND LOT_TYPE = 'W'"
                       + "           AND MAT_ID LIKE '" + txtMatID.Text + "%'"
                       + "           AND LOT_CMF_5 LIKE '" + txtLotType.Text + "%'"
                       + "           AND CUTOFF_DT = '" + sBoh_Date + "'"
                       + "         GROUP BY MAT_ID, OPER"
                       + "        UNION ALL"
                       + "        SELECT MAT_ID AS MAT_ID"
                       + "             , OPER AS OPER"
                       + "             , 0 AS BOH_QTY"
                       + "             , 0 AS OPER_IN_QTY"
                       + "             , 0 AS START_QTY"
                       + "             , 0 AS END_QTY"
                       + "             , 0 AS HOLD_QTY"
                       + "             , 0 AS LOSS_QTY"
                       + "             , 0 AS BONUS_QTY"
                       + "             , SUM(QTY_1) AS EOH_QTY"
                       + "          FROM RWIPLOTSTS_BOH"
                       + "         WHERE FACTORY IN ('" + GlobalVariable.gsAssyDefaultFactory + "', '" + GlobalVariable.gsTestDefaultFactory + "')"
                       + "           AND LOT_TYPE = 'W'"
                       + "           AND MAT_ID LIKE '" + txtMatID.Text + "%'"
                       + "           AND LOT_CMF_5 LIKE '" + txtLotType.Text + "%'"
                       + "           AND CUTOFF_DT = '" + sEoh_Date + "'"
                       + "         GROUP BY MAT_ID, OPER) A"
                       + " GROUP BY A.MAT_ID, A.OPER"
                       + " ORDER BY A.MAT_ID ASC, A.OPER ASC";

                if (GlobalVariable.gsUserGroup == "ADMIN_GROUP" || GlobalVariable.gsUserGroup == "HANA_ADMIN_GROUP")
                {
                    System.Windows.Forms.Clipboard.SetText(QRY.Replace((char)Keys.Tab, ' '));
                }

                DT = CmnFunction.oComm.GetFuncDataTable("DYNAMIC", QRY.Replace((char)Keys.Tab, ' '));

                if (DT.Rows.Count == 0)
                {
                    DT.Dispose();
                    LoadingPopUp.LoadingPopUpHidden();
                    CmnFunction.ShowMsgBox(RptMessages.GetMessage("STD010", GlobalVariable.gcLanguage));
                    return(false);
                }

                SS01.DataSource = DT;
                SS01.RPT_AutoFit(false);

                return(true);
            }
            catch (Exception ex)
            {
                LoadingPopUp.LoadingPopUpHidden();
                MessageBox.Show(ex.Message);
                return(false);
            }
            finally
            {
                LoadingPopUp.LoadingPopUpHidden();
                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 4
0
        private bool fnDataFind()
        {
            /****************************************************
            * comment : database에 저장된 데이터를 조회한다.
            *
            * created by : bee-jae jung(2010-07-23-금요일)
            *
            * modified by : bee-jae jung(2010-07-23-금요일)
            ****************************************************/
            string qry  = "";
            string oper = "";

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                LoadingPopUp.LoadIngPopUpShow(this);

                // 2010-07-23-정비재 : Sheet / Listview를 초기화 한다.
                CmnInitFunction.ClearList(SS01, true);

                if (rb01.Checked == true)
                {
                    if (cdvres_grp_3.Text.Trim() == "")
                    {
                        oper = "ALL";
                    }
                    else
                    {
                        oper = cdvres_grp_3.Text.Trim();
                    }

                    // 2010-08-03-김민우 : Summary Table에서 설비 가동율을 조회한다.
                    qry = "SELECT FLAG, MONTH_AVERAGE, DD_7, DD_6, DD_5, DD_4, DD_3, DD_2, DD_1 \n"
                          + "   FROM RSUMTRNOPR \n"
                          + "  WHERE FACTORY = '" + cdvFactory.Text + "' \n"
                          + "    AND WORK_DATE = '" + cdvBaseDate.Value.ToString("yyyyMMdd") + "' \n"
                          + "    AND OPER =  '" + oper + "' \n"
                          + " ORDER BY DECODE(FLAG, '종합가동율', 0, '성능가동율', 1, '시간가동율', 2, 99) ASC";
                }
                else if (rb02.Checked == true)
                {
                    if (cdvres_grp_3.Text.Trim() == "")
                    {
                        oper = "ALL";
                    }
                    else
                    {
                        oper = cdvres_grp_3.Text.Trim();
                    }
                    // 2010-08-03-김민우 : Summary Table에서 설비 가동율을 조회한다.
                    qry = "SELECT MAINT_CODE, MONTH_AVERAGE, DD_7, DD_6, DD_5, DD_4, DD_3, DD_2, DD_1 \n"
                          + "   FROM RSUMTRNDWH \n"
                          + "  WHERE FACTORY = '" + cdvFactory.Text + "' \n"
                          + "    AND WORK_DATE = '" + cdvBaseDate.Value.ToString("yyyyMMdd") + "' \n"
                          + "    AND OPER =  '" + oper + "' \n"
                          + " ORDER BY MAINT_CODE ASC";
                }

                if (GlobalVariable.gsUserGroup == "ADMIN_GROUP" || GlobalVariable.gsUserGroup == "HANA_ADMIN_GROUP")
                {
                    System.Windows.Forms.Clipboard.SetText(qry.Replace((char)Keys.Tab, ' '));
                }

                dt = CmnFunction.oComm.GetFuncDataTable("DYNAMIC", qry.Replace((char)Keys.Tab, ' '));

                if (dt.Rows.Count == 0)
                {
                    dt.Dispose();
                    LoadingPopUp.LoadingPopUpHidden();
                    CmnFunction.ShowMsgBox(RptMessages.GetMessage("STD010", GlobalVariable.gcLanguage));
                    return(false);
                }

                SS01.DataSource = dt;

                fnMakeChart(SS01, 0, 2);

                return(true);
            }
            catch (Exception ex)
            {
                LoadingPopUp.LoadingPopUpHidden();
                MessageBox.Show(ex.Message);
                return(false);
            }
            finally
            {
                LoadingPopUp.LoadingPopUpHidden();
                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 5
0
        private bool fnDataFind()
        {
            /****************************************************
            * comment : database에 저장된 데이터를 조회한다.
            *
            * created by : bee-jae jung(2010-07-20-화요일)
            *
            * modified by : bee-jae jung(2010-07-20-화요일)
            ****************************************************/
            DataTable dt = null;
            //String sPackage = "", sParameter = "";
            String sQuery = "";

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                LoadingPopUp.LoadIngPopUpShow(this);

                // 2010-07-20-정비재 : Sheet / Listview를 초기화 한다.
                CmnInitFunction.ClearList(SS01, true);

                // 2011-07-12-정비재 : Queyr문의 실행시간이 오래 걸려서 1시간 Batch job으로 RWIPLOTGCT Table에 입력하고
                //                   : RWIPLOTGCT Table에 데이터를 검색한다.
                // 2011-07-12-정비재 : 기존 Source Backup

                /*
                 * // 2010-07-20-정비재 : gct wip report를 검색한다.
                 * sPackage = "PACKAGE_PRD010103.PROC_PRD010103";
                 * sParameter = "P_MAT_ID:" + txtMatID.Text
                 + "│ P_LOT_TYPE:" + txtLotType.Text;
                 +
                 + dt = CmnFunction.oComm.fnExecutePackage("DYNAMIC", sPackage, sParameter);
                 */

                // 2017-07-03-mgkim : MES GCT WIP Manual 수정본과 JOIN하여 VIEW
                sQuery = "SELECT NVL(C.GCT_PROJECT_NO, A.GCT_PROJECT_NO) AS GCT_PROJECT_NO, B.MAT_CMF_8 AS GCT_DEVICE, NVL(C.PACKAGE, A.PACKAGE) AS PACKAGE, \n"
                         + "	     NVL(C.LD_COUNT, A.LD_COUNT) AS LD_COUNT, NVL(C.DIMENSION, A.DIMENSION) AS DIMENSION, B.MAT_CMF_7 AS VENDOR_PART_NO, \n"
                         + "       NVL(C.WFR_LOT_ID, A.WFR_LOT_ID) AS WFR_LOT_ID, NVL(C.GCT_ASSY_LOT_ID, A.GCT_ASSY_LOT_ID) AS GCT_ASSY_LOT_ID, NVL(C.GCT_TEST_LOT_ID, A.GCT_TEST_LOT_ID) AS GCT_TEST_LOT_ID, \n"
                         + "       NVL(C.VENDOR_LOT_ID, A.VENDOR_LOT_ID) AS VENDOR_LOT_ID, NVL(C.PROD_RLSESCHED_NO, A.PROD_RLSESCHED_NO) AS PROD_RLSESCHED_NO,  NVL(C.VENDOR_ORDER_NO, A.VENDOR_ORDER_NO) AS VENDOR_ORDER_NO, \n"
                         + "       NVL(C.TEST_RCVD_QTY, A.TEST_RCVD_QTY) AS TEST_RCVD_QTY, NVL(C.TEST_RCVD_DATE, A.TEST_RCVD_DATE) AS TEST_RCVD_DATE, NVL(C.TEST_QUE, A.TEST_QUE) AS TEST_QUE,\n"
                         + "       NVL(C.TEST_START_DATE, A.TEST_START_DATE) AS TEST_START_DATE, NVL(C.FINAL_TEST_CAS_OS, A.FINAL_TEST_CAS_OS) AS FINAL_TEST_CAS_OS,  NVL(C.QA_EL_TEST, A.QA_EL_TEST) AS QA_EL_TEST, \n"
                         + "       NVL(C.TEST_HOLD, A.TEST_HOLD) AS TEST_HOLD, NVL(C.LOT_HOLD_DATE, A.LOT_HOLD_DATE) AS LOT_HOLD_DATE, NVL(C.LOT_HOLD_REL_DATE, A.LOT_HOLD_REL_DATE) AS LOT_HOLD_REL_DATE, \n"
                         + "       NVL(C.TEST_OUT_QTY, A.TEST_OUT_QTY) AS TEST_OUT_QTY, NVL(C.TEST_OUT_FCST_DATE, A.TEST_OUT_FCST_DATE) AS TEST_OUT_FCST_DATE, NVL(C.TEST_OUT_DATE, A.TEST_OUT_DATE) AS TEST_OUT_DATE, \n"
                         + "       NVL(C.VM, A.VM) AS VM, NVL(C.BAKE, A.BAKE) AS BAKE, NVL(C.TNR, A.TNR) AS TNR, \n"
                         + "       NVL(C.PACK, A.PACK) AS PACK,  NVL(C.PACK_OUT_QTY, A.PACK_OUT_QTY) AS PACK_OUT_QTY, NVL(C.PACK_OUT_DATE, A.PACK_OUT_DATE) AS PACK_OUT_DATE, \n"
                         + "       NVL(C.FGS_QTY, A.FGS_QTY) AS FGS_QTY, NVL(C.SHIP_OUT_QTY, A.SHIP_OUT_QTY) AS SHIP_OUT_QTY,  NVL(C.FCST_SHIP_DATE, A.FCST_SHIP_DATE) AS FCST_SHIP_DATE, \n"
                         + "       NVL(C.ACT_SHIP_TIME, A.ACT_SHIP_TIME) AS ACT_SHIP_TIME, NVL(C.CUST_REQ_DATE, A.CUST_REQ_DATE) AS CUST_REQ_DATE, NVL(C.PR_NO, A.PR_NO) AS PR_NO,\n"
                         + "       NVL(C.TEST_PO, A.TEST_PO) AS TEST_PO, NVL(C.HOLD_CODE, A.HOLD_CODE) AS HOLD_CODE, NVL(C.REJECT, A.REJECT) AS REJECT, \n"
                         + "       NVL(C.REMARK, A.REMARK) AS REMARK, \n"
                         + "       C.UPDATE_TIME \n"
                         + "  FROM RWIPLOTGCT A \n"
                         + "     , (SELECT DISTINCT MAT_ID AS MAT_ID \n"
                         + "			   , MAT_CMF_7 AS MAT_CMF_7 \n"
                         + "			   , MAT_CMF_8 AS MAT_CMF_8 \n"
                         + "			FROM MWIPMATDEF \n"
                         + "		   WHERE MAT_GRP_1 = 'GC') B, \n"
                         + "		 CWIPLOTGCT@RPTTOMES C \n"
                         + " WHERE A.VENDOR_PART_NO = B.MAT_ID \n"
                         + " AND A.GCT_TEST_LOT_ID = C.GCT_TEST_LOT_ID(+) \n"
                         + " ORDER BY A.GCT_TEST_LOT_ID ASC";

                if (GlobalVariable.gsUserGroup == "ADMIN_GROUP" || GlobalVariable.gsUserGroup == "HANA_ADMIN_GROUP")
                {
                    System.Windows.Forms.Clipboard.SetText(sQuery);
                }

                dt = CmnFunction.oComm.GetFuncDataTable("DYNAMIC", sQuery.Replace((char)Keys.Tab, ' '));

                if (dt.Rows.Count <= 0)
                {
                    dt.Dispose();
                    LoadingPopUp.LoadingPopUpHidden();
                    CmnFunction.ShowMsgBox(RptMessages.GetMessage("STD010", GlobalVariable.gcLanguage));
                    return(false);
                }

                int[] rowType = SS01.RPT_DataBindingWithSubTotal(dt, 0, 0, 1, null, null);

                int iColPos = 0;

                for (int iCol = 0; iCol < SS01.ActiveSheet.Columns.Count; iCol++)
                {
                    if (SS01.ActiveSheet.GetColumnLabel(0, iCol).ToString() == "UPDATE_TIME")
                    {
                        iColPos = iCol;
                        break;
                    }
                }

                for (int i = 0; i < SS01.ActiveSheet.RowCount; i++)
                {
                    if (SS01.ActiveSheet.Cells[i, iColPos].Value != null && SS01.ActiveSheet.Cells[i, iColPos].Value.ToString().Trim() != "")
                    {
                        SS01.ActiveSheet.Rows[i].BackColor = Color.Pink;
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                LoadingPopUp.LoadingPopUpHidden();
                MessageBox.Show(ex.Message);
                return(false);
            }
            finally
            {
                LoadingPopUp.LoadingPopUpHidden();
                Cursor.Current = Cursors.Default;
            }
        }