Esempio n. 1
0
 public DataTable GetBscKpiTargetGoalTong_DB(int estterm_ref_id
                                             , int kpi_ref_id
                                             , string ymd)
 {
     MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result dacBscKpiResult = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result();
     return(dacBscKpiResult.Select_DB(estterm_ref_id, kpi_ref_id, ymd).Tables[0]);
 }
Esempio n. 2
0
        public bool UpdateKpiResultDataByAdmin(DataTable dataTable)
        {
            MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result dac = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result();
            int affectedRow = 0;

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

            conn.Open();
            IDbTransaction trx = conn.BeginTransaction();

            try
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    affectedRow += dac.UpdateKpiResultDataByAdmin(conn
                                                                  , trx
                                                                  , dataRow["ESTTERM_REF_ID"]
                                                                  , dataRow["KPI_REF_ID"]
                                                                  , dataRow["YMD"]
                                                                  , dataRow["RESULT_MS"]
                                                                  , dataRow["RESULT_TS"]
                                                                  , dataRow["CAUSE_TEXT_MS"]
                                                                  , dataRow["CAUSE_TEXT_TS"]
                                                                  , dataRow["MEASURE_TEXT_MS"]
                                                                  , dataRow["MEASURE_TEXT_TS"]
                                                                  , dataRow["CHECKSTATUS"]
                                                                  , dataRow["UPDATE_DATE"]
                                                                  , dataRow["UPDATE_USER"]);
                }

                trx.Commit();
            }
            catch (Exception ex)
            {
                trx.Rollback();
                return(false);
            }
            finally
            {
                conn.Close();
            }

            return((affectedRow > 0) ? true : false);
        }
Esempio n. 3
0
        public string ModifyKpiResultDataBulker_DB(DataTable dt
                                                   , string title
                                                   , int create_user
                                                   , string create_date)
        {
            string returnVal = string.Empty;

            int affectedRow = 0;

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

            conn.Open();
            IDbTransaction trx = conn.BeginTransaction();

            try
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow row = dt.Rows[i];

                    object estterm_ref_id  = row["ESTTERM_REF_ID"];
                    object kpi_ref_id      = row["KPI_REF_ID"];
                    object ymd             = row["YMD"];
                    object result_ms       = row["RESULT_MS"];
                    object result_ts       = row["RESULT_TS"];
                    object checkstatus     = "Y";
                    bool   check_Apping_yn = DataTypeUtility.GetYNToBoolean(DataTypeUtility.GetValue(row["CHECK_APPING_YN"]));

                    int app_ref_id = DataTypeUtility.GetToInt32(row["APP_REF_ID"]);


                    if (check_Apping_yn)
                    {
                        MicroBSC.Integration.COM.Dac.Dac_Com_Approval_Info dacApprovalInfo = new MicroBSC.Integration.COM.Dac.Dac_Com_Approval_Info();

                        app_ref_id = dacApprovalInfo.SelectMaxAppRefID(conn, trx);
                        int app_version_id = 1;

                        string biz_type     = "KRA";
                        string app_code     = string.Format("{0}-{1}-{2}", biz_type, app_ref_id, app_version_id);
                        string active_yn    = "Y";
                        string app_status   = "CFT";
                        string draft_status = "FD";

                        affectedRow = dacApprovalInfo.InsertApprovalinfo_DB(conn
                                                                            , trx
                                                                            , app_ref_id
                                                                            , app_version_id
                                                                            , app_code
                                                                            , active_yn
                                                                            , DBNull.Value
                                                                            , title
                                                                            , biz_type
                                                                            , app_status
                                                                            , draft_status
                                                                            , create_user
                                                                            , create_date);

                        MicroBSC.Integration.COM.Dac.Dac_Com_Approval_Prc dacApprovalPrc = new MicroBSC.Integration.COM.Dac.Dac_Com_Approval_Prc();

                        affectedRow = dacApprovalPrc.InsertApprovalPrc_DB(conn
                                                                          , trx
                                                                          , app_ref_id
                                                                          , app_version_id
                                                                          , 1
                                                                          , create_user
                                                                          , "Y"
                                                                          , title
                                                                          , DBNull.Value
                                                                          , "D"
                                                                          , "NAME"
                                                                          , create_user
                                                                          , create_date);
                    }

                    MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result dacBscKpiResult = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result();
                    affectedRow = dacBscKpiResult.UpdataData_DB(conn
                                                                , trx
                                                                , estterm_ref_id
                                                                , kpi_ref_id
                                                                , ymd
                                                                , result_ms
                                                                , result_ts
                                                                , app_ref_id
                                                                , checkstatus
                                                                , create_user
                                                                , create_date);
                }


                //trx.Rollback();
                trx.Commit();
            }
            catch (Exception ex)
            {
                trx.Rollback();
                returnVal = ex.Message;
                return(returnVal);
            }
            finally
            {
                conn.Close();
            }

            return(returnVal);
        }
Esempio n. 4
0
        public string ModifyKpiResult_DB(int iestterm_ref_id
                                         , int ikpi_ref_id
                                         , string iymd
                                         , double iresult_ms
                                         , double iresult_ts
                                         , int isequence
                                         , double ical_result_ms
                                         , double ical_result_ts
                                         , string cal_apply_yn
                                         , string cal_apply_reason
                                         , string cause_text_ms
                                         , string cause_text_ts
                                         , string cause_file_id
                                         , string imeasure_text_ms
                                         , string imeasure_text_ts
                                         , string imeasure_file_id
                                         , string iremark
                                         , string initiative_do
                                         , string do_file
                                         , DateTime create_date
                                         , int create_user)
        {
            string returnVal = string.Empty;

            int affectedRow = 0;

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

            conn.Open();
            IDbTransaction trx = conn.BeginTransaction();

            MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Initiative dacBscKpiInitiative = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Initiative();

            DataTable dtBscKpiInitiative = dacBscKpiInitiative.SelectData_DB(iestterm_ref_id
                                                                             , ikpi_ref_id
                                                                             , iymd).Tables[0];

            try
            {
                MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result dacBscKpiResult = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result();

                affectedRow = dacBscKpiResult.UpdataData_DB(conn
                                                            , trx
                                                            , iestterm_ref_id
                                                            , ikpi_ref_id
                                                            , iymd
                                                            , iresult_ms
                                                            , iresult_ts
                                                            , isequence
                                                            , "Y"
                                                            , ical_result_ms
                                                            , ical_result_ts
                                                            , cal_apply_yn
                                                            , cal_apply_reason
                                                            , cause_text_ms
                                                            , cause_text_ts
                                                            , cause_file_id
                                                            , imeasure_text_ms
                                                            , imeasure_text_ts
                                                            , imeasure_file_id
                                                            , iremark
                                                            , create_user
                                                            , create_date);


                if (dtBscKpiInitiative.Rows.Count > 0)
                {
                    affectedRow = dacBscKpiInitiative.UpdateDo_DB(conn
                                                                  , trx
                                                                  , iestterm_ref_id
                                                                  , ikpi_ref_id
                                                                  , iymd
                                                                  , initiative_do
                                                                  , do_file
                                                                  , create_date
                                                                  , create_user);
                }
                else
                {
                    affectedRow = dacBscKpiInitiative.InsertData_DB(conn
                                                                    , trx
                                                                    , iestterm_ref_id
                                                                    , ikpi_ref_id
                                                                    , iymd
                                                                    , DBNull.Value
                                                                    , initiative_do
                                                                    , do_file
                                                                    , DBNull.Value
                                                                    , create_user);
                }



                //trx.Rollback();
                trx.Commit();
            }
            catch (Exception ex)
            {
                trx.Rollback();
                returnVal = ex.Message;
                return(returnVal);
            }
            finally
            {
                conn.Close();
            }

            return(returnVal);
        }
Esempio n. 5
0
        /// <summary>
        /// 조직KPI에서 복사한 MBO를 삭제
        /// </summary>
        /// <param></param>
        /// <returns></returns>
        public string RemoveMboToKpi_DB(int estterm_ref_id
                                        , string[] objList)
        {
            string rtnValue = string.Empty;

            int           okCnt = 0;
            IDbConnection conn  = DbAgentHelper.CreateDbConnection();

            conn.Open();
            IDbTransaction trx = conn.BeginTransaction();

            try
            {
                MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Info           dacBscKpiInfo           = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Info();
                MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Target_Version dacBscKpiTargetVersion  = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Target_Version();
                MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result         dacBscKpiResult         = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result();
                MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Term           dacBscKpiTerm           = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Term();
                MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Target         dacBscKpiTarget         = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Target();
                MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Threshold_Info dacBscKpiThresholdInfo  = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Threshold_Info();
                MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Initiative     dacBscKpiInitiative     = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Initiative();
                MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Classification dacBscKpiClassification = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Classification();


                foreach (string obj in objList)
                {
                    okCnt = dacBscKpiInfo.Delete_DB(conn
                                                    , trx
                                                    , estterm_ref_id
                                                    , obj);

                    okCnt = dacBscKpiTargetVersion.Delete_DB(conn
                                                             , trx
                                                             , estterm_ref_id
                                                             , obj);

                    okCnt = dacBscKpiResult.DeleteData_DB(conn
                                                          , trx
                                                          , estterm_ref_id
                                                          , obj);

                    okCnt = dacBscKpiTerm.Delete_DB(conn
                                                    , trx
                                                    , estterm_ref_id
                                                    , obj);

                    okCnt = dacBscKpiTarget.Delete_DB(conn
                                                      , trx
                                                      , estterm_ref_id
                                                      , obj);

                    okCnt = dacBscKpiThresholdInfo.Delete_DB(conn
                                                             , trx
                                                             , estterm_ref_id
                                                             , obj);

                    okCnt = dacBscKpiInitiative.DeleteData_DB(conn
                                                              , trx
                                                              , estterm_ref_id
                                                              , obj);

                    okCnt = dacBscKpiClassification.Delete_DB(conn
                                                              , trx
                                                              , estterm_ref_id
                                                              , obj);
                }

                trx.Commit();
            }
            catch (Exception ex)
            {
                rtnValue = ex.Message;
                trx.Rollback();
            }
            finally
            {
                conn.Close();
            }

            return(rtnValue);
        }