Esempio n. 1
0
        //get the patient review and update the patient review
        public int UpdateReviewActivityLog(string userId, string reviewid)
        {
            try
            {
                if (!string.IsNullOrEmpty(userId) && !string.IsNullOrEmpty(reviewid))
                {
                    User luser = lIUserRepository.getUser(userId);
                    if (luser != null)
                    {
                        PatientReview lreview = lIPatientReviewRepository.GetPatientReview(reviewid);
                        if (lreview != null)
                        {
                            lreview.Duration = Convert.ToInt32((DateTime.Now - lreview.StartTimeStamp).TotalSeconds);
                            int _result = lIPatientReviewRepository.UpdatePatientReview(lreview);
                            return(_result);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.LogDebug("Error: " + ex);
            }

            return(0);
        }
Esempio n. 2
0
        public JsonResult updatereviewactivity([FromBody] PatientReview log)
        {
            try
            {
                if (!string.IsNullOrEmpty(HttpContext.Session.GetString("ReviewID")))
                {
                    User luser = lIUserRepository.getUserbySessionId(HttpContext.Session.GetString("SessionId"));
                    if (luser != null)
                    {
                        PatientReview lreview = lIPatientReviewRepository.GetPatientReview(HttpContext.Session.GetString("ReviewID"));
                        if (lreview != null)
                        {
                            lreview.Duration          = Convert.ToInt32((DateTime.Now - lreview.StartTimeStamp).TotalSeconds);
                            lreview.AssessmentComment = log.AssessmentComment;

                            int _result = lIPatientReviewRepository.UpdatePatientReview(lreview);
                            if (_result > 0)
                            {
                                HttpContext.Session.SetString("ReviewID", "");
                                HttpContext.RemoveCookie("ReviewID");
                                return(Json(new { result = "success" }));
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.LogDebug("Error: " + ex);
            }
            return(Json(new { result = "failure" }));
        }