/// <summary>
		/// 反序列化
		/// </summary>
		/// <param name="dictionary"></param>
		/// <param name="type"></param>
		/// <param name="serializer"></param>
		/// <returns></returns>
		public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
		{
			WhereSqlClauseBuilder whereBuilder = new WhereSqlClauseBuilder
			{
				LogicOperator =
					dictionary.GetValue("LogicOperator", LogicOperatorDefine.Or)
			};

			var sqlClauseItems = dictionary.GetValue("List", new ArrayList());

			foreach (var item in sqlClauseItems)
			{
				SqlClauseBuilderItemUW builderItem = JSONSerializerExecute.Deserialize<SqlClauseBuilderItemUW>(item);

				whereBuilder.Add(builderItem);
				//IDictionary<string, object> objects = (item as IDictionary<string, object>);

				//if (objects != null)
				//    whereBuilder.AppendItem(objects["DataField"].ToString(), objects["Data"].ToString());
			}

			return whereBuilder;
		}
Beispiel #2
0
        /// <summary>
        /// 反序列化
        /// </summary>
        /// <param name="dictionary"></param>
        /// <param name="type"></param>
        /// <param name="serializer"></param>
        /// <returns></returns>
        public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WhereSqlClauseBuilder whereBuilder = new WhereSqlClauseBuilder
            {
                LogicOperator =
                    dictionary.GetValue("LogicOperator", LogicOperatorDefine.Or)
            };

            var sqlClauseItems = dictionary.GetValue("List", new ArrayList());

            foreach (var item in sqlClauseItems)
            {
                SqlClauseBuilderItemUW builderItem = JSONSerializerExecute.Deserialize <SqlClauseBuilderItemUW>(item);

                whereBuilder.Add(builderItem);
                //IDictionary<string, object> objects = (item as IDictionary<string, object>);

                //if (objects != null)
                //    whereBuilder.AppendItem(objects["DataField"].ToString(), objects["Data"].ToString());
            }

            return(whereBuilder);
        }