コード例 #1
0
        public ActionResult CommentForm(OfferReservationModel comment)
        {
            //Comment ajaxComment = new Comment();
            //ajaxComment.CommentText = comment.UserName;
            //ajaxComment.DateCreated = comment.DateCreated;
            //ajaxComment.PostId = comment.PostId;
            //ajaxComment.UserName = comment.UserName;

            //mRep.Add(ajaxComment);
            //uow.Save();
            //Get all the comments for the given post id

            return(Json(null));
        }
コード例 #2
0
        public async Task <ActionResult> Details(OfferReservationModel OfferForm)
        {
            OfferForm.OfferId = OfferForm.OfferId;

            if (string.IsNullOrEmpty(OfferForm.FullName))
            {
                ModelState.AddModelError("FirstName", "Last_Name_Required");
            }
            if (string.IsNullOrEmpty(OfferForm.Email))
            {
                ModelState.AddModelError("Email", "Email_Required");
            }
            if (string.IsNullOrEmpty(OfferForm.PhoneNo))
            {
                ModelState.AddModelError("PhoneNo", "PhoneNo_Required");
            }
            //if (string.IsNullOrEmpty(OfferForm.CheckIn))
            //    ModelState.AddModelError("Attach", "Attach_file_Required");
            var general = url + "OfferReservations";

            if (ModelState.IsValid)
            {
                HttpResponseMessage responseMessageApi = await _client.PostAsJsonAsync(general, OfferForm);

                if (responseMessageApi.IsSuccessStatusCode)
                {
                    var responseData = responseMessageApi.Content.ReadAsStringAsync().Result;
                    if (responseData != null)
                    {
                        TempData["alertMessage"] = "Thanks, Kindly our team will contact with you shortly";
                    }
                }
                return(RedirectToAction("Index"));
            }

            return(View(OfferForm));
        }