예제 #1
0
        public async Task <ActionResult> HospitalFeedBack(int hospitalID)
        {
            if (hospitalID != 0)
            {
                string              email = string.Empty;
                FeedBackModels      model = new FeedBackModels();
                Hospital            hospital;
                List <FeedbackType> feebackType = await FeedBackModels.LoadFeedbackTypeAsync();

                ViewBag.FeedbackTypeList = new SelectList(feebackType, Constants.FeedbackType, Constants.FeedbackTypeName);
                hospital = await HospitalUtil.LoadHospitalByHospitalIDAsync(hospitalID);

                model.FeedbackType = 3;
                model.HospitalName = hospital.Hospital_Name;
                model.HospitalID   = hospitalID;
                string name = User.Identity.Name;
                // login user is normal user
                if (User.IsInRole("User"))
                {
                    model.Email = User.Identity.Name.Split(Char.Parse(Constants.Minus))[0];
                }
                else if (User.IsInRole("Hospital User"))
                {
                    model.Email = User.Identity.Name.Split(Char.Parse(Constants.Minus))[0];
                }
                return(PartialView("FeedBack", model));
            }
            else
            {
                return(RedirectToAction("SystemFeedBack"));
            }
        }
예제 #2
0
        public async Task <ActionResult> FeedBack(FeedBackModels model)
        {
            try
            {
                string url    = Request.Url.AbsoluteUri;
                int    result = 0;

                // Return list of dictionary words
                using (LinqDBDataContext data = new LinqDBDataContext())
                {
                    result = await FeedBackModels.InsertFeedbackAsync(model);
                }

                // Check returned result
                if (result == 1)
                {
                    ViewBag.AddFeedbackStatus = 1;
                    return(RedirectToAction(Constants.HospitalAction, Constants.HomeController, new { hospitalId = model.HospitalID, redirect = "yes" }));
                }
                else
                {
                    ViewBag.AddFeedbackStatus = 0;
                    ModelState.Clear();
                    return(View());
                }
            }
            catch (Exception exception)
            {
                LoggingUtil.LogException(exception);
                return(RedirectToAction(Constants.SystemFailureHomeAction, Constants.ErrorController));
            }
        }
예제 #3
0
        public async Task <ActionResult> SystemFeedBack()
        {
            List <FeedbackType> feebackType = await FeedBackModels.LoadFeedbackTypeAsync();

            ViewBag.FeedbackTypeList = new SelectList(feebackType, Constants.FeedbackType, Constants.FeedbackTypeName);
            return(PartialView("FeedBack"));
        }