コード例 #1
0
        public static void SetupIntegrationContractStep(IInsertOpportunity 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( IInsertOpportunity 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;
     }
 }
        /// <summary>
        /// Sets the visibility of controls based on the status of the Sales Order. 
        /// </summary>
        /// <param name="form">The Sales Order Details form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void OnLoad1Step(ISalesOrderDetails form, EventArgs args)
        {
            ISalesOrder salesOrder = form.CurrentEntity as ISalesOrder;
            if (salesOrder != null)
            {
                IAppIdMappingService oMappingService = Sage.Platform.Application.ApplicationContext.Current.Services.Get<IAppIdMappingService>(true);
                bool closed = false;
                if (salesOrder.Status != null)
                {
                    closed =
                        (salesOrder.Status.ToUpper().Equals(
                            form.GetResource("SalesOrderStatus_Closed").ToString().ToUpper()) ||
                         salesOrder.Status.ToUpper().Equals(
                             form.GetResource("SalesOrderStatus_Transmitted").ToString().ToUpper()));
                }
                //if this is a Sales Order that synced from the accounting system or the Sales Order has been submitted then we disable it
                bool isOpen = false;
                if (!String.IsNullOrEmpty(salesOrder.ERPSalesOrder.ERPStatus))
                {
                    isOpen = (salesOrder.ERPSalesOrder.ERPStatus.Equals(
                        form.GetResource("erpStatus_Open").ToString()) ||
                        salesOrder.ERPSalesOrder.ERPStatus.Equals(form.GetResource("erpStatus_Rejected").ToString()));
                }
                bool erpSalesOrder = (oMappingService.IsIntegrationEnabled() && (salesOrder.GlobalSyncId.HasValue && !isOpen));

                form.rdgSOType.Enabled = (!closed || !salesOrder.IsQuote.HasValue) && !erpSalesOrder;
                form.lueAccount.IsReadOnly = closed || erpSalesOrder;
                form.usrAccountManager.IsReadOnly = closed || erpSalesOrder;
                form.lueOpportunity.IsReadOnly = closed || erpSalesOrder;
                form.dtpDateCreated.IsReadOnly = closed || erpSalesOrder;
                form.lueRequestedBy.IsReadOnly = closed || erpSalesOrder;
                form.dtpOrderDate.IsReadOnly = closed || erpSalesOrder;
                form.dtpPromisedDate.IsReadOnly = closed || erpSalesOrder;
                form.pklType.IsReadOnly = closed || erpSalesOrder;
                form.pklType.Enabled = !closed && !erpSalesOrder;
                form.pklStatus.IsReadOnly = closed || erpSalesOrder;
                form.pklType.Enabled = !closed && !erpSalesOrder;
                form.txtCustPO.IsReadOnly = closed || erpSalesOrder;
                form.btnSaveSalesOrder.Visible = !closed && !erpSalesOrder;
                form.btnReset.Visible = !closed && !erpSalesOrder;
                form.btnDelete.Visible = !closed && !erpSalesOrder;
                form.txtComments.IsReadOnly = closed || erpSalesOrder;
                form.lueERPApplication.Enabled = !closed && !erpSalesOrder;
                form.luePriceList.Enabled = !closed && !erpSalesOrder;

                //if this is a Sales Order synced from the accounting system then no point executing this, as the Sales Order will be disabled.
                if (!erpSalesOrder && oMappingService.IsIntegrationEnabled())
                {
                    if (!salesOrder.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);
                    }
                }
                form.ctrlstERPApplication.Visible = oMappingService.IsIntegrationEnabled();
            }
        }
コード例 #4
0
        /// <summary>
        /// Sets the visibility of controls based on the status of the Sales Order.
        /// </summary>
        /// <param name="form">The Sales Order Details form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void OnLoad1Step(ISalesOrderDetails form, EventArgs args)
        {
            ISalesOrder salesOrder = form.CurrentEntity as ISalesOrder;

            if (salesOrder != null)
            {
                IAppIdMappingService oMappingService = Sage.Platform.Application.ApplicationContext.Current.Services.Get <IAppIdMappingService>(true);
                bool closed = false;
                if (salesOrder.Status != null)
                {
                    closed =
                        (salesOrder.Status.ToUpper().Equals(
                             form.GetResource("SalesOrderStatus_Closed").ToString().ToUpper()) ||
                         salesOrder.Status.ToUpper().Equals(
                             form.GetResource("SalesOrderStatus_Transmitted").ToString().ToUpper()));
                }
                //if this is a Sales Order that synced from the accounting system or the Sales Order has been submitted then we disable it
                bool isOpen = false;
                if (!String.IsNullOrEmpty(salesOrder.ERPSalesOrder.ERPStatus))
                {
                    isOpen = (salesOrder.ERPSalesOrder.ERPStatus.Equals(
                                  form.GetResource("erpStatus_Open").ToString()) ||
                              salesOrder.ERPSalesOrder.ERPStatus.Equals(form.GetResource("erpStatus_Rejected").ToString()));
                }
                bool erpSalesOrder = (oMappingService.IsIntegrationEnabled() && (salesOrder.GlobalSyncId.HasValue && !isOpen));

                form.rdgSOType.Enabled            = (!closed || !salesOrder.IsQuote.HasValue) && !erpSalesOrder;
                form.lueAccount.IsReadOnly        = closed || erpSalesOrder;
                form.usrAccountManager.IsReadOnly = closed || erpSalesOrder;
                form.lueOpportunity.IsReadOnly    = closed || erpSalesOrder;
                form.dtpDateCreated.IsReadOnly    = closed || erpSalesOrder;
                form.lueRequestedBy.IsReadOnly    = closed || erpSalesOrder;
                form.dtpOrderDate.IsReadOnly      = closed || erpSalesOrder;
                form.dtpPromisedDate.IsReadOnly   = closed || erpSalesOrder;
                form.pklType.IsReadOnly           = closed || erpSalesOrder;
                form.pklType.Enabled           = !closed && !erpSalesOrder;
                form.pklStatus.IsReadOnly      = closed || erpSalesOrder;
                form.pklType.Enabled           = !closed && !erpSalesOrder;
                form.txtCustPO.IsReadOnly      = closed || erpSalesOrder;
                form.btnSaveSalesOrder.Visible = !closed && !erpSalesOrder;
                form.btnReset.Visible          = !closed && !erpSalesOrder;
                form.btnDelete.Visible         = !closed && !erpSalesOrder;
                form.txtComments.IsReadOnly    = closed || erpSalesOrder;
                form.lueERPApplication.Enabled = !closed && !erpSalesOrder;
                form.luePriceList.Enabled      = !closed && !erpSalesOrder;

                //if this is a Sales Order synced from the accounting system then no point executing this, as the Sales Order will be disabled.
                if (!erpSalesOrder && oMappingService.IsIntegrationEnabled())
                {
                    if (!salesOrder.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);
                    }
                }
                form.ctrlstERPApplication.Visible = oMappingService.IsIntegrationEnabled();
            }
        }