コード例 #1
0
        public ActionResult RequestAQuote(string id = "0")
        {
            var model = new RequestQuoteModel
            {
                ProductId   = id,
                AllProducts = _productService.GetAllProductsSelectList(id, GlobalHelper.SelectListDefaultOption)
            };

            return(View(model));
        }
コード例 #2
0
 public ActionResult RequestAQuote(RequestQuoteModel model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             var entity = model.ToEntity();
             _requestAQuoteService.Add(entity);
             model.AllProducts = _productService.GetAllProductsSelectList(model.ProductId, GlobalHelper.SelectListDefaultOption);
             this.SuccessNotification("We have receieved your request. We will respond withing 24-48 hours.");
         }
         catch (Exception)
         {
             this.ErrorNotification("An error has occurred while submitting your request. Please check your form fields and submit again.");
         }
     }
     return(View(model));
 }
コード例 #3
0
 public static RequestAQuote ToEntity(this RequestQuoteModel model, RequestAQuote destination)
 {
     return(Mapper.Map(model, destination));
 }
コード例 #4
0
 public static RequestAQuote ToEntity(this RequestQuoteModel model)
 {
     return(Mapper.Map <RequestQuoteModel, RequestAQuote>(model));
 }