private void butSure_Click(object sender, EventArgs e) { try { if (ValidateData() == false) { return; } WhereItem result = new WhereItem(); result.Name = txtWhereItemName.Text; result.LinkType = cbxLinkType.Text; result.Condition = rtbWhereContext.Text; foreach (TabPage tc in tabItems.TabPages) { InputItem ii = new InputItem(); ii.CopyFrom(_wi.InputItems[tc.Name]); if (string.IsNullOrEmpty(ii.ControlType)) { ii.ControlType = QueryConstDefine.Txt; } result.AddInputItem(ii, ii.StartIndex); } result.SourceFmt = result.SaveWhereToString(); _wi = result; _isOk = true; this.Close(); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
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); } }