private async Task <DialogTurnResult> JumpTopDeviceOptionsStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationtoken) { var customerdata = (CustomerModel)stepContext.Values[customerInfo]; var company_name = ""; if (stepContext.Result.ToString() != null) { company_name = stepContext.Result.ToString(); } var companyID = CompanyUtil.SaveCompanyDetails(company_name); customerdata.COMPANY_ID = companyID; var customerID = CustomerUtil.saveCustomerInformation(customerdata.NAME, customerdata.LAST_NAME, customerdata.COMPANY_ID, customerdata.EMAIL[0].VALUE, customerdata.PHONE[0].VALUE); await stepContext.Context.SendActivityAsync(MessageFactory.Text($"The company id is {companyID} ")); var cacheCustomerInfo = await _botaccessors.UserProfile.GetAsync(stepContext.Context, () => new CustomerModel()); customerdata.ID = customerID; cacheCustomerInfo = customerdata; await _botaccessors.UserProfile.SetAsync(stepContext.Context, cacheCustomerInfo, cancellationtoken); await stepContext.Context.SendActivityAsync(MessageFactory.Text(customerdata.ToString())); return(await stepContext.ReplaceDialogAsync(nameof(MerakiDeviceBoMDialog), cacheCustomerInfo)); }
private async Task <DialogTurnResult> JumpTopDeviceOptionsStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationtoken) { var customerdata = (CustomerModel)stepContext.Values["customerinfo"]; var company_name = ""; if (stepContext.Result.ToString() != null) { company_name = stepContext.Result.ToString(); } var companyID = CompanyUtil.SaveCompanyDetails(company_name); customerdata.COMPANY_ID = companyID; var customerID = CustomerUtil.saveCustomerInformation(customerdata.NAME, customerdata.LAST_NAME, customerdata.COMPANY_ID, customerdata.EMAIL[0].VALUE, customerdata.PHONE[0].VALUE); var Basket = await _botAccessors.QuoteBasket.GetAsync(stepContext.Context, () => new QuoteBasketModel()); customerdata.ID = customerID; Basket.customer = customerdata; await _botAccessors.QuoteBasket.SetAsync(stepContext.Context, Basket, cancellationtoken); await stepContext.Context.SendActivityAsync(MessageFactory.Text(customerdata.ToString())); return(await stepContext.ReplaceDialogAsync("DeviceBOMDialog")); }