コード例 #1
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));
        }
コード例 #2
0
        public ActionResult OverflowVoucher()
        {
            int nowServing = NowServing();

            if (nowServing == 0)
            {
                ViewBag.Warning = "Please first select a client from the Clients Table.";
                return(View("Warning"));
            }

            RequestedServicesViewModel rsvm = new RequestedServicesViewModel();
            Client client = Clients.GetClient(nowServing, rsvm);

            rsvm.Agencies = Agencies.GetAgenciesSelectList(client.AgencyId);
            rsvm.MBVDS    = MBVDS.GetMBVDSelectList();

            if (client == null)
            {
                ViewBag.Warning = "Could not find selected client.";
                return(View("Warning"));
            }

            if (CheckManager.HasHistory(client.Id))
            {
                // client.EXP = false;
                return(RedirectToAction("ExistingClientOverflowVoucher"));
            }

            // client.EXP = true;
            return(RedirectToAction("ExpressClientOverflowVoucher"));
        }
コード例 #3
0
        public ActionResult StoreExistingClientServiceRequest(RequestedServicesViewModel rsvm)
        {
            // Called when
            //    ~/Views/CaseManager/ExistingClientServiceRequest.cshtml
            // posts to server. rsvm will contain both requested services
            // and supporting documents.
            int    nowServing          = NowServing();
            Client client              = Clients.GetClient(nowServing, null); // pass null so the supporting documents won't be erased
            string serviceRequestError = ServiceRequestError(rsvm);

            if (!string.IsNullOrEmpty(serviceRequestError))
            {
                ViewBag.ClientName = Clients.ClientBeingServed(client);
                ViewBag.DOB        = client.DOB.ToString("MM/dd/yyyy");
                ViewBag.Age        = client.Age;
                ModelState.AddModelError("ServiceRequestError", serviceRequestError);
                rsvm.Agencies = Agencies.GetAgenciesSelectList(client.AgencyId);
                rsvm.MBVDS    = MBVDS.GetMBVDSelectList();
                return(View("ExistingClientServiceRequest", rsvm));
            }

            Clients.StoreRequestedServicesAndSupportingDocuments(client.Id, rsvm);
            PrepareClientNotes(client, rsvm);
            return(RedirectToAction("ManageDashboard", "Interviewer"));
        }
コード例 #4
0
        private void GetSelectionArea(FormType formType, SubStateReportType subStateType)
        {
            if ((subStateType == SubStateReportType.Agency || subStateType == SubStateReportType.AgencyPam) &&
                (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity))
            {
                Agencies = AgencyLogic.GetAgencies(DefaultState.Code);
                var _agencies = new List <KeyValuePair <string, string> >();
                _agencies.AddRange(Agencies.Select((pair => (new KeyValuePair <string, string>(pair.Key.ToString(), pair.Value)))));
                DynamicSubStateRegions = _agencies;
            }

            else if ((subStateType == SubStateReportType.CountycodeOfClientRes || subStateType == SubStateReportType.CountyOfCounselorLocation || subStateType == SubStateReportType.CountycodeOfEvent) &&
                     (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity))
            {
                DynamicSubStateRegions = AgencyLogic.GetCounties(DefaultState.Code);
            }


            else if ((subStateType == SubStateReportType.ZIPCodeOfClientRes || subStateType == SubStateReportType.ZIPCodeOfCounselorLocation) &&
                     (formType == FormType.ClientContact))
            {
                IEnumerable <ZipCountyView> zipCode = LookupBLL.GetZipCodesAndCountyFIPSForState(DefaultState.Code);
                var _zips = new List <KeyValuePair <string, string> >();
                _zips.AddRange(zipCode.Select((pair => (new KeyValuePair <string, string>(pair.Zipcode.ToString(), pair.Zipcode)))));
                DynamicSubStateRegions = _zips;
            }
        }
コード例 #5
0
        /// <summary>
        /// Asignamos los valores de ReservationOrigos a nuestro objeto Guest
        /// </summary>
        /// <param name="reservationOrigos">ReservationOrigos</param>
        /// <history>
        /// [erosado] 18/08/2016  Created.
        /// </history>
        public void SetRervationOrigosInfo(ReservationOrigos reservationOrigos)
        {
            //Asignamos el folio de reservacion
            Guest.guHReservID  = reservationOrigos.Folio;
            Guest.guLastName1  = reservationOrigos.LastName;
            Guest.guFirstName1 = reservationOrigos.FirstName;
            Guest.guCheckInD   = reservationOrigos.Arrival;
            Guest.guCheckOutD  = reservationOrigos.Departure;
            Guest.guRoomNum    = reservationOrigos.Room;
            //Calculamos Pax
            decimal pax;
            bool    convertPax = decimal.TryParse($"{reservationOrigos.Adults}.{reservationOrigos.Children}", out pax);

            Guest.guPax = convertPax ? pax : 0;
            //Obtenemos el Id del Hotel
            var ls = BRLeadSources.GetLeadSourceByID(reservationOrigos.Hotel);

            Guest.guHotel = ls?.lsho;
            //Country
            Guest.guco = Countries.Where(x => x.coN == reservationOrigos.Country).Select(x => x.coID).FirstOrDefault();
            //Agency
            Guest.guag = Agencies.Where(x => x.agN.ToUpper() == reservationOrigos.Agency.ToUpper()).Select(x => x.agID).FirstOrDefault();
            //Company
            Guest.guCompany = reservationOrigos.Company;
            //Membership
            Guest.guMembershipNum = reservationOrigos.Membership;
            //Notificamos el cambio
            OnPropertyChanged(nameof(Guest));
        }
コード例 #6
0
ファイル: SharedController.cs プロジェクト: tmhsplb/OPIDDaily
        public ActionResult ExistingClient()
        {
            int nowServing = NowServing();
            RequestedServicesViewModel rsvm = new RequestedServicesViewModel();
            Client client = Clients.GetClient(nowServing, rsvm);

            rsvm.Agencies = Agencies.GetAgenciesSelectList(client.AgencyId);
            rsvm.MBVDS    = MBVDS.GetMBVDSelectList();

            if (!string.IsNullOrEmpty(client.AgencyName))
            {
                rsvm.OtherAgency     = true;
                rsvm.OtherAgencyName = client.AgencyName;
            }

            //   rsvm.Agency = Agencies.GetAgencyName(client.AgencyId);

            ViewBag.ClientName = Clients.ClientBeingServed(client);
            ViewBag.DOB        = client.DOB.ToString("MM/dd/yyyy");
            ViewBag.Age        = client.Age;
            ViewBag.Agency     = GetClientAgencyName(client); // needed only for Interviewer role

            // ServiceTicketBackButtonHelper("Get", rsvm);

            return(View("ExistingClient", rsvm));
        }
コード例 #7
0
        public async Task <IActionResult> Edit(int id, [Bind("AgencyId,AgncyAddress,AgncyCity,AgncyProv,AgncyPostal,AgncyCountry,AgncyPhone,AgncyFax")] Agencies agencies)
        {
            if (id != agencies.AgencyId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(agencies);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AgenciesExists(agencies.AgencyId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(agencies));
        }
コード例 #8
0
        public ActionResult DeleteConfirmed(int id)
        {
            Agencies agencies = db.Agencies.Single(a => a.AgencyId == id);

            db.Agencies.DeleteObject(agencies);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #9
0
 /// <summary>
 /// add an agency to the collection
 /// </summary>
 /// <param name="agency">agency</param>
 /// <returns>true if success, false else</returns>
 public bool AddAgency(Tour_Agency agency)
 {
     if (Agencies.Contains(agency))
     {
         return(false);
     }
     Agencies.Add(agency);
     return(Agencies.Contains(agency));
 }
コード例 #10
0
ファイル: UsersController.cs プロジェクト: tmhsplb/OPIDDaily
        // https://stackoverflow.com/questions/4101116/asp-net-mvc-post-call-returning-string-need-help-with-format-for-jqgrid/4102155#4102155
        public ActionResult GetAgencies()
        {
            List <AgencyViewModel> agencies       = Agencies.GetAgencies();
            List <AgencyViewModel> activeAgencies = agencies.Where(a => a.IsActive == "Yes").ToList();

            var ls = activeAgencies.ToDictionary(a => a.AgencyId, a => a.AgencyName);

            return(PartialView("_SelectAgency", ls));
        }
コード例 #11
0
        public ActionResult ClearClientHistory()
        {
            RequestedServicesViewModel rsvm = new RequestedServicesViewModel {
                Agencies = Agencies.GetAgenciesSelectList(0)
            };

            DailyHub.GetClientHistory(0);

            return(View("ExistingClient", rsvm));
        }
コード例 #12
0
        public ActionResult AddAgent()
        {
            var agent    = new Agent();
            var agencies = new Agencies();
            var clear    = new SecurityClearance();

            var agents = new AgentVM(agent, agencies.All(), clear.All());

            return(View(agents));
        }
コード例 #13
0
 /// <summary>
 /// Constructor that accepts values for all mandatory fields
 /// </summary>
 ///<param name="refId">GUID that identifies this object.</param>
 ///<param name="schoolInfoRefId">GUID that identifies the school.</param>
 ///<param name="startDate">Effective start date for the reimbursement rates</param>
 ///<param name="endDate">Effective end date for the reimbursement rates</param>
 ///<param name="program">Refer to 5.1.23 Program.</param>
 ///<param name="agencies">Reimbursing agency</param>
 ///
 public FoodserviceReimbursementRates( string refId, string schoolInfoRefId, DateTime? startDate, DateTime? endDate, Program program, Agencies agencies )
     : base(Adk.SifVersion, FoodDTD.FOODSERVICEREIMBURSEMENTRATES)
 {
     this.RefId = refId;
     this.SchoolInfoRefId = schoolInfoRefId;
     this.StartDate = startDate;
     this.EndDate = endDate;
     this.Program = program;
     this.Agencies = agencies;
 }
コード例 #14
0
        //
        // GET: /Agency/Delete/5

        public ActionResult Delete(int id = 0)
        {
            Agencies agencies = db.Agencies.Single(a => a.AgencyId == id);

            if (agencies == null)
            {
                return(HttpNotFound());
            }
            return(View(agencies));
        }
コード例 #15
0
ファイル: SharedController.cs プロジェクト: tmhsplb/OPIDDaily
 public string GetClientAgencyName(Client client)
 {
     if (!string.IsNullOrEmpty(client.AgencyName))
     {
         return(client.AgencyName);
     }
     else
     {
         return(Agencies.GetAgencyName(client.AgencyId));
     }
 }
コード例 #16
0
        public async Task <IActionResult> Create([Bind("AgencyId,AgencyName,AgencyUrl")] Agencies agencies)
        {
            if (ModelState.IsValid)
            {
                _context.Add(agencies);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(agencies));
        }
コード例 #17
0
        /// <summary>
        /// remove an agency from the collection
        /// </summary>
        /// <param name="ID">agency's ID</param>
        /// <returns>true if success, false else</returns>
        public bool RemoveAgency(uint ID)
        {
            Tour_Agency agency = Agencies.SingleOrDefault(item => item.AgencyID == ID);

            if (agency == null)
            {
                return(false);
            }
            Agencies.Remove(agency);
            return(true);
        }
コード例 #18
0
 public ActionResult Edit(Agencies agencies)
 {
     if (ModelState.IsValid)
     {
         db.Agencies.Attach(agencies);
         db.ObjectStateManager.ChangeObjectState(agencies, System.Data.EntityState.Modified);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(agencies));
 }
コード例 #19
0
        public ActionResult Create(Agencies agencies)
        {
            if (ModelState.IsValid)
            {
                db.Agencies.AddObject(agencies);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(agencies));
        }
コード例 #20
0
        public async Task <IActionResult> Create([Bind("AgencyId,AgncyAddress,AgncyCity,AgncyProv,AgncyPostal,AgncyCountry,AgncyPhone,AgncyFax")] Agencies agencies)
        {
            if (ModelState.IsValid)
            {
                _context.Add(agencies);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(agencies));
        }
コード例 #21
0
        /*
         * 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));
        }
コード例 #22
0
ファイル: SharedController.cs プロジェクト: tmhsplb/OPIDDaily
        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));
        }
コード例 #23
0
 public IActionResult Create([FromBody] Agencies payload)
 {
     try
     {
         _service.Create(payload);
         return(Ok(payload));
     }
     catch (AppException ex)
     {
         // return error message if there was an exception
         return(DefaultError(ex));
     }
 }
コード例 #24
0
ファイル: RMSSystem.cs プロジェクト: sanjaybxl/inform
        /// <summary>
        /// Create a New Agency
        /// </summary>
        /// <param name="agencyName">Name of the Agency</param>
        /// <param name="agencyOri">Ori assigned to the Agency</param>
        public Agency.Agency CreateAgency(string agencyName, string agencyOri)
        {
            if (Agencies.Any(x => x.Jurisdiction.Ori == agencyOri))
            {
                throw new Exception("ORI is already in use.");
            }

            // Create the new Agency
            var agency = new Agency.Agency(new Jurisdiction(agencyOri, agencyOri), agencyName);

            AgencyCollection.Add(agency);
            return(agency);
        }
コード例 #25
0
        public ActionResult EditAgent(int id)
        {
            var xd = repo.GrabID(id);

            // this part is where I will be calling upon the repo in services to return a list.
            var assin    = new Assignment();
            var agencies = new Agencies();
            var clear    = new SecurityClearance();

            var agents = new AssignVM(xd, agencies.All(), clear.All(), assin);

            return(View(agents));
        }
コード例 #26
0
        public ActionResult AddAgent(Agent agent)
        {
            var repo = new AgentRepo();


            repo.Add(agent);
            var agencies = new Agencies();
            var clear    = new SecurityClearance();

            var agents = new AgentVM(agent, agencies.All(), clear.All());

            return(Redirect("/"));
        }
コード例 #27
0
ファイル: RMSSystem.cs プロジェクト: sanjaybxl/inform
        public Agency.Agency CreateAgency(Guid id, string agencyName, string agencyOri)
        {
            if (Agencies.Any(x => x.Jurisdiction.Ori == agencyOri))
            {
                throw new Exception("Cannot create a new Agency with an existing ORI.");
            }

            var agency = new Agency.Agency(new Jurisdiction(agencyOri, agencyOri), agencyName);

            // TODO: Default Roles and Permissions and Resources

            AgencyCollection.Add(agency);
            return(agency);
        }
コード例 #28
0
        public IActionResult Update(int id, [FromBody] Agencies payload)
        {
            try
            {
                payload.Id = id;
                var res = _service.Update(payload);

                return(Ok(res));
            }
            catch (AppException ex)
            {
                // return error message if there was an exception
                return(DefaultError(ex));
            }
        }
コード例 #29
0
 public void Accept(IFeedVisitor visitor)
 {
     Agencies.Accept(visitor);
     Stops.Accept(visitor);
     Routes.Accept(visitor);
     Trips.Accept(visitor);
     StopTimes.Accept(visitor);
     Calendars.Accept(visitor);
     CalendarDates.Accept(visitor);
     FareAttributes.Accept(visitor);
     FareRules.Accept(visitor);
     Shapes.Accept(visitor);
     Frequencies.Accept(visitor);
     Transfers.Accept(visitor);
     FeedInfos.Accept(visitor);
 }
コード例 #30
0
        public Agencies Create(Agencies payload)
        {
            try
            {
                payload.CreatedAt = DateTime.Now;
                payload.UpdatedAt = DateTime.Now;
                _context.Agencies.Add(payload);
                _context.SaveChanges();

                return(payload);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #31
0
        // Method responsible for getting all of the Agencies
        public static List <Agencies> getAgencies()
        {
            List <Agencies> agenciesList = new List <Agencies>();
            Agencies        agencies;
            SqlConnection   connection      = UnversalDBControls.GetConnection();
            string          selectStatement = "SELECT AgncyAddress, AgncyCity, AgncyProv, AgncyPostal, AgncyCountry, AgncyPhone, AgncyFax, AgencyId " +
                                              "FROM Agencies";
            SqlCommand selectCommand = new SqlCommand(selectStatement, connection);

            try
            {
                connection.Open();
                SqlDataReader dr = selectCommand.ExecuteReader();
                while (dr.Read())
                {
                    agencies = new Agencies();
                    agencies.AgncyAddress = dr["AgncyAddress"].ToString();
                    agencies.AgncyCity    = dr["AgncyCity"].ToString();
                    agencies.AgncyProv    = dr["AgncyProv"].ToString();
                    agencies.AgncyPostal  = dr["AgncyPostal"].ToString();
                    agencies.AgncyCountry = dr["AgncyCountry"].ToString();
                    agencies.AgncyPhone   = dr["AgncyPhone"].ToString();
                    agencies.AgncyFax     = dr["AgncyFax"].ToString();
                    // Building the string data for the map window (e,g.: 1155%208th%20Ave%20SW%20Calgary )
                    string[] separatedAdd     = dr["AgncyAddress"].ToString().Split();
                    string   completedAddress = "";
                    foreach (string add in separatedAdd)
                    {
                        completedAddress += add;
                        completedAddress += "%20";
                    }
                    completedAddress += dr["AgncyCity"].ToString();
                    agencies.MapData  = completedAddress;
                    agencies.AgencyId = (int)dr["AgencyId"];
                    agenciesList.Add(agencies);
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }
            return(agenciesList);
        }