示例#1
0
        public ActionResult PrepareInterviewerExistingClient()
        {
            int nowServing = NowServing();
            RequestedServicesViewModel rsvm = new RequestedServicesViewModel();
            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;
            ViewBag.Agency        = GetClientAgencyName(client);
            List <VisitViewModel> visits = Visits.GetVisits(nowServing);

            rsvm.XBC = client.XBC == true ? "XBC" : string.Empty;
            rsvm.XID = client.XID == true ? "XID" : string.Empty;

            // ServiceTicketBackButtonHelper("Set", rsvm);
            var objTuple = new Tuple <List <VisitViewModel>, RequestedServicesViewModel>(visits, rsvm);

            return(View("PrintExistingClient", objTuple));
        }
示例#2
0
        public ActionResult PrepareExistingClientOverflowVoucher(RequestedServicesViewModel rsvm)
        {
            int    nowServing = NowServing();
            Client client     = Clients.GetClient(nowServing, null);

            Clients.StoreRequestedServicesAndSupportingDocuments(client.Id, rsvm);
            PrepareClientNotes(client, rsvm);

            DateTime today      = Extras.DateTimeToday();
            DateTime expiryDate = Clients.CalculateExpiry(today);

            Clients.UpdateOverflowExpiry(nowServing, expiryDate);
            ViewBag.ClientName  = Clients.ClientBeingServed(client);
            ViewBag.BirthName   = client.BirthName;
            ViewBag.DOB         = client.DOB.ToString("MM/dd/yyyy");
            ViewBag.Age         = client.Age;
            ViewBag.Agency      = Agencies.GetAgencyName(Convert.ToInt32(rsvm.AgencyId)); // rsvm.AgencyId will be the Id of an Agency as a string
            ViewBag.IssueDate   = today.ToString("ddd MMM d, yyyy");
            ViewBag.Expiry      = expiryDate.ToString("ddd MMM d, yyyy");
            ViewBag.VoucherDate = today.ToString("MM/dd/yyyy"); // for _OverflowSignatureBlock.cshtml
            List <VisitViewModel> visits = Visits.GetVisits(nowServing);

            rsvm.XBC = client.XBC == true ? "XBC" : string.Empty;
            rsvm.XID = client.XID == true ? "XID" : string.Empty;

            //  VoucherBackButtonHelper("Set", rsvm);
            var objTuple = new Tuple <List <VisitViewModel>, RequestedServicesViewModel>(visits, rsvm);

            return(View("PrintExistingClientOverflowVoucher", objTuple));
        }
示例#3
0
        public JsonResult GetClientHistory(int nowServing)
        {
            if (nowServing == 0)
            {
                return(GetEmptyGrid(1, 20));
            }

            List <VisitViewModel> visits = Visits.GetVisits(nowServing);

            int pageIndex    = 0;
            int pageSize     = 20;
            int totalRecords = visits.Count;
            int totalPages   = (int)Math.Ceiling((float)totalRecords / (float)20);

            visits = visits.Skip(pageIndex * pageSize).Take(pageSize).ToList();
            visits = visits.OrderBy(v => v.Date).ToList();

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

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
示例#4
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));
        }
示例#5
0
        public ActionResult PrepareExistingClientVisits()
        {
            int    nowServing = NowServing();
            Client client     = Clients.GetClient(nowServing, null);

            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;
            List <VisitViewModel> visits = Visits.GetVisits(nowServing);

            return(View("PrintExistingClientVisits", visits));
        }
示例#6
0
        public JsonResult GetVisitHistory(int page, int rows)
        {
            int nowServing = NowServing();

            List <VisitViewModel> visits = Visits.GetVisits(nowServing);
            int pageIndex    = page - 1;
            int pageSize     = rows;
            int totalRecords = visits.Count;
            int totalPages   = (int)Math.Ceiling((float)totalRecords / (float)rows);

            visits = visits.Skip(pageIndex * pageSize).Take(pageSize).ToList();
            visits = visits.OrderBy(v => v.Date).ToList();

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

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }