Beispiel #1
0
        /// <summary>
        /// 数据列表转为对象
        /// </summary>
        /// <typeparam name="T">对象类型</typeparam>
        /// <returns>对象</returns>
        private T List2Object <T>()
        {
            string sJson  = Angel_DataJson.List2Json(this.lst_colId, this.lst_Value);
            T      Object = Angel_DataJson.json2Object <T>(sJson);

            return((T)Object);
        }
Beispiel #2
0
        /// <summary>
        /// 用Json字符串更新对象
        /// </summary>
        /// <typeparam name="T">对戏类</typeparam>
        /// <param name="strJson_obj2Update">Json数据</param>
        /// <returns>是否成功</returns>
        public bool InsertObjectByJson <T>(string strJson_obj2Insert)
        {
            //用Json给值列表赋值
            T obj2Insert = Angel_DataJson.json2Object <T>(strJson_obj2Insert);

            GetObjValueList <T>(obj2Insert);
            //设定条件
            SetCondition(lst_colId[0], lst_Value[0]);
            //更新DB
            return(InsertData());
        }