Exemplo n.º 1
0
        /// <summary>
        /// Initializes and invokes the Add Custom Product view.
        /// </summary>
        /// <param name="form">The Sales Order Products form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void btnAddCustomProduct_OnClickStep(ISalesOrderProducts form, EventArgs args)
        {
            ISalesOrder salesOrder = form.CurrentEntity as ISalesOrder;

            if (salesOrder != null)
            {
                IWebDialogService dialogService = form.Services.Get <IWebDialogService>();
                if (dialogService != null)
                {
                    string dialogCaption = String.Format(form.GetResource("btnAddCustomProduct.Caption").ToString(),
                                                         salesOrder.SalesOrderNumber);
                    if (salesOrder.IsContractIntegrationEnabled())
                    {
                        dialogService.SetSpecs(20, 20, 390, 700, "ICEditSalesOrderItem", dialogCaption, true);
                    }
                    else
                    {
                        dialogService.SetSpecs(20, 20, 325, 700, "EditSalesOrderItem", dialogCaption, true);
                    }
                    dialogService.DialogParameters.Add("CustomProductSalesOrder", salesOrder);
                    dialogService.EntityType = typeof(ISalesOrderItem);
                    dialogService.ShowDialog();
                }
            }
        }