protected void TerminationDialogueButtonSet_OnClick(Object sender, EventArgs eventArgs) { if (!TerminationDialogueSetAddressTerminationDate.SelectedDate.HasValue) { TerminationDialogueSetAddressTerminationDate.SelectedDate = null; return; } long terminatedEntityAddressId = Convert.ToInt64(TerminationDialogueTerminatedEntityAddressId.Text); Client.Core.Entity.EntityAddress currentEntityAddress = MercuryApplication.EntityAddressGet(terminatedEntityAddressId, false); if (Convert.ToDateTime(TerminationDialogueSetAddressTerminationDate.SelectedDate) < currentEntityAddress.EffectiveDate) { TerminationDialogueSetAddressTerminationDate.SelectedDate = null; return; } DateTime newTerminationDate = Convert.ToDateTime(TerminationDialogueSetAddressTerminationDate.SelectedDate); MercuryApplication.EntityAddressTerminate(currentEntityAddress, newTerminationDate); Mercury.Client.Core.Member.Member member = MercuryApplication.MemberGetByEntityId(currentEntityAddress.EntityId, true); //InitializeMemberAddresses (member, false); TerminationDialogueSetAddressTerminationDate.SelectedDate = null; return; }
protected void EntityAddressTerminateWindow_ButtonOk_OnClick(Object sender, EventArgs e) { Boolean success = true; if (!EntityAddressTerminateTerminationDate.SelectedDate.HasValue) { EntityAddressTerminateTerminationDate.SelectedDate = null; EntityAddressTerminateResponse.Text = "Unable to determine the requested Termination Date."; return; } Int64 terminatedEntityAddressId = Convert.ToInt64(EntityAddressTerminateId.Text); Client.Core.Entity.EntityAddress currentEntityAddress = MercuryApplication.EntityAddressGet(terminatedEntityAddressId, false); if (Convert.ToDateTime(EntityAddressTerminateTerminationDate.SelectedDate) < currentEntityAddress.EffectiveDate) { EntityAddressTerminateTerminationDate.SelectedDate = null; EntityAddressTerminateResponse.Text = "The requested Termination Date is not valid."; return; } success = MercuryApplication.EntityAddressTerminate(currentEntityAddress, EntityAddressTerminateTerminationDate.SelectedDate.Value); if (success) { EntityAddressHistoryGrid_ManualDataRebind(); EntityAddressTerminateTerminationDate.SelectedDate = null; Telerik.Web.UI.RadAjaxManager telerikAjaxManager = (Telerik.Web.UI.RadAjaxManager)Page.FindControl("TelerikAjaxManager"); if (telerikAjaxManager != null) { telerikAjaxManager.ResponseScripts.Add("EntityAddressTerminateWindow_Close ();"); } } else { if (MercuryApplication.LastException != null) { EntityAddressTerminateResponse.Text = MercuryApplication.LastException.Message; } else { EntityAddressTerminateResponse.Text = "Unknown exception occurreed. Unable to Terminate."; } } return; }