protected void Page_Load(object sender, EventArgs e) { DataModelControlHelper.RenderControls(leftRegion, SharedFields, SharedFieldsBehaviors, string.Empty); DataModelControlHelper.RenderControls(rightRegion, ExtensionFields, null, string.Empty); string[] customerList = new string[] { "Shipper", "Consignee", "NotifyPart" }; Customer[] customers = BasicInformationProxy.FindCustomersByName(string.Empty); foreach (string customerField in customerList) { DropDownList list = DataModelControlHelper.GetControl(leftRegion, customerField) as DropDownList; list.DataTextField = "Name"; list.DataValueField = "Id"; list.DataSource = customers; list.DataBind(); if (list.Items.Count > 0) { list.Items.Insert(0, new ListItem(string.Empty, string.Empty)); } } if (!Page.IsPostBack) { InitialControls(); } }
private void SaveObject() { if (!CanEdit()) { return; } DataModelControlHelper.RetrieveValues(leftRegion, SharedFields, CurrentContract); DataModelControlHelper.RetrieveValues(rightRegion, ExtensionFields, CurrentContract); ExportProxy.UpdateExportContract(CurrentContract); }
private void InitialControls() { DataModelControlHelper.FillValues(leftRegion, SharedFields, CurrentContract); DataModelControlHelper.FillValues(rightRegion, ExtensionFields, CurrentContract); Label label = DataModelControlHelper.GetControl(leftRegion, "Creator") as Label; label.Text = ConvertToUsername(CurrentContract.Creator); if (!CanEdit()) { DisableInputControls(tblInputControls); btnSave.Enabled = false; btnRefresh.Enabled = false; btnDelete.Enabled = false; } else { SetControlMode(); } // for workflow ShowStatus(); ShowActionButtons(); }