public static void SetupIntegrationContractStep(IOpportunityDetails form,  EventArgs args)
 {
     IOpportunity opportunity = form.CurrentEntity as IOpportunity;
     if (opportunity == null)
     {
         return;
     }
     Sage.Platform.SData.IAppIdMappingService oMappingService = Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.SData.IAppIdMappingService>(false);
     if (oMappingService != null && oMappingService.IsIntegrationEnabled())
     {
         if (!opportunity.CanChangeOperatingCompany())
         {
             form.lueERPApplication.Enabled = false;
             form.luePriceList.Enabled = false;
         }
         else
         {
             form.lueERPApplication.Enabled = true;
             form.luePriceList.Enabled = (form.lueERPApplication.LookupResultValue != null);
         }
     }
     else
     {
         form.clIntegrationContract.Visible = false;
     }
 }
        public static void SetupIntegrationContractStep(IOpportunityDetails form, EventArgs args)
        {
            IOpportunity opportunity = form.CurrentEntity as IOpportunity;

            if (opportunity == null)
            {
                return;
            }
            Sage.Platform.SData.IAppIdMappingService oMappingService = Sage.Platform.Application.ApplicationContext.Current.Services.Get <Sage.Platform.SData.IAppIdMappingService>(false);
            if (oMappingService != null && oMappingService.IsIntegrationEnabled())
            {
                if (!opportunity.CanChangeOperatingCompany())
                {
                    form.lueERPApplication.Enabled = false;
                    form.luePriceList.Enabled      = false;
                }
                else
                {
                    form.lueERPApplication.Enabled = true;
                    form.luePriceList.Enabled      = (form.lueERPApplication.LookupResultValue != null);
                }
            }
            else
            {
                form.clIntegrationContract.Visible = false;
            }
        }
        public static void cmdCopyOpportunity_OnClickStep(IOpportunityDetails form, EventArgs args)
        {
            var copyFromOpportunity = form.CurrentEntity as IOpportunity;
            var newOpportunity      = EntityFactory.Create <IOpportunity>();

            if (copyFromOpportunity == null)
            {
                return;
            }
            var opportunityId = newOpportunity.CopyOpportunity(copyFromOpportunity);

            MySlx.MainView.Show <IOpportunity>(opportunityId);
        }
        public static void SetupIntegrationContractStep(IOpportunityDetails form, EventArgs args)
        {
            IOpportunity opportunity = form.CurrentEntity as IOpportunity;

            if (opportunity == null)
            {
                return;
            }
            Sage.Platform.SData.IAppIdMappingService oMappingService = Sage.Platform.Application.ApplicationContext.Current.Services.Get <Sage.Platform.SData.IAppIdMappingService>(false);
            if (oMappingService != null && oMappingService.IsIntegrationEnabled())
            {
                if (!opportunity.CanChangeOperatingCompany())
                {
                    form.lueERPApplication.Enabled = false;
                    form.luePriceList.Enabled      = false;
                }
                else
                {
                    form.lueERPApplication.Enabled = true;
                    object oValue = form.lueERPApplication.LookupResultValue;
                    string sValue = string.Empty;
                    if (oValue != null)
                    {
                        sValue = oValue.ToString();
                    }
                    if (string.IsNullOrEmpty(sValue))
                    {
                        form.luePriceList.Text = string.Empty;
                        form.luePriceList.LookupResultValue = null;
                        form.luePriceList.Enabled           = false;
                    }
                    else
                    {
                        form.luePriceList.Enabled = true;
                    }
                    SalesLogix.HighLevelTypes.LookupPreFilter filterAppId = new SalesLogix.HighLevelTypes.LookupPreFilter();
                    filterAppId.LookupEntityName = "Sage.Entity.Interfaces.IAppIdMapping";
                    filterAppId.PropertyName     = "Id";
                    filterAppId.OperatorCode     = "!=";
                    filterAppId.FilterValue      = oMappingService.LocalAppId;
                    filterAppId.PropertyType     = "System.String";
                    form.lueERPApplication.LookupPreFilters.Add(filterAppId);
                }
            }
            else
            {
                form.clIntegrationContract.Visible = false;
            }
        }
 public static void SetupIntegrationContractStep(IOpportunityDetails form,  EventArgs args)
 {
     IOpportunity opportunity = form.CurrentEntity as IOpportunity;
     if (opportunity == null)
     {
         return;
     }
     Sage.Platform.SData.IAppIdMappingService oMappingService = Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.SData.IAppIdMappingService>(false);
     if (oMappingService != null && oMappingService.IsIntegrationEnabled())
     {
         if (!opportunity.CanChangeOperatingCompany())
         {
             form.lueERPApplication.Enabled = false;
             form.luePriceList.Enabled = false;
         }
         else
         {
             form.lueERPApplication.Enabled = true;
             object oValue = form.lueERPApplication.LookupResultValue;
             string sValue = string.Empty;
             if (oValue != null)
             {
                 sValue = oValue.ToString();
             }
             if (string.IsNullOrEmpty(sValue))
             {
                 form.luePriceList.Text = string.Empty;
                 form.luePriceList.LookupResultValue = null;
                 form.luePriceList.Enabled = false;
             }
             else
             {
                 form.luePriceList.Enabled = true;
             }
             SalesLogix.HighLevelTypes.LookupPreFilter filterAppId = new SalesLogix.HighLevelTypes.LookupPreFilter();
             filterAppId.LookupEntityName = "Sage.Entity.Interfaces.IAppIdMapping";
             filterAppId.PropertyName = "Id";
             filterAppId.OperatorCode = "!=";
             filterAppId.FilterValue = oMappingService.LocalAppId;
             filterAppId.PropertyType = "System.String";
             form.lueERPApplication.LookupPreFilters.Add(filterAppId);
         }
     }
     else
     {
         form.clIntegrationContract.Visible = false;
     }
 }
示例#6
0
        public static void OnLoad1Step(IOpportunityDetails form, EventArgs args)
        {
            // TODO: Complete business rule implementation
            IOpportunity opportunity = form.CurrentEntity as IOpportunity;

            if (opportunity != null)
            {
                var closed = opportunity.IsClosed();
                form.lueAccount.IsReadOnly          = closed;
                form.usrUser.IsReadOnly             = closed;
                form.lueReseller.IsReadOnly         = closed;
                form.dtpEstimatedClose.IsReadOnly   = closed;
                form.pklCloseProbability.IsReadOnly = closed;
                form.pklStatus.IsReadOnly           = closed;
                //form.ActualAmount.IsReadOnly = closed;
                form.txtComments.IsReadOnly      = closed;
                form.txtDescription.IsReadOnly   = closed;
                form.chkAddToForecast.IsReadOnly = closed;
                form.cmdSave.Visible             = !closed;
                form.cmdReset.Visible            = !closed;
                form.cmdDelete.Visible           = !closed;
            }
        }