protected void tcField_NodeClick(object sender, TNodeEventArgs e) { try { if (e.Node.Attributes["IsEntity"] == "true") { return; } this.lbConditionField.Attributes["_FieldAndRelationId"] = e.Node.Value; this.lbConditionField.Text = e.Node.Text; //处理枚举类型 var _Field = this.EntityCache.FindById <SysField>(e.Node.Value.Split('-')[0].ToLong()); if (_Field != null && _Field.DataType == (int)DataTypeEnum.penum) { this.tcConditionValue.DropdownType = ComboControl.DropdownTypes.DropdownList; this.tcConditionValue.DataSource = _Field.RefEnum.EnumItems; this.tcConditionValue.DataTextField = "DisplayText"; this.tcConditionValue.DataValueField = "ItemValue"; this.tcConditionValue.DataBind(); } else { this.tcConditionValue.DropdownType = ComboControl.DropdownTypes.AutoComplete; this.tcConditionValue.Items.Clear(); } this.tcConditionValue.SetValue(null); } catch (Exception ex) { this.AjaxAlert(ex); } }
protected void tcField_NodeClick(object sender, TNodeEventArgs e) { try { if (e.Node.Attributes["IsEntity"] == "true") { return; } this.lbDisplayText.Text = e.Node.Text; this.tcDisplayText.SetValue(e.Node.Text); this.lbDisplayText.Attributes["_FieldAndRelationId"] = e.Node.Value; } catch (Exception ex) { this.AjaxAlert(ex); } }
protected void tcField_NodeClick(object sender, TNodeEventArgs e) { try { if (e.Node.Attributes["IsEntity"] == "true") { return; } var model = new SysReportQueryField(); var _firstIndex = e.Node.Value.IndexOf('-'); model.Field1Id = e.Node.Value.Substring(0, _firstIndex).ToLong(); model.Relation1Id = e.Node.Value.Substring(_firstIndex + 1); var _Field1 = this.EntityCache.FindById <SysField>(model.Field1Id); model.DefaultDisplayText = string.Format("{0}-{1}", e.Node.Parent.Text, _Field1.DisplayText); model.QueryFieldId = this.DataHelper.GetNextIdentity_Int(); model.ReportId = this.__Id; model.FunctionType = (int)ReportFunctionTypeEnum.JustAdd; model.Field1Name = _Field1.FieldName; model.Aliases = _Field1.FieldName; //保证本报表中没有别名相同的,至于它具体是什么,不要在意细节啊~ while (this.DataHelper.FirstOrDefault <SysReportQueryField>(p => p.ReportId == this.__Id && p.Aliases == model.Aliases) != null) { model.Aliases = string.Format("{0}{1}", _Field1.FieldName, this.GetRandomCode()); } model.DisplayText = _Field1.DisplayText; this.DataHelper.Insert(model); InitGrid(); //清空选择 tcField.CheckedValue = new List <string>(); } catch (Exception ex) { this.AjaxAlert(ex); } }
/// <summary> /// 节点点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void tree_NodeClick(object sender, TNodeEventArgs e) { }
/// <summary> /// 节点点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void tree_NodeClick(object sender, TNodeEventArgs e) { __IsAdd = false; __Id = Convert.ToInt32(e.Node.Value); BindDetail(); }