예제 #1
0
        /// <summary>
        /// 센터 정보를 조회한다.
        /// </summary>
        /// <returns></returns>
        private DataTable GetDatabaseConnectionInfo()
        {
            try
            {
                DataTable dtRtnValue       = null;
                var       strProcedureName = "PK_C1001.SP_CNTR_LIST_INQ";
                var       dicInputParam    = new Dictionary <string, object>();
                string[]  arrOutputParam   = { "O_CNTR_LIST", "O_RSLT" };

                using (FirstDataAccess dataAccess = new FirstDataAccess())
                {
                    var dsDatabaseConnectionInfo = dataAccess.GetSpDataSet(strProcedureName, dicInputParam, arrOutputParam);

                    var strErrCode = string.Empty;
                    var strErrMsg  = string.Empty;

                    if (this.BaseClass.CheckResultDataProcess(dsDatabaseConnectionInfo, ref strErrCode, ref strErrMsg) == true)
                    {
                        dtRtnValue = dsDatabaseConnectionInfo.Tables["O_CNTR_LIST"];
                    }
                    else
                    {
                        dtRtnValue = null;
                        MessageBox.Show(strErrMsg);
                    }
                }

                return(dtRtnValue);
            }
            catch { throw; }
        }
        public static DataTable GetFirstCommonData(string _strCommonCode)
        {
            DataTable dtCommonData     = null;
            var       strProcedureName = "PK_COMMON.SP_COM_UI_CMB";
            Dictionary <string, object> dicInputParam = new Dictionary <string, object>();

            string[] arrOutputParam = { "O_CMB_LIST", "O_RSLT" };

            dicInputParam.Add("P_TYPE_CD", _strCommonCode);                     // 공통코드
            dicInputParam.Add("P_ATTR_ONE", string.Empty);                      // 공통코드 조회 파라메터 1
            dicInputParam.Add("P_ATTR_TWO", string.Empty);                      // 공통코드 조회 파라메터 2
            dicInputParam.Add("P_ATTR_THREE", string.Empty);                    // 공통코드 조회 파라메터 3
            dicInputParam.Add("P_ATTR_FOUR", string.Empty);                     // 공통코드 조회 파라메터 4

            if (Base.Settings1.Default.MainDatabase.ToUpper().Equals("ORACLE") == false)
            {
                strProcedureName = Data.DataConvert.GetSplitToString(strProcedureName, '.', 1);
            }

            using (FirstDataAccess da = new FirstDataAccess())
            {
                dtCommonData = da.GetSpDataTable(strProcedureName, dicInputParam, arrOutputParam);
            }

            return(dtCommonData);
        }
예제 #3
0
        /// <summary>
        /// 프로그램 실행 후 센터별 데이터베이스 연결 문자열을 조회한다.
        /// </summary>
        /// <param name="_strDBConnectionType">데이터베이션 연결 타입</param>
        /// <returns></returns>
        private DataSet GetDatabaseConnectionInfo(string _strDBConnectionType)
        {
            try
            {
                DataSet dsRtnValue       = null;
                var     strProcedureName = "UI_CNTR_LIST_INQ";
                Dictionary <string, object> dicInputParam = new Dictionary <string, object>();
                var strErrCode = string.Empty;
                var strErrMsg  = string.Empty;

                using (FirstDataAccess da = new FirstDataAccess())
                {
                    dsRtnValue = da.GetSpDataSet(strProcedureName, dicInputParam);

                    if (this.BaseClass.CheckResultDataProcess(dsRtnValue, ref strErrCode, ref strErrMsg, BaseEnumClass.SelectedDatabaseKind.MS_SQL) == true)
                    {
                        return(dsRtnValue);
                    }
                    else
                    {
                        dsRtnValue = null;
                        MessageBox.Show("프로그램 실행 중 오류가 발생했습니다.\r\n" + "(" + strErrMsg + ")" + "\r\n프로그램이 종료됩니다.");
                        App.Current.Shutdown();
                    }
                }

                return(dsRtnValue);
            }
            catch { throw; }
        }
예제 #4
0
        /// <summary>
        /// 메뉴 정보를 조회한다.
        /// </summary>
        /// <returns></returns>
        private DataSet GetMenuList()
        {
            try
            {
                #region  라메터 변수 선언 및 값 할당
                DataSet dsRtnValue       = null;
                var     strProcedureName = "PK_C1000.SP_MENU_LIST_INQ";
                Dictionary <string, object> dicInputParam = new Dictionary <string, object>();
                string[] arrOutputParam = { "O_MENU_LIST", "O_USER_INFO_LIST", "O_RSLT" };
                #endregion

                #region Input 파라메터
                var strCenterCD = Kiosk.KioskBaseClass.ComboBoxSelectedKeyValue(this.cboCenter);
                var strUserID   = this.txtUserID.Text.Trim();

                dicInputParam.Add("P_CNTR_CD", strCenterCD);       // 센터 코드
                dicInputParam.Add("P_USER_ID", strUserID);         // 사용자 ID
                #endregion

                using (FirstDataAccess dataAccess = new FirstDataAccess())
                {
                    dsRtnValue = dataAccess.GetSpDataSet(strProcedureName, dicInputParam, arrOutputParam);
                }

                return(dsRtnValue);
            }
            catch { throw; }
        }
예제 #5
0
        /// <summary>
        /// 인터페이스 번호 채번
        /// </summary>
        /// <returns></returns>
        private string GetSP_IF_NO_INQ()
        {
            try
            {
                #region  라메터 변수 선언 및 값 할당
                string  strRtnValue      = string.Empty;
                DataSet dsRtnValue       = null;
                var     strProcedureName = "PK_IF_CHUTE_PLAN_HUB_R.SP_IF_NO_INQ";
                Dictionary <string, object> dicInputParam = new Dictionary <string, object>();
                string[] arrOutputParam = { "O_IF_NO", "O_RSLT" };
                #endregion

                //#region 데이터 조회
                using (FirstDataAccess dataAccess = new FirstDataAccess())
                {
                    dsRtnValue = dataAccess.GetSpDataSet(strProcedureName, dicInputParam, arrOutputParam);
                }

                if (dsRtnValue.Tables[0].Rows.Count > 0)
                {
                    strRtnValue = dsRtnValue.Tables[0].Rows[0]["IF_NO"].ToString();
                }

                return(strRtnValue);
            }
            catch { throw; }
        }
예제 #6
0
        /// <summary>
        /// 바코드 수신값을 테이블에 저장
        /// </summary>
        /// <param name="_barcode">웹서비스를 통해 수신한 바코드 (Validation 조건)</param>
        /// <returns></returns>
        private DataTable GetIF_RGN_MST_HUB_R(Barcode _barcode)
        {
            try
            {
                #region  라메터 변수 선언 및 값 할당
                DataTable dtRtnValue       = null;
                var       strProcedureName = "SP_IF_REGEX_MST_HUB_R";
                Dictionary <string, object> dicInputParam = new Dictionary <string, object>();
                string[] arrOutputParam = { "O_RTN_MSG" };
                #endregion

                var strEqpID = this.BaseClass.CenterCD.Equals("BC") ? "BCSMS-2" : "YSSMS-1";

                #region Input 파라메터
                dicInputParam.Add("P_EQP_ID", strEqpID);
                dicInputParam.Add("P_INV_NO_REGEX", _barcode.INVOICE_NUM);
                dicInputParam.Add("P_BOX_BCD_REGEX", _barcode.BOX_CODE);
                dicInputParam.Add("P_RGN_BCD_REGEX", _barcode.SORTING_CODE);
                #endregion

                using (FirstDataAccess dataAccess = new FirstDataAccess())
                {
                    dtRtnValue = dataAccess.GetSpDataTable(strProcedureName, dicInputParam, arrOutputParam);
                }

                return(dtRtnValue);
            }
            catch { throw; }
        }
예제 #7
0
        /// <summary>
        /// 수신한 슈트 플랜 데이터 저장
        /// </summary>
        /// <param name="_sorter"></param>
        /// <returns></returns>
        private DataTable SaveSP_IF_CHUTE_PLAN_HUB_R(Sorter _sorter)
        {
            try
            {
                // 인터페이스 번호 체번
                var strInterfaceNo = this.GetSP_IF_NO_INQ();

                // 수행 여부 체크
                bool isProCYN = this.GetSP_IF_PROC_CHK(_sorter.sorterId, _sorter.version, strInterfaceNo);

                if (isProCYN == false)
                {
                    return(null);
                }

                if (strInterfaceNo.Length == 0)
                {
                    return(null);
                }

                #region  라메터 변수 선언 및 값 할당
                DataTable dtRtnValue       = null;
                var       strProcedureName = "PK_IF_CHUTE_PLAN_HUB_R.SP_IF_CHUTE_PLAN_HUB_R";
                Dictionary <string, object> dicInputParam = new Dictionary <string, object>();
                string[] arrOutputParam = { "O_RSLT" };
                #endregion

                #region Input 파라메터
                foreach (var item in _sorter.rules)
                {
                    try
                    {
                        dicInputParam.Add("P_IF_NO", strInterfaceNo);               // Interface 번호
                        dicInputParam.Add("P_EQP_ID", _sorter.sorterId);            // 설비 ID
                        dicInputParam.Add("P_SRT_MODE", _sorter.sortingMode);
                        dicInputParam.Add("P_VER", _sorter.version);
                        dicInputParam.Add("P_CHUTE_ID", item.chuteNumber);
                        dicInputParam.Add("P_RGN_CD", item.sortingCode);
                        dicInputParam.Add("P_RGN_CD_LGCY", item.sortingCodeLegacy);

                        using (FirstDataAccess dataAccess = new FirstDataAccess())
                        {
                            dtRtnValue = dataAccess.GetSpDataTable(strProcedureName, dicInputParam, arrOutputParam);
                        }
                    }
                    catch (Exception err)
                    {
                        this.BaseClass.Error(err);
                    }
                }
                #endregion

                return(dtRtnValue);
            }
            catch { throw; }
        }
예제 #8
0
        /// <summary>
        /// 인터페이스 받은 데이터 저장 수행 여부 체크
        /// </summary>
        /// <param name="_strSorterID">소터 ID</param>
        /// <param name="_strVersion">버전</param>
        /// <param name="_strInterfaceNo">인터페이스 번호</param>
        /// <returns></returns>
        private bool GetSP_IF_PROC_CHK(string _strSorterID, string _strVersion, string _strInterfaceNo)
        {
            try
            {
                #region  라메터 변수 선언 및 값 할당
                bool    isRtnValue       = false;
                DataSet dsRtnValue       = null;
                var     strProcedureName = "PK_IF_CHUTE_PLAN_HUB_R.SP_IF_PROC_CHK";
                Dictionary <string, object> dicInputParam = new Dictionary <string, object>();
                string[] arrOutputParam = { "O_IF_PROC_YN", "O_RSLT" };
                #endregion

                #region Input 파라메터
                dicInputParam.Add("P_IF_NO", _strInterfaceNo);
                dicInputParam.Add("P_EQP_ID", _strSorterID);
                dicInputParam.Add("P_VER", _strVersion);
                #endregion

                //#region 데이터 조회
                using (FirstDataAccess dataAccess = new FirstDataAccess())
                {
                    dsRtnValue = dataAccess.GetSpDataSet(strProcedureName, dicInputParam, arrOutputParam);
                }

                if (dsRtnValue.Tables.Count > 0)
                {
                    if (dsRtnValue.Tables[0].Rows.Count > 0)
                    {
                        isRtnValue = dsRtnValue.Tables[0].Rows[0]["PROC_YN"].Equals("Y") ? true : false;
                    }
                }

                return(isRtnValue);
            }
            catch { throw; }
        }
예제 #9
0
        /// <summary>
        /// 로그인
        /// </summary>
        /// <returns></returns>
        private int GetSP_LOGIN_LIST_INQ()
        {
            try
            {
                int iRtnValue = -1;

                #region  라메터 변수 선언 및 값 할당
                DataSet dsRtnValue       = null;
                var     strProcedureName = "PK_C1001.SP_LOGIN_LIST_INQ";
                Dictionary <string, object> dicInputParam = new Dictionary <string, object>();
                string[] arrOutputParam = { "O_RSLT" };
                #endregion

                #region Input 파라메터
                var strCenterCD = ((ComboBoxInfo)this.cboCenter.SelectedItem).CODE;                  // 센터코드
                var strIpAddess = this.BaseClass.GetIPAddress();
                var strUserID   = this.txtUserID.Text.Trim();
                var strPwd      = this.txtPwd.Password.Trim();

                dicInputParam.Add("P_CNTR_CD", strCenterCD);                                       // 센터코드
                dicInputParam.Add("P_USER_ID", strUserID);                                         // 사용자 ID
                dicInputParam.Add("P_PWD", this.BaseClass.EncryptSHA256(strPwd));                  // 비밀번호
                dicInputParam.Add("P_IP_NO", strIpAddess);                                         // 로컬 IP
                #endregion

                using (FirstDataAccess dataAccess = new FirstDataAccess())
                {
                    dsRtnValue = dataAccess.GetSpDataSet(strProcedureName, dicInputParam, arrOutputParam);
                }

                if (dsRtnValue.Tables[0].Rows.Count == 0)
                {
                    //this.BaseClass.MsgError("", BaseEnumClass.CodeMessage.MESSAGE);
                    iRtnValue = 99;
                }
                else
                {
                    switch (dsRtnValue.Tables[0].Rows[0]["CODE"].ToString())
                    {
                    case "0":
                        #region + 로그인 성공
                        iRtnValue = 0;
                        #endregion
                        break;

                    case "1":
                        #region + 비밀번호 재설정

                        // INFO_PASSWORD_RESETTING_OPEN_WINDOW - 비밀번호 재설정이 필요합니다.|창이 오픈되면 비밀번호를 재설정해주세요.
                        //this.BaseClass.MsgInfo("INFO_PASSWORD_RESETTING_OPEN_WINDOW");
                        iRtnValue = 1;
                        #endregion
                        break;

                    case "2":
                        #region + 사용자 정보 없음
                        iRtnValue = 2;
                        #endregion
                        break;

                    case "9":
                        #region 연결 IP 체크
                        //this.BaseClass.MsgError(dsRtnValue.Tables[0].Rows[0]["MSG"].ToString(), BaseEnumClass.CodeMessage.MESSAGE);
                        iRtnValue = 9;
                        #endregion
                        break;
                    }
                }

                return(iRtnValue);
            }
            catch { throw; }
        }