public static void btnAddNewAccount_OnClickStep(IInsertQuote form, EventArgs args) { var dialogService = form.Services.Get <IWebDialogService>(); if (dialogService == null) { return; } dialogService.SetSpecs(20, 20, 300, 800, "QuickInsertAccountContact", "", true); dialogService.EntityType = typeof(IContact); dialogService.ShowDialog(); }
public static void OnLoad1Step(IInsertQuote form, EventArgs args) { IQuote quote = form.CurrentEntity as IQuote; if (quote == null) { return; } var srv = ApplicationContext.Current.Services.Get <ISelectionService>(); if (srv != null) { ISelectionContext sc = srv.GetSelectionContext("QuickInsertAccountContact"); if (sc != null) { var sels = sc.GetSelectedIds(); if (sels.Count > 0) { string newContactId = sels[0]; IContact newContact = EntityFactory.GetById <IContact>(newContactId); IAccount newAccount = newContact.Account; quote.Account = newAccount; quote.AccountManager = newAccount.AccountManager; quote.BillingContact = newContact; quote.ShippingContact = newContact; quote.BillToName = newContact.NameLF; quote.ShipToName = newContact.NameLF; if (quote.BillingAddress == null) { quote.BillingAddress = EntityFactory.Create <IQuoteAddress>(); } quote.SetQuoteBillingAddress(newContact.Address); if (quote.ShippingAddress == null) { quote.ShippingAddress = EntityFactory.Create <IQuoteAddress>(); } quote.SetQuoteShippingAddress(newContact.Address); srv.SetSelectionContext("QuickInsertAccountContact", null); } } } }