Esempio n. 1
0
        public void CopyFrom(WhereItem wi)
        {
            Name       = wi.Name;
            LinkType   = wi.LinkType;
            Condition  = wi.Condition;
            Tag        = wi.Tag;
            SourceFmt  = wi.SourceFmt;
            StartIndex = wi.StartIndex;

            InputItems.Clear();

            foreach (InputItem ii in wi.InputItems.Values)
            {
                InputItem curNew = new InputItem();
                curNew.CopyFrom(ii);

                InputItems.Add(ii.Name, curNew);
            }
        }
Esempio n. 2
0
        public void AddInputItem(InputItem ii, int startIndex)
        {
            ii.Parent = this;

            InputItems.Add(ii.Name, ii, startIndex);
        }
Esempio n. 3
0
        public void LoadWhereFromString(string whereitem)
        {
            if (string.IsNullOrEmpty(whereitem))
            {
                return;
            }

            SourceFmt = whereitem;

            string tmp = whereitem;

            int indexStart = tmp.IndexOf("<wi=");

            if (indexStart < 0)
            {
                return;
            }

            indexStart = indexStart + 4;
            int indexEnd = tmp.IndexOf(":", indexStart + 1);

            Name = tmp.Substring(indexStart, indexEnd - indexStart);

            tmp = tmp.Substring(indexEnd + 1);

            indexStart = tmp.IndexOf(@"连接类型=""");
            if (indexStart < 0)
            {
                LinkType = "";
                indexEnd = -1;
            }
            else
            {
                indexStart = indexStart + 5;
                indexEnd   = tmp.IndexOf(",", indexStart + 1);

                LinkType = tmp.Substring(indexStart, indexEnd - indexStart).Replace(@"""", "");
            }

            tmp = tmp.Substring(indexEnd + 1).Replace("/wi>", "");

            string curCondation = tmp;

            //配置录入项
            MatchInfos inputs = QueryHelper.GetMinMatchData(tmp, "[", "]", '"', '"');

            foreach (MatchInfo input in inputs)
            {
                string[] pros = input.MatchContext.Split(',');

                InputItem ii = new InputItem();
                ii.Name = pros[0];

                curCondation = curCondation.Replace(input.MatchContext, ii.Name);

                ii.ControlType    = FindPro(pros, "类型", "文本框");
                ii.DBAlias        = FindPro(pros, "数据源");
                ii.DataFrom       = FindPro(pros, "数据来源");
                ii.ExtPro         = FindPro(pros, "扩展属性");
                ii.DefaultValue   = FindPro(pros, "默认值");
                ii.IsWhereReplace = (FindPro(pros, "条件替换") == "1" ? true : false);
                //ii.StartIndex = input.StartIndex;

                ii.Parent = this;

                InputItems.Add(ii.Name, ii, input.StartIndex);
            }

            Condition = curCondation;
        }
Esempio n. 4
0
 public WhereItem()
 {
     InputItems = new InputItems();
 }