Пример #1
0
        public ActionResult DoctorPage(string name)
        {
            PezeshkPlusEntities                  db         = new PezeshkPlusEntities();
            List <USP_SEL_Doctor_Result>         doctorInfo = db.USP_SEL_Doctor(Session["DoctorEmail"].ToString()).ToList();
            List <USP_SEL_DoctorComments_Result> comments   = db.USP_SEL_DoctorComments(Session["DoctorEmail"].ToString()).ToList();

            if (doctorInfo[0].Address == null)
            {
                doctorInfo[0].Address = "ثبت نشده";
            }
            if (doctorInfo[0].ClinicPhone == null)
            {
                doctorInfo[0].ClinicPhone = "ثبت نشده";
            }
            if (doctorInfo[0].WorkTime == null)
            {
                doctorInfo[0].WorkTime = "ثبت نشده";
            }

            ViewBag.DoctorInfo = doctorInfo;
            ViewBag.Comments   = comments;

            Models.CustomModel.Comment model = new Models.CustomModel.Comment();

            return(View(model));
        }
Пример #2
0
        public ActionResult Commenting(Models.CustomModel.Comment commentModel)
        {
            PezeshkPlusEntities db = new PezeshkPlusEntities();

            try
            {
                if (commentModel.Rate != 0)
                {
                    db.USP_UPD_Rate(Session["DoctorEmail"].ToString(), commentModel.Rate);
                }
                db.USP_INS_Comment(Session["DoctorEmail"].ToString(), commentModel.Text, commentModel.Name, null);
                TempData["CommentSent"] = "دیدگاه شما ارسال شد و پس از تایید مدیر نمایش داده خواهد شد";
            }
            catch (Exception)
            {
                TempData["CommentNotSent"] = "خطایی در ارسال دیدگاه رخ داد!";
            }

            return(RedirectToAction("DoctorPage", new { name = Session["DoctorName"].ToString() }));
        }
Пример #3
0
        public ActionResult SearchBox(Models.CustomModel.Comment cModel)
        {
            Search model = cModel.SearchModel;

            return(RedirectToAction("Index", model));
        }