保存语句获得ID值

2017-02-19 13:32:53  访问(1557) 赞(0) 踩(0)


        /// <summary>
        /// 获得ID的值
        /// </summary>
        /// <returns></returns>
        public object GetISaveItemObjectID()
        {
            string _name = p_IDFieldName.ToLower();

            if (m_DictionaryISaveItem.ContainsKey(_name))
            {
                return m_DictionaryISaveItem[_name].theValue;
            }

            throw new Exception("方法:" + MethodBase.GetCurrentMethod().ReflectedType.FullName + " " + MethodBase.GetCurrentMethod().ToString() + " 发生异常:" + "获得获得关键字的值。");

        }

        /// <summary>
        /// 获得ID的值
        /// </summary>
        /// <returns></returns>
        public string GetISaveItemStringID()
        {
            string _name = p_IDFieldName.ToLower();

            if (m_DictionaryISaveItem.ContainsKey(_name))
            {
                return m_DictionaryISaveItem[_name].theValue.ToString();
            }

            throw new Exception("方法:" + MethodBase.GetCurrentMethod().ReflectedType.FullName + " " + MethodBase.GetCurrentMethod().ToString() + " 发生异常:" + "获得获得关键字的值。");

        }

        /// <summary>
        /// 获得ID的值
        /// </summary>
        /// <returns></returns>
        public long GetISaveItemLongID()
        {
            string _name = p_IDFieldName.ToLower();

            if (m_DictionaryISaveItem.ContainsKey(_name))
            {
                return long.Parse(m_DictionaryISaveItem[_name].theValue.ToString());
            }

            throw new Exception("方法:" + MethodBase.GetCurrentMethod().ReflectedType.FullName + " " + MethodBase.GetCurrentMethod().ToString() + " 发生异常:" + "获得获得关键字的值。");

        }

        /// <summary>
        /// 获得ID的值
        /// </summary>
        /// <returns></returns>
        public int GetISaveItemIntID()
        {
            string _name = p_IDFieldName.ToLower();

            if (m_DictionaryISaveItem.ContainsKey(_name))
            {
                return int.Parse(m_DictionaryISaveItem[_name].theValue.ToString());
            }


            throw new Exception
                (
                    "方法:"
                    + MethodBase.GetCurrentMethod().ReflectedType.FullName
                    + " "
                    + MethodBase.GetCurrentMethod().ToString()
                    + " 发生异常:"
                    + "没有获得关键字的值。"
                );
        }


标签:保存语句获得ID值 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)
 
  ┈全部┈  
 
(显示默认分类)