public object GetUserInfo(string password) { if (!CheckSecretPhrase(password)) { _httpContextAccessor.HttpContext.Response.StatusCode = 403; return(null); } string[] msgs = UserInfoCollector.Messages; UserInfoCollector.ResetMessages(); return(new { msgs }); }
private void InitTest_ViewQuoteStep(out Quote quoteInstance, out QuoteViewer quoteViewerInstance, out ContactEditor2 contactEditorInstance, bool quoteViewerAgreeToTerms, bool isNewCustomer, string billType = null) { var quoteViewer = new QuoteViewer(); var currentDate = DateTime.Now; var contact = new Contact("salutation", "contactName", "title", "phone", "fax", "email", "address", "city", "state", "country", "zip"); var customerName = "customerName"; ShimCustomerBase.AllInstances.IsNewGet = (c) => isNewCustomer; var quote = new Quote(-1, new Customer()); quote.BillType = billType; ShimQuoteApproval.AllInstances.CurrentQuoteGet = (q) => quote; ShimContactEditor2.AllInstances.IsTheSameAsBillingAddressGet = (ce) => true; ShimContactEditor2.AllInstances.IsTheSameAsTechContactGet = (ce) => true; ShimContactEditor2.AllInstances.GetContact = (ce) => contact; ShimContactEditor2.AllInstances.CompanyGet = (ce) => customerName; var contactEditor = new ContactEditor2(); contactEditor.Contact = contact; var userInfoEditor = new UserInfoCollector(); ShimQuoteViewer.AllInstances.ContactEditorGet = (qv) => contactEditor; ShimQuoteViewer.AllInstances.UserInfoEditorGet = (qv) => userInfoEditor; ShimQuoteViewer.AllInstances.AgreeToTermsAndConditionsGet = (qv) => quoteViewerAgreeToTerms; ShimQuoteViewer.AllInstances.StartDateGet = (qv) => currentDate; ShimControl.AllInstances.FindControlString = (c, id) => { if (id == "uclQuoteViewer") { return(quoteViewer); } return(null); }; quoteInstance = quote; contactEditorInstance = contactEditor; quoteViewerInstance = quoteViewer; }
public void LogMessage(string msg) { UserInfoCollector.AddMessage(_httpContextAccessor.HttpContext, msg); }