예제 #1
0
    /// <summary>
    /// Handles the OnClick event of the btnNext control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void btnNext_OnClick(object sender, EventArgs e)
    {
        int height = 250;
        int width  = 500;

        if (IntegrationManager.MergeData())
        {
            IntegrationManager.LinkChildren = true;
            IntegrationManager.LinkOperatingCompany();
        }
        if (!String.IsNullOrEmpty(IntegrationManager.LinkAccountError))
        {
            height = 500;
            width  = 750;
        }
        ShowDialog("LinkResults", GetLocalResourceObject("LinkToAccounting.Caption").ToString(), height, width);
    }
 /// <summary>
 /// Handles the OnClick event of the btnNext control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void btnNext_OnClick(object sender, EventArgs e)
 {
     lblExtendedDetails.Visible = false;
     ContextService.RemoveContext("MergeContactsStateInfo");
     if (DialogService.DialogParameters.ContainsKey("mergeArguments"))
     {
         if (SessionMergeArguments.TargetEntityType == typeof(IAccount) && SessionMergeArguments.MatchingRecordView.MatchedContacts.Count > 0)
         {
             ShowDialog("MergeContactAddress", GetLocalResourceObject("LinkContactAddresses.Caption").ToString(), 600, 1300);
         }
         else
         {
             SessionMergeArguments.MergeProvider.AssignMatchedChildren(SessionMergeArguments.MatchingRecordView);
             if (Sage.SalesLogix.BusinessRules.BusinessRuleHelper.MergeRecords(SessionMergeArguments))
             {
                 using (new Sage.Platform.Orm.SessionScopeWrapper(true))
                 {
                     Type              type     = SessionMergeArguments.MergeProvider.Target.EntityType;
                     string            entityId = SessionMergeArguments.MergeProvider.Source.EntityId;
                     IPersistentEntity source   = Sage.Platform.EntityFactory.GetById(type, entityId) as IPersistentEntity;
                     source.Delete();
                     EntityService.RemoveEntityHistory(type, source);
                     DialogService.CloseEventHappened(sender, e);
                     Response.Redirect(String.Format("{0}.aspx", GetEntityName(type)));
                 }
             }
         }
     }
     else
     {
         int height = 250;
         int width  = 500;
         if (IntegrationManager.MergeData())
         {
             IntegrationManager.LinkChildren = true;
             IntegrationManager.LinkOperatingCompany();
         }
         if (!String.IsNullOrEmpty(IntegrationManager.LinkAccountError))
         {
             height = 500;
             width  = 750;
         }
         ShowDialog("LinkResults", GetLocalResourceObject("LinkToAccounting.Caption").ToString(), height, width);
     }
 }