Esempio n. 1
0
        /// <summary>
        /// 版式リスト取得
        /// </summary>
        /// <remarks>
        /// 作成者    :  nakao
        /// 作成日    :  2019/09/01
        /// </remarks>
        private void GetHanTypeList()
        {
            DataSet  dtSet             = null;
            DataBase dataBase          = null;
            List <SelectListItem> list = new List <SelectListItem>();

            try
            {
                dataBase = new DataBase();
                string sqlStr = QueryBuild.GetHanType();

                dataBase.ConnectDB();
                dtSet = dataBase.GetDataSet(sqlStr, null);

                foreach (DataRow row in dtSet.Tables[0].Rows)
                {
                    list.Add(new SelectListItem
                    {
                        Text  = row["HANSKI_NM"].ToString(),
                        Value = row["HAN_KBN"].ToString()
                    });
                }

                dataBase.DisconnectDB();
            }
            catch (Exception ex)
            {
                ConditionErrorMessage = Resources.TextResource.ErrorGetCondition;
            }
            finally
            {
                HanTypeList = new SelectList(list, "Value", "Text");
                if (dataBase != null)
                {
                    dataBase.DisconnectDB();
                }
                if (dtSet != null)
                {
                    dtSet.Dispose();
                }
            }
        }