예제 #1
0
        public ParamUpdate ToParamUpdate()
        {
            var pUpdate = ParamUpdate.Instance();

            pUpdate.Update(GetTableName());
            EachColumn(IsUpdate: true, handler: name => pUpdate.Column(name, this[name]));
            EachWhere(c => pUpdate.Where(builder => BuildCondition(builder, c)));
            return(pUpdate);
        }
예제 #2
0
        public ParamUpdate ToParamUpdate()
        {
            var settings = XElement.Parse(settingXml);
            var pUpdate  = ParamUpdate.Instance().Update(getXmlElementValue(settings, "table"));

            var list = new List <string>();

            parseWhere(settings, (name, value, compare, variable, extend) =>
            {
                pUpdate.AndWhere(name, value, compare, extend);
                list.Add(variable);
            });

            parseColumns(settings, (name, value) =>
            {
                if (list.IndexOf(name) < 0)
                {
                    pUpdate.Column(name, value);
                }
            });
            return(pUpdate);
        }