Пример #1
0
 /// <summary>
 /// Handles the OnClick event of the AddTargets control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewSortEventArgs"/> instance containing the event data.</param>
 protected void AddTargets_OnClick(object sender, EventArgs e)
 {
     if (_State != null)
     {
         if (_State.targetList.Rows.Count > 0)
         {
             //SetStartProcessInfo();
             InsertTargetManager insertManager = new InsertTargetManager();
             insertManager.CampaignId = EntityContext.EntityID.ToString();
             insertManager.TargetList = _State.targetList;
             insertManager.TargetType = _State.targetType;
             insertManager.GroupName  = _State.groupName;
             insertManager.StartTargetInsertProcess();
             //SetCompleteProcessInfo();
             DialogService.CloseEventHappened(sender, e);
             Refresh();
             //if (DialogService != null)
             //{
             //    DialogService.SetSpecs(200, 200, 200, 450, "InsertTargetProgress");
             //    DialogService.DialogParameters.Add("targetsDataTable", _State.targetList);
             //    DialogService.ShowDialog();
             //}
         }
         else
         {
             DialogService.ShowMessage(GetLocalResourceObject("error_NoTargetsSelected").ToString());
         }
     }
     else
     {
         DialogService.ShowMessage(GetLocalResourceObject("error_NoTargetsSelected").ToString());
     }
 }
 /// <summary>
 /// Handles the OnClick event of the StartProcess 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 StartInsert_OnClick(object sender, EventArgs e)
 {
     if (DialogService.DialogParameters.Count > 0 && DialogService.DialogParameters.ContainsKey("targetsDataTable"))
     {
         List <string> targets = DialogService.DialogParameters["targetsDataTable"] as List <string>;
         SetStartProcessInfo();
         InsertTargetManager insertManager = new InsertTargetManager();
         insertManager.CampaignId = EntityContext.EntityID.ToString();
         insertManager.TargetList = targets;
         insertManager.StartTargetInsertProcess(InsertTargetHandler);
         SetCompleteProcessInfo();
         DialogService.DialogParameters.Remove("targetsDataTable");
     }
 }
    /// <summary>
    /// Handles the OnClick event of the AddTargets control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewSortEventArgs"/> instance containing the event data.</param>
    protected void AddTargets_OnClick(object sender, EventArgs e)
    {
        if (_state != null && _state.targetList.Count > 0)
        {
            var targetIds = _state.targetList
                            .Select(componentView => componentView.VirtualComponentProperties.FirstOrDefault().Value.ToString())
                            .ToList();

            InsertTargetManager insertManager = new InsertTargetManager();
            insertManager.CampaignId = EntityContext.EntityID.ToString();
            insertManager.TargetList = targetIds;
            insertManager.TargetType = _state.targetType;
            insertManager.GroupName  = _state.groupName;
            insertManager.StartTargetInsertProcess();
            Refresh();
        }
        else
        {
            DialogService.ShowMessage(GetLocalResourceObject("error_NoTargetsSelected").ToString());
        }
    }
 /// <summary>
 /// Handles the OnClick event of the StartProcess 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 StartInsert_OnClick(object sender, EventArgs e)
 {
     if (DialogService.DialogParameters.Count > 0)
     {
         if (DialogService.DialogParameters.ContainsKey("targetsDataTable"))
         {
             DataTable targets = DialogService.DialogParameters["targetsDataTable"] as DataTable;
             SetStartProcessInfo();
             InsertTargetManager insertManager = new InsertTargetManager();
             insertManager.CampaignId = EntityContext.EntityID.ToString();
             insertManager.TargetList = targets;
             //insertManager.TargetType = _State.targetType;
             insertManager.StartTargetInsertProcess(InsertTargetHandler);
             SetCompleteProcessInfo();
             DialogService.DialogParameters.Remove("targetsDataTable");
         }
         else
         {
             //throw exception
         }
     }
 }
Пример #5
0
    /// <summary>
    /// Handles the OnClick event of the AddTargets control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewSortEventArgs"/> instance containing the event data.</param>
    protected void AddTargets_OnClick(object sender, EventArgs e)
    {
        if (_state != null && _state.targetList.Count > 0)
        {
            List <string> targetIds =
                _state.targetList.Select(
                    componentView => componentView.VirtualComponentProperties.FirstOrDefault().Value.ToString()).ToList();
            var tenantId     = ConfigurationManager.AppSettings["sage.platform.scheduling.sdata.tenantId"];
            var scheduler    = ApplicationContext.Current.Services.Get <ISchedulerService>(true);
            var authProvider = ApplicationContext.Current.Services.Get <IAuthenticationProvider>(true);
            //scheduler.TriggerJob(
            //    tenantId,
            //    "Sage.SalesLogix.CampaignTarget.InsertJob",
            //    new Dictionary<string, object>
            //        {
            //            {"AuthenticationToken", authProvider.AuthenticationToken},
            //            {"CampaignId", EntityContext.EntityID.ToString()},
            //            {"TargetType", _state.targetType},
            //            {"TargetIds", targetIds.ToArray()},
            //            {"GroupName", _state.groupName}
            //        });

            //SetStartProcessInfo();
            InsertTargetManager insertManager = new InsertTargetManager();
            insertManager.CampaignId = EntityContext.EntityID.ToString();
            insertManager.TargetList = targetIds;
            insertManager.TargetType = _state.targetType;
            insertManager.GroupName  = _state.groupName;
            insertManager.StartTargetInsertProcess();
            //SetCompleteProcessInfo();
            Refresh();
        }
        else
        {
            DialogService.ShowMessage(GetLocalResourceObject("error_NoTargetsSelected").ToString());
        }
    }
Пример #6
0
 /// <summary>
 /// Handles the OnClick event of the AddTargets control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewSortEventArgs"/> instance containing the event data.</param>
 protected void AddTargets_OnClick(object sender, EventArgs e)
 {
     if (_State != null)
     {
         if (_State.targetList.Rows.Count > 0)
         {
             //SetStartProcessInfo();
             InsertTargetManager insertManager = new InsertTargetManager();
             insertManager.CampaignId = EntityContext.EntityID.ToString();
             insertManager.TargetList = _State.targetList;
             insertManager.TargetType = _State.targetType;
             insertManager.GroupName = _State.groupName;
             insertManager.StartTargetInsertProcess();
             //SetCompleteProcessInfo();
             DialogService.CloseEventHappened(sender, e);
             Refresh();
             //if (DialogService != null)
             //{
             //    DialogService.SetSpecs(200, 200, 200, 450, "InsertTargetProgress");
             //    DialogService.DialogParameters.Add("targetsDataTable", _State.targetList);
             //    DialogService.ShowDialog();
             //}
         }
         else
         {
             DialogService.ShowMessage(GetLocalResourceObject("error_NoTargetsSelected").ToString());
         }
     }
     else
     {
         DialogService.ShowMessage(GetLocalResourceObject("error_NoTargetsSelected").ToString());
     }
 }
 /// <summary>
 /// Handles the OnClick event of the StartProcess 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 StartInsert_OnClick(object sender, EventArgs e)
 {
     if (DialogService.DialogParameters.Count > 0 && DialogService.DialogParameters.ContainsKey("targetsDataTable"))
     {
         List<string> targets = DialogService.DialogParameters["targetsDataTable"] as List<string>;
         SetStartProcessInfo();
         InsertTargetManager insertManager = new InsertTargetManager();
         insertManager.CampaignId = EntityContext.EntityID.ToString();
         insertManager.TargetList = targets;
         insertManager.StartTargetInsertProcess(InsertTargetHandler);
         SetCompleteProcessInfo();
         DialogService.DialogParameters.Remove("targetsDataTable");
     }
 }
 /// <summary>
 /// Handles the OnClick event of the StartProcess 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 StartInsert_OnClick(object sender, EventArgs e)
 {
     if (DialogService.DialogParameters.Count > 0)
     {
         if (DialogService.DialogParameters.ContainsKey("targetsDataTable"))
         {
             DataTable targets = DialogService.DialogParameters["targetsDataTable"] as DataTable;
             SetStartProcessInfo();
             InsertTargetManager insertManager = new InsertTargetManager();
             insertManager.CampaignId = EntityContext.EntityID.ToString();
             insertManager.TargetList = targets;
             //insertManager.TargetType = _State.targetType;
             insertManager.StartTargetInsertProcess(InsertTargetHandler);
             SetCompleteProcessInfo();
             DialogService.DialogParameters.Remove("targetsDataTable");
         }
         else
         {
             //throw exception
         }
     }
 }
Пример #9
0
    /// <summary>
    /// Handles the OnClick event of the AddTargets control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewSortEventArgs"/> instance containing the event data.</param>
    protected void AddTargets_OnClick(object sender, EventArgs e)
    {
        if (_state != null && _state.targetList.Count > 0)
        {
            List<string> targetIds =
                _state.targetList.Select(
                    componentView => componentView.VirtualComponentProperties.FirstOrDefault().Value.ToString()).ToList();
            var tenantId = ConfigurationManager.AppSettings["sage.platform.scheduling.sdata.tenantId"];
            var scheduler = ApplicationContext.Current.Services.Get<ISchedulerService>(true);
            var authProvider = ApplicationContext.Current.Services.Get<IAuthenticationProvider>(true);
            //scheduler.TriggerJob(
            //    tenantId,
            //    "Sage.SalesLogix.CampaignTarget.InsertJob",
            //    new Dictionary<string, object>
            //        {
            //            {"AuthenticationToken", authProvider.AuthenticationToken},
            //            {"CampaignId", EntityContext.EntityID.ToString()},
            //            {"TargetType", _state.targetType},
            //            {"TargetIds", targetIds.ToArray()},
            //            {"GroupName", _state.groupName}
            //        });

            //SetStartProcessInfo();
            InsertTargetManager insertManager = new InsertTargetManager();
            insertManager.CampaignId = EntityContext.EntityID.ToString();
            insertManager.TargetList = targetIds;
            insertManager.TargetType = _state.targetType;
            insertManager.GroupName = _state.groupName;
            insertManager.StartTargetInsertProcess();
            //SetCompleteProcessInfo();
            Refresh();
        }
        else
        {
            DialogService.ShowMessage(GetLocalResourceObject("error_NoTargetsSelected").ToString());
        }
    }
Пример #10
0
    /// <summary>
    /// Handles the OnClick event of the AddTargets control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewSortEventArgs"/> instance containing the event data.</param>
    protected void AddTargets_OnClick(object sender, EventArgs e)
    {
        if (_state != null && _state.targetList.Count > 0)
        {
            var targetIds =_state.targetList
                .Select(componentView => componentView.VirtualComponentProperties.FirstOrDefault().Value.ToString())
                .ToList();
            var scheduler = ApplicationContext.Current.Services.Get<ISchedulerClientService>(true);
            //scheduler.TriggerJob(
            //    "Sage.SalesLogix.CampaignTarget.InsertJob",
            //    new
            //        {
            //            CampaignId = EntityContext.EntityID.ToString(),
            //            TargetType = _state.targetType,
            //            TargetIds = targetIds.ToArray(),
            //            GroupName = _state.groupName
            //        });

            //SetStartProcessInfo();
            InsertTargetManager insertManager = new InsertTargetManager();
            insertManager.CampaignId = EntityContext.EntityID.ToString();
            insertManager.TargetList = targetIds;
            insertManager.TargetType = _state.targetType;
            insertManager.GroupName = _state.groupName;
            insertManager.StartTargetInsertProcess();
            //SetCompleteProcessInfo();
            Refresh();
        }
        else
        {
            DialogService.ShowMessage(GetLocalResourceObject("error_NoTargetsSelected").ToString());
        }
    }