Example #1
0
        public ActionResult Contact(ContactModel model)
        {
            if (ModelState.IsValid)
            {
                ContactMessage msg = _mapper.Map <ContactModel, ContactMessage>(model);

                Result result = _contactSrv.AddContactMessage(msg);
                // TODO: move to a seperate class with css class definition
                TempData["Msg"] = $"Wiadomość wysłana pomyślnie! Otrzymała ID = {result.Message}";
            }

            return(RedirectToAction("Contact"));
        }
Example #2
0
        public ActionResult <MessageModel> getbyid(MessageModel messageModel)
        {
            var result = _contactService.AddContactMessage(messageModel);

            return(Ok(result));
        }