예제 #1
0
        //internal sqlControl.DataControl sdCon = null;

        protected SqlDataReader getLaborReason(string sCode, sqlControl.DataControl sdCon)
        {
            //// 奉行SQLServer接続文字列取得
            //string sc = sqlControl.obcConnectSting.get(dbName);
            //sdCon = new sqlControl.DataControl(sc);

            // 事由データ取得
            StringBuilder sb = new StringBuilder();

            sb.Clear();
            sb.Append("select LaborReasonCode,AcquireUnit,AcquireDivision,LaborReasonDivision from tbLaborReason ");
            sb.Append("where IsValid = 1 and LaborReasonCode = '" + sCode.PadLeft(2, '0') + "'");

            SqlDataReader dR = sdCon.free_dsReader(sb.ToString());

            return(dR);
        }
예제 #2
0
        ///------------------------------------------------------------
        /// <summary>
        ///     就業奉行時間表記設定取得(0:24時間表記 1:48時間表記) </summary>
        /// <returns>
        ///     0:24時間表記 1:48時間表記 -1:エラー</returns>
        ///------------------------------------------------------------
        private int getLaborSystemCodeFigure()
        {
            int cf = -1;

            // 奉行SQLServer接続文字列取得
            string sc = sqlControl.obcConnectSting.get(_dbName);

            // 奉行SQLServer接続
            sqlControl.DataControl sdCon = new sqlControl.DataControl(sc);
            SqlDataReader          dR    = null;

            try
            {
                // 就業奉行時間表記設定取得(0:24時間表記 1:48時間表記)
                StringBuilder sb = new StringBuilder();
                sb.Clear();
                sb.Append("select DateTimeIndication from tbHR_CorpOperationConfig ");

                dR = sdCon.free_dsReader(sb.ToString());

                while (dR.Read())
                {
                    cf = Utility.StrtoInt(dR["DateTimeIndication"].ToString());
                }

                return(cf);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return(cf);
            }
            finally
            {
                if (!dR.IsClosed)
                {
                    dR.Close();
                }

                if (sdCon.Cn.State == ConnectionState.Open)
                {
                    sdCon.Close();
                }
            }
        }