public ActionResult QuoteRequest(int id, QuoteInfoDto quote) { if (ModelState.IsValid) { return(View("QuoteComplete", quote)); } return(View(quote)); }
public static void SendQuoteCreation(QuoteInfoDto quote) { if (WebContext.Current.EmailSender != null) { NotificationFactory factory = new NotificationFactory(WebContext.Current.EmailSender); QuoteCreationNotificationBuilder builder = new QuoteCreationNotificationBuilder(quote, WebContext.Current.QuoteCreationTemplate); factory.Send(builder); } }
public ActionResult QuoteRequest(int id) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { QuoteFacade facade = new QuoteFacade(uow); QuoteInfoDto quote = facade.CreateQuote(id); return(View(quote)); } }
private void CollectQuoteInfo(QuoteInfoDto quote) { quote.ProductId = ProductId; quote.TimeCreated = DateTime.Now; quote.ContactPerson = txtContact.Text.Trim(); quote.Email = txtEmail.Text.Trim(); quote.Phone = txtPhone.Text.Trim(); quote.Address = txtAddress.Text.Trim(); quote.ZipCode = txtZipCode.Text.Trim(); quote.Notes = txtNotes.Text.Trim(); }
public QuoteInfoDto CreateQuote(QuoteInfoDto dto) { ProductSystem productSystem = new ProductSystem(UnitOfWork); ProductInfoData productData = productSystem.RetrieveProductInfo(dto.ProductId); // TODO: fill some fields dto.ProductName = productData.Name; dto.Amount = productData.UnitPrice * 1; return(dto); }
private void CreateQuote() { QuoteInfoDto quote = new QuoteInfoDto(); CollectQuoteInfo(quote); using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { QuoteFacade facade = new QuoteFacade(uow); CurrentInstance = facade.CreateQuote(quote); } }
public QuoteInfoDto CreateQuote(object productId) { ArgumentValidator.IsNotNull("productId", productId); QuoteInfoDto dto = new QuoteInfoDto(); ProductSystem productSystem = new ProductSystem(UnitOfWork); ProductInfoData productData = productSystem.RetrieveProductInfo(productId); dto.ProductId = productId; dto.ProductName = productData.Name; dto.Amount = productData.UnitPrice * 1; return(dto); }
private void TransferQuoteData(QuoteInfoDto dto, Quote instance) { instance.ProductId = dto.ProductId; instance.Email = dto.Email; instance.ContactPerson = dto.ContactPerson; instance.Phone = dto.Phone; instance.Address = dto.Address; instance.ZipCode = dto.ZipCode; instance.City = dto.City; instance.Country = dto.Country; instance.TimeCreated = dto.TimeCreated; instance.ContactId = dto.ContactId; instance.Amount = dto.Amount; instance.CurrencyId = dto.CurrencyId; instance.Notes = dto.Notes; }
public FacadeUpdateResult <QuoteData> SaveNewQuote(QuoteInfoDto dto) { UnitOfWork.BeginTransaction(); FacadeUpdateResult <QuoteData> result = QuoteSystem.SaveNewQuote(dto); if (result.IsSuccessful) { UnitOfWork.CommitTransaction(); } else { UnitOfWork.RollbackTransaction(); } return(result); }
internal FacadeUpdateResult <QuoteData> SaveNewQuote(QuoteInfoDto dto) { ArgumentValidator.IsNotNull("dto", dto); FacadeUpdateResult <QuoteData> result = new FacadeUpdateResult <QuoteData>(); IQuoteService service = UnitOfWork.GetService <IQuoteService>(); Quote instance = service.CreateNew <Quote>(); if (result.IsSuccessful) { TransferQuoteData(dto, instance); var saveQuery = service.Save(instance); result.AttachResult(instance.RetrieveData <QuoteData>()); result.Merge(saveQuery); } return(result); }
public ActionResult QuoteConfirm(QuoteInfoDto quote) { return(PartialView(quote)); }
public QuoteCreationNotificationBuilder(QuoteInfoDto quote, NotificationTemplateData template) { Quote = quote; Template = template; }
public void LoadData(QuoteInfoDto quote) { Quote = quote; LoadData(); }