protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // get the relation description ModelTMSContainer _ControlObjectContext = new ModelTMSContainer(Session["CustomerConnectString"].ToString(), Session); EntityKey TempKey = new EntityKey("ModelTMSContainer.RelationSet", "Id", Guid.Parse(Request.Params["Id"])); Relation TempObj = _ControlObjectContext.GetObjectByKey(TempKey) as Relation; LabelObjectName.Text = TempObj.Description; DropDownListRelationType.Items.Clear(); DropDownListRelationType.Items.Add(new ListItem("Alle types", "")); Common.AddCustomerRelationTypeList(DropDownListRelationType.Items, false); DropDownListRelationType.SelectedIndex = 0; DetailTable.Visible = false; WebUserControlCustomerRelationContactLogOverview1.Visible = false; // if the relation contact id is set then load this up immediately if (Request.Params["RelationContactId"] != null) { // show the tables WebUserControlCustomerRelationContact1.Visible = true; WebUserControlCustomerRelationContactLogOverview1.Visible = true; DetailTable.Visible = true; // load up details WebUserControlCustomerRelationContact1.KeyID = new System.Guid(Request.Params["RelationContactId"].ToString()); EntityDataSourceRelation.DefaultContainerName = EntityDataSourceRelation.DefaultContainerName; EntityDataSourceRelation.DataBind(); // load up contact log overviw WebUserControlCustomerRelationContactLogOverview1.RelationContactId = WebUserControlCustomerRelationContact1.KeyID; LabelContractID.Text = WebUserControlCustomerRelationContact1.KeyID.ToString(); LabelDataBindDetails.Text = "1"; // if the relatation contact log id is set as well then load this up immediately if (Request.Params["RelationContactLogId"] != null) { WebUserControlCustomerRelationContactLogOverview1.RelationContactLogId = new System.Guid(Request.Params["RelationContactLogId"].ToString()); LabelDataBindDetails.Text = "2"; } } } }
protected void ButtonSearch_Click(object sender, EventArgs e) { EntityDataSourceRelation.CommandParameters["Description"].DefaultValue = TextBoxFilterName.Text == "" ? "%" : "%" + TextBoxFilterName.Text + "%"; EntityDataSourceRelation.CommandParameters["LocationDescription"].DefaultValue = ComboBoxLocationDescription.Text == "" ? "%" : "%" + ComboBoxLocationDescription.Text + "%"; EntityDataSourceRelation.CommandParameters["ItemState"].DefaultValue = ComboBoxItemState.SelectedValue == "" ? "%" : "%" + ComboBoxItemState.SelectedValue + "%"; EntityDataSourceRelation.CommandParameters["Id"].DefaultValue = Request.Params["Id"]; if (CheckBoxFilterIsActive.Checked) { EntityDataSourceRelation.CommandParameters["IsActive"].DefaultValue = "true"; } else { EntityDataSourceRelation.CommandParameters["IsActive"].DefaultValue = "false"; } EntityDataSourceRelation.DefaultContainerName = EntityDataSourceRelation.DefaultContainerName; EntityDataSourceRelation.DataBind(); }
protected void ButtonSearch_Click(object sender, EventArgs e) { EntityDataSourceRelation.DefaultContainerName = EntityDataSourceRelation.DefaultContainerName; EntityDataSourceRelation.DataBind(); }