public ActionResult GetPatientAddress(string MrNumber) { //string patientAddress = string.Empty; string vunetId = User.Identity.Name; RetrievePatientInformation patientinfo = new RetrievePatientInformation(); Patient patient = patientinfo.GetPatient(MrNumber, vunetId); //patientAddress = patient.Address + ", " + patient.City + ", " + patient.State + ", " + patient.Zip; if (!string.IsNullOrEmpty(patient.MRN)) { RequestModel requestModel = new RequestModel(); if (patient.State.Length > 2) { var states = requestModel.GetStatesList(); patient.State = states.Where(x => x.Text == patient.State).FirstOrDefault().Value; } AddressFill fill = new AddressFill() { AddressLineOne = patient.Address.Replace(",", ""), City = patient.City, State = patient.State, Zip = patient.Zip, Phone = patient.Phone }; return(Json(fill, JsonRequestBehavior.AllowGet)); } else { return(Json("", JsonRequestBehavior.AllowGet)); } }
public ActionResult GetCityState(string zip) { tblZipCityState cityState = new tblZipCityState(); using (var context = new lifeflightapps()) { cityState = context.tblZipCityStates.Where(z => z.Zip == zip).FirstOrDefault(); } AddressFill fill = new AddressFill() { City = cityState.City, State = cityState.StateCode }; return(Json(fill, JsonRequestBehavior.AllowGet)); }
public ActionResult GetDestinationAddress(string Destination, string Filter) { string[] splitTaskName = Destination.Split(','); string destinationName = splitTaskName[0].ToString(); string statecode = splitTaskName[2].ToString(); Union_Facilities facilities = new Union_Facilities(); using (var context = new lifeflightapps()) { facilities = context.Union_Facilities.Where(d => d.NAME == destinationName && d.STATE == statecode).FirstOrDefault(); } AddressFill fill = new AddressFill() { AddressLineOne = facilities.ADDRESS, City = facilities.CITY, State = facilities.STATE, Zip = facilities.ZIP, Phone = facilities.PHONE }; return(Json(fill, JsonRequestBehavior.AllowGet)); }