protected void bt_Add_Click(object sender, EventArgs e) { Rpt_DataSetTableRelationsBLL relation; if (ViewState["SelectedID"] == null) relation = new Rpt_DataSetTableRelationsBLL(); else relation = new Rpt_DataSetTableRelationsBLL((Guid)ViewState["SelectedID"]); relation.Model.ParentTableID = new Guid(ddl_ParentTable.SelectedValue); relation.Model.ParentFieldID = new Guid(ddl_ParentField.SelectedValue); relation.Model.ChildTableID = new Guid(ddl_ChildTable.SelectedValue); relation.Model.ChildFieldID = new Guid(ddl_ChildField.SelectedValue); relation.Model.JoinMode = ddl_RelateionMode.SelectedValue; relation.Model.RelationCondition = tbx_RelationCondition.Text; relation.Model.SortID = int.Parse(tbx_SortID.Text); if (ViewState["SelectedID"] == null) { relation.Model.DataSet = (Guid)ViewState["ID"]; relation.Add(); } else { relation.Update(); ViewState["SelectedID"] = null; gv_List.SelectedIndex = -1; } bt_Add.Text = "新 增"; BindGrid(); new Rpt_DataSetBLL((Guid)ViewState["ID"]).ClearCache(); MessageBox.Show(this, "保存成功!"); }
private void BindData() { Rpt_DataSetTableRelationsBLL relation = new Rpt_DataSetTableRelationsBLL((Guid)ViewState["SelectedID"]); ddl_ParentTable.SelectedValue = relation.Model.ParentTableID.ToString(); ddl_ParentTable_SelectedIndexChanged(null, null); ddl_ParentField.SelectedValue = relation.Model.ParentFieldID.ToString(); ddl_ChildTable.SelectedValue = relation.Model.ChildTableID.ToString(); ddl_ChildTable_SelectedIndexChanged(null, null); ddl_ChildField.SelectedValue = relation.Model.ChildFieldID.ToString(); tbx_SortID.Text = relation.Model.SortID.ToString(); ddl_RelateionMode.SelectedValue = relation.Model.JoinMode; tbx_RelationCondition.Text = relation.Model.RelationCondition; }
protected void bt_Add_Click(object sender, EventArgs e) { Rpt_DataSetTableRelationsBLL relation; if (ViewState["SelectedID"] == null) { relation = new Rpt_DataSetTableRelationsBLL(); } else { relation = new Rpt_DataSetTableRelationsBLL((Guid)ViewState["SelectedID"]); } relation.Model.ParentTableID = new Guid(ddl_ParentTable.SelectedValue); relation.Model.ParentFieldID = new Guid(ddl_ParentField.SelectedValue); relation.Model.ChildTableID = new Guid(ddl_ChildTable.SelectedValue); relation.Model.ChildFieldID = new Guid(ddl_ChildField.SelectedValue); relation.Model.JoinMode = ddl_RelateionMode.SelectedValue; relation.Model.RelationCondition = tbx_RelationCondition.Text; relation.Model.SortID = int.Parse(tbx_SortID.Text); if (ViewState["SelectedID"] == null) { relation.Model.DataSet = (Guid)ViewState["ID"]; relation.Add(); } else { relation.Update(); ViewState["SelectedID"] = null; gv_List.SelectedIndex = -1; } bt_Add.Text = "新 增"; BindGrid(); new Rpt_DataSetBLL((Guid)ViewState["ID"]).ClearCache(); MessageBox.Show(this, "保存成功!"); }