Beispiel #1
0
        public string AddTextMsg(string sender, TextMsgViewModel textMsg)
        {
            int nowServing = NowServing();
            int msgCnt     = Convert.ToInt32(SessionHelper.Get("MsgCnt"));

            if (nowServing != 0)
            {
                bool stopConversation = Clients.AddTextMsg(nowServing, sender, textMsg);

                if (stopConversation)
                {
                    msgCnt -= 1;
                }
                else
                {
                    msgCnt += 1;
                }

                SessionHelper.Set("MsgCnt", msgCnt.ToString());

                DailyHub.Refresh();
                DailyHub.RefreshConversation(nowServing, msgCnt);
                return("Success");
            }

            return("Failure");
        }
        public string EditClientServiceDate(ClientViewModel cvm)
        {
            Clients.EditServiceDate(cvm);

            DailyHub.Refresh();
            return("Success");
        }
Beispiel #3
0
        public string EditPocketCheck(VisitViewModel vvm)
        {
            int nowServing = NowServing();

            Visits.EditVisit(nowServing, vvm);
            DailyHub.Refresh();
            return("Success");
        }
Beispiel #4
0
        /// <summary>
        ///  PLB: 6/15/2020 Disallowed this through jqGrid in
        ///     FrontDeskClientHistory.js
        ///     FrontDeskPocketChecks.js
        ///     BackOfficeClientHistory.js
        ///     BackOfficePocketChecks.js
        ///     InterviewerClientHistory.js
        ///     InterviewerPocketChecks.js
        ///  May revisit this decision later.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string DeletePocketCheck(int id)
        {
            int nowServing = NowServing();

            Visits.DeletePocketCheck(nowServing, id);
            DailyHub.Refresh();
            return("Success");
        }
Beispiel #5
0
        public string AddDatedPocketCheck(VisitViewModel vvm)
        {
            int nowServing = NowServing();

            vvm.Date = Extras.DateTimeToday();
            Visits.AddPocketCheck(nowServing, vvm);
            DailyHub.Refresh();
            return("Success");
        }
Beispiel #6
0
        public string AddVisitNote(int vid, string sender, VisitNoteModel vnm)
        {
            int nowServing = NowServing();

            //  Log.Debug(string.Format("NowServing = {0}, vid = {1}, side = {2}", nowServing, vid, side));

            Visits.AddVisitNote(nowServing, vid, sender, vnm);
            DailyHub.Refresh();
            return("Success");
        }
Beispiel #7
0
        public string EditReviewClient(ClientReviewViewModel crvm)
        {
            string status = Clients.EditReviewClient(crvm);

            if (status.Equals("Success"))
            {
                DailyHub.Refresh();
            }
            return(status);
        }
        public ActionResult ClearClientHistory()
        {
            RequestedServicesViewModel rsvm = new RequestedServicesViewModel {
                Agencies = Agencies.GetAgenciesSelectList(0)
            };

            DailyHub.GetClientHistory(0);

            return(View("ExistingClient", rsvm));
        }
        /*
         * public ActionResult PrehistoricChecks()
         * {
         *  RequestedServicesViewModel rsvm = new RequestedServicesViewModel();
         *  int nowServing = NowServing();
         *  Client client = Clients.GetClient(nowServing, rsvm);
         *  rsvm.Agencies = Agencies.GetAgenciesSelectList(client.AgencyId);
         *  rsvm.MBVDS = MBVDS.GetMBVDSelectList();
         *
         *  ViewBag.ClientName = Clients.ClientBeingServed(client);
         *  ViewBag.DOB = client.DOB.ToString("MM/dd/yyyy");
         *  ViewBag.Age = client.Age;
         *
         *  // Treat a client with ancient history like a client with existing history
         *  // that is not yet visible, i.e. must be added to any actual existing history.
         *  return View("ExistingClient", rsvm);
         * }
         */

        public ActionResult GetClientHistory()
        {
            RequestedServicesViewModel rsvm = new RequestedServicesViewModel {
                Agencies = Agencies.GetAgenciesSelectList(0)
            };

            string nowServing = SessionHelper.Get("NowServing");

            DailyHub.GetClientHistory(Convert.ToInt32(nowServing));

            return(View("ExistingClient", rsvm));
        }
Beispiel #10
0
        public ActionResult PrepareExpressClient(RequestedServicesViewModel rsvm)
        {
            int nowServing = NowServing();

            Clients.StoreRequestedServicesAndSupportingDocuments(nowServing, rsvm);

            // This is the POST method of
            //   ~/Views/FrontDesk/ExpressClient.cshtml
            // If the NowServing client comes from the front desk, then the client will
            // have no supporting documents and the supporting documents section of the service
            // ticket will simply be a worksheet for the interviewer to fill in. If the NowServing
            // client comes from the Dashboard, then the client will have supporting documents.
            // So in either case, passing rsvm instead of null as the second argument of
            // GetClient is correct.
            Client client = Clients.GetClient(nowServing, rsvm);

            PrepareClientNotes(client, rsvm);

            DateTime today = Extras.DateTimeToday();

            ViewBag.TicketDate    = today.ToString("MM/dd/yyyy");
            ViewBag.ServiceTicket = client.ServiceTicket;
            ViewBag.ClientName    = Clients.ClientBeingServed(client);
            ViewBag.BirthName     = client.BirthName;
            ViewBag.DOB           = client.DOB.ToString("MM/dd/yyyy");
            ViewBag.Age           = client.Age;

            if (rsvm.OtherAgency && !string.IsNullOrEmpty(client.AgencyName))
            {
                ViewBag.Agency = client.AgencyName;
            }
            else
            {
                ViewBag.Agency = Agencies.GetAgencyName(Convert.ToInt32(rsvm.AgencyId));  // rsvm.Agency will be the Id of an Agency as a string
            }

            // ServiceTicketBackButtonHelper("Set", rsvm);

            // May have added a pocket check. In that case, this express client becomes
            // an existing client.
            if (CheckManager.HasHistory(nowServing))
            {
                List <VisitViewModel> visits = Visits.GetVisits(nowServing);

                var objTuple = new Tuple <List <VisitViewModel>, RequestedServicesViewModel>(visits, rsvm);
                return(View("PrintExistingClient", objTuple));
            }

            DailyHub.Refresh();

            return(View("PrintExpressClient", rsvm));
        }
        public string DeleteMyClient(int id)
        {
            string trainingClients = Config.TrainingClients;

            if (!string.IsNullOrEmpty(trainingClients) && trainingClients.Contains(id.ToString()))
            {
                return("Failure");
            }

            Clients.DeleteMyClient(id);
            DailyHub.Refresh();
            return("Success");
        }
Beispiel #12
0
        public string AddDependentClient(int household, ClientViewModel cvm)
        {
            int referringAgency = ReferringAgency();
            int id = Clients.AddDependentClient(referringAgency, household, cvm);

            if (id == -1)
            {
                return("Failure");
            }

            DailyHub.Refresh();
            NowServing(id);
            return("Success");
        }
        public ActionResult UpdateClientView()
        {
            string nowServing = SessionHelper.Get("NowServing");

            if (nowServing.Equals("0"))
            {
                ViewBag.Warning = "Please select a client from the Clients Table before selecting Update Client View.";
                return(View("Warning"));
            }

            DailyHub.RefreshClient(Convert.ToInt32(nowServing));

            return(View("Clients"));
        }
Beispiel #14
0
        public JsonResult NowConversing(SearchParameters sps, int page, int frontdesk = 0, int?nowConversing = 0, int?rows = 15)
        {
            // Log.Debug(string.Format("Enter NowConversing: nowConversing = {0}", nowConversing));

            int agencyId = ReferringAgency();
            int msgCnt   = Convert.ToInt32(SessionHelper.Get("MsgCnt"));

            NowServing(nowConversing);

            List <ClientViewModel> clients;

            if (agencyId == 0)
            {
                if (frontdesk == 1)
                {
                    clients = Clients.GetClients(sps, Extras.DateTimeToday());
                }
                else
                {
                    clients = Clients.GetDashboardClients(sps);
                }
            }
            else
            {
                clients = Clients.GetMyClients(agencyId);
            }

            int pageIndex = page - 1;
            int pageSize  = (int)rows;

            int totalRecords = clients.Count;
            int totalPages   = (int)Math.Ceiling((float)totalRecords / (float)pageSize);

            clients = clients.Skip(pageIndex * pageSize).Take(pageSize).ToList();

            //  Log.Debug(string.Format("NowConversing: page = {0}, rows = {1}, totalPages = {2}", page, rows, totalPages));

            DailyHub.RefreshConversation((int)nowConversing, msgCnt);

            var jsonData = new
            {
                total   = totalPages,
                page    = page,
                records = totalRecords,
                rows    = clients
            };

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
Beispiel #15
0
        public string EditTextMsg(TextMsgViewModel textMsg)
        {
            int nowServing = NowServing();
            int msgCnt     = Convert.ToInt32(SessionHelper.Get("MsgCnt"));

            if (nowServing != 0)
            {
                Clients.EditTextMsg(nowServing, textMsg);
                DailyHub.Refresh();
                DailyHub.RefreshConversation(nowServing, msgCnt);
                return("Success");
            }

            return("Failure");
        }
Beispiel #16
0
        public string EditClient(ClientViewModel cvm)
        {
            int id = Clients.EditClient(cvm);

            // Edited client becomes the client being served.
            NowServing(id);

            DailyHub.Refresh();

            if (!string.IsNullOrEmpty(cvm.Conversation) && cvm.Conversation.Equals("Y"))
            {
                return("OpenConversation");
            }

            return("Success");
        }
Beispiel #17
0
        public string AddClient(ClientViewModel cvm)
        {
            int id = Clients.AddClient(cvm);

            if (id == -1)
            {
                return("Failure");
            }

            // Newly added client becomes the client being served.
            // Entity Framework will set client.Id to the Id of the inserted client.
            // See: https://stackoverflow.com/questions/5212751/how-can-i-get-id-of-inserted-entity-in-entity-framework
            NowServing(id);

            DailyHub.Refresh();
            return("Success");
        }
        public ActionResult ClearClientView()
        {
            DailyHub.RefreshClient(0);

            return(View("Clients"));
        }
Beispiel #19
0
 public string DeleteVisitNote(int id)
 {
     Visits.DeleteVisitNote(id);
     DailyHub.Refresh();
     return("Success");
 }
Beispiel #20
0
 public string EditVisitNote(VisitNoteModel vnm)
 {
     Visits.EditVisitNote(vnm);
     DailyHub.Refresh();
     return("Success");
 }
Beispiel #21
0
 public string DeleteDependentClient(int id)
 {
     Clients.DeleteMyClient(id);
     DailyHub.Refresh();
     return("Success");
 }