Example #1
0
        public ActionResult PatientFeedback()
        {
            BL_PatientFeedback patientfeedback1 = new BL_PatientFeedback();
            PatientFeedback    AddServiceMod    = new PatientFeedback();

            AddServiceMod.dsgrid = patientfeedback1.GetAllFeedbackForm();
            return(View(AddServiceMod));
        }
Example #2
0
        public JsonResult GetUserValue(string prefix)
        {
            BL_PatientFeedback patientfeedback1 = new BL_PatientFeedback();

            return(new JsonResult {
                Data = patientfeedback1.GetUserName(prefix), JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Example #3
0
        public JsonResult GetAllFeedbackForm()
        {
            BL_PatientFeedback patientfeedback1 = new BL_PatientFeedback();
            PatientFeedback    AddServiceMod    = new PatientFeedback();

            AddServiceMod.dsgrid = patientfeedback1.GetAllFeedbackForm();


            List <PatientFeedback> search = new List <PatientFeedback>();

            foreach (DataRow dr in AddServiceMod.dsgrid.Tables[0].Rows)
            {
                search.Add(new PatientFeedback
                {
                    QuestionHeadID   = dr["QuestionHeadID"].ToString(),
                    QuestionHeadName = dr["QuestionHeadName"].ToString(),
                    QuestionName     = dr["QuestionName"].ToString(),
                });
            }
            return(new JsonResult {
                Data = search, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Example #4
0
        public ActionResult PatientFeedback(PatientFeedback obj, FormCollection fm)
        {
            {
                string username = fm["Username"].ToString();


                string comment    = fm["Comments"].ToString();
                string headnameid = fm["headid"].ToString();
                string name       = fm["Qestion"].ToString();
                string ReviewType = fm["ReviewType"].ToString();
                obj.remark = fm["remark"].ToString();
                string remark = obj.remark;
                obj.userquestionhead = fm["userquestionhead"].ToString();
                string userquestionhead = obj.userquestionhead;

                string[] remark1 = comment.Split(',');

                string[]      userquestionhead1 = userquestionhead.Split(',');
                string[]      username1         = username.Split(',');
                List <string> stringlist        = new List <string>();
                List <string> remarklist        = new List <string>();


                string[] headnameid1 = headnameid.Split(',');

                for (int j = 0; j < (username1.Length); j++)
                {
                    for (int i = 0; i < headnameid1.Length; i++)
                    {
                        if (userquestionhead1[j] == headnameid1[i])
                        {
                            stringlist.Add(username1[j]);
                        }
                    }
                }

                for (int j = 0; j < (remark1.Length); j++)
                {
                    for (int i = 0; i < headnameid1.Length; i++)
                    {
                        if (userquestionhead1[j] == headnameid1[i])
                        {
                            remarklist.Add(remark1[j]);
                        }
                    }
                }



                string emp = string.Join(",", stringlist);
                obj.Username = emp;

                string comm = string.Join(",", remarklist);
                obj.Comments = comm;

                try
                {
                    //if (obj.Comments != "" || obj.Comments != null)
                    //{
                    //    obj.Comments = fm["comment"].ToString();
                    //}
                    //else
                    //{
                    //    obj.Comments = "";
                    //}

                    if (obj.ReviewType != "" || obj.ReviewType != null)
                    {
                        obj.ReviewType = fm["ReviewType"].ToString();
                    }
                    else
                    {
                        obj.ReviewType = "";
                    }
                    obj.QuestionName = "";
                    if (obj.QuestionName != "" || obj.QuestionName != null)
                    {
                        obj.QuestionName = fm["Qestion"].ToString();
                    }
                    else
                    {
                        obj.QuestionName = "";
                    }

                    if (obj.QuestionHeadID != "" || obj.QuestionHeadID != null)
                    {
                        obj.QuestionHeadID = fm["headid"].ToString();
                    }
                    else
                    {
                        obj.QuestionHeadID = "";
                    }

                    BL_PatientFeedback patientfeedback1 = new BL_PatientFeedback();
                    if (patientfeedback1.PatientFeedback(obj))
                    {
                        ModelState.Clear();
                        ViewData["flag"] = "Done";
                    }
                    else
                    {
                        ViewData["flag"] = "Error";
                    }
                    return(PatientFeedback());
                }
                catch (Exception)
                {
                    return(View());
                }
            }
        }