private void simpleButton1_Click(object sender, EventArgs e) { QueryForm pform = this.ParentForm as QueryForm; if (pform == null) { return; } if (pform.CurrQD == null) { return; } _Entity_SubInfo info1 = new _Entity_SubInfo(); DataRow row = this.Activitie.StructSource.ModelSubSegments.GetRowByOther(pform.CurrQD.ID.ToString()); if (row == null) { return; } _ObjectSource.GetObject(info1, row); pform.CurrQD = info1; foreach (TreeListNode node in this.treeListEx1.Nodes) { treeListEx1_AfterCheckNode(this.treeListEx1, new DevExpress.XtraTreeList.NodeEventArgs(node)); } foreach (DataRowView item in this.treeListEx1.CheckNodes) { _Entity_SubInfo info = new _Entity_SubInfo(); GLODSOFT.QDJJ.BUSINESS._Methods.SetSubheadingsInfoByTJ(info, item.Row, this.Activitie.Property.Libraries.FixedLibrary.FullName); DataRow[] rows = this.Activitie.Property.Libraries.FixedLibrary.LibraryDataSet.Tables["定额表"].Select("DINGEH='" + info.OLDXMBM + "'"); if (rows.Length > 0) { info.JX = rows[0]["JIANGX"].Equals("是") ? true : false; info.TX = rows[0]["TX1"].ToString(); } // info.IsHs = false; _Methods_Fixed fix = new _Methods_Fixed(this.CurrentBusiness, this.Activitie, pform.CurrQD); fix.Create(-1, info); } pform.BindData(); }
/// <summary> /// 查询窗口 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void QueryForm(object sender, object e) { Container form1 = sender as Container; SubSegmentForm obj = form1.GetWorkAreas as SubSegmentForm; if (obj != null) { DataRowView v = obj.subSegmentListData1.treeList1.Current as DataRowView; if (v != null) { QueryForm form = new QueryForm(obj); form.Activitie = obj.Activitie; form.CurrentBusiness = obj.CurrentBusiness; form.Sform = obj; switch (v["LB"].ToString()) { case "子目录": _Entity_SubInfo info = new _Entity_SubInfo(); DataRow row = obj.Activitie.StructSource.ModelSubSegments.GetRowByOther(v["ID"].ToString()); _ObjectSource.GetObject(info, row); form.CurrQD = info; break; case "清单": _Entity_SubInfo info2 = new _Entity_SubInfo(); DataRow row2 = obj.Activitie.StructSource.ModelSubSegments.GetRowByOther(v["ID"].ToString()); _ObjectSource.GetObject(info2, row2); form.CurrQD = info2; break; default: _Entity_SubInfo info1 = new _Entity_SubInfo(); DataRow row1 = obj.Activitie.StructSource.ModelSubSegments.GetRowByOther(v["PID"].ToString()); _ObjectSource.GetObject(info1, row1); form.CurrQD = info1; break; } form.Show(obj); } } }
private void simpleButton2_Click(object sender, EventArgs e) { QueryForm pform = this.ParentForm as QueryForm; if (pform == null) { return; } if (pform.CurrQD == null) { return; } _Entity_SubInfo info = new _Entity_SubInfo(); DataRow row = this.Activitie.StructSource.ModelSubSegments.GetRowByOther(pform.CurrQD.ID.ToString()); if (row == null) { return; } _ObjectSource.GetObject(info, row); pform.CurrQD = info; DataRow r = this.Activitie.StructSource.ModelSubSegments.GetRowByOther(pform.CurrQD.ID.ToString()); string TextValue = r["XMMC"].ToString(); string Titile = _Constant.回车符 + "【标准图集】"; string TJNR = _Constant.回车符 + "【标准图集】" + _Constant.回车符; DataRowView view = this.bindingSource1.Current as DataRowView; if (view == null) { return; } DataRow[] rows1 = this.ds.Tables["图集索引表"].Copy().Select(string.Format("SYBH={0}", view["SYBH"])); if (rows1.Length > 0) { DataRow[] rows = this.ds.Tables["图集索引表"].Copy().Select(string.Format("SYBH={0}", rows1[0]["PARENTID"])); if (rows.Length > 0) { if (ToolKit.ParseInt(rows[0]["PARENTID"]) == 1) { TJNR += rows[0]["MUNR"] + ":" + rows1[0]["MUNR"] + ":" + (this.bindingSource1.Current as DataRowView)["TJBH"] + _Constant.回车符; } else { DataRow[] rows2 = this.ds.Tables["图集索引表"].Select(string.Format("SYBH={0}", rows[0]["PARENTID"])); if (rows2.Length > 0) { TJNR += (rows2[0]["MUNR"] + ":" + rows[0]["MUNR"] + ":" + rows1[0]["MUNR"] + ":" + (this.bindingSource1.Current as DataRowView)["TJBH"] + _Constant.回车符); } } } } int i = 1; string Str = ""; foreach (TreeListNode node in this.treeListEx2.Nodes) { treeListEx1_AfterCheckNode(this.treeListEx2, new DevExpress.XtraTreeList.NodeEventArgs(node)); } foreach (DataRowView item in this.treeListEx2.CheckNodes) { if (item["ZFMC"].ToString() != "") { Str += i.ToString() + "." + item["ZFMC"] + _Constant.回车符; i++; } } Str = Str.TrimEnd(); TJNR += Str; string Result = GLODSOFT.QDJJ.BUSINESS._Methods.SetTextBox(TextValue, TJNR, Titile); r.BeginEdit(); r["XMMC"] = Result; r.EndEdit(); SubSegmentForm form = pform.Sform; if (form != null) { form.subSegmentListData1.treeList1.Refresh(); } }