public JsonResult Search(SearchModel searchCriteria) { var uriString = string.Format(serviceBaseUri + @"/Search?firstName={0}&lastName={1}&email={2}&phone={3}&occupationName={4}&occupationDescription={5}&instituteName={6}&instituteLocation={7}&qualification={8}&yearOfGradutation={9}&address={10}&state={11}&city={12}&country={13}&postcode={14}&preferedName={15}&houseName={16}&branch={17}&matchAllCriteria={18}" ,searchCriteria.FirstName, searchCriteria.LastName,searchCriteria.Email,searchCriteria.Phone,searchCriteria.OccupationName,searchCriteria.OccupationDescription ,searchCriteria.InstituteName,searchCriteria.InstituteLocation,searchCriteria.Qualification,searchCriteria.YearOfGraduation ,searchCriteria.Address,searchCriteria.State,searchCriteria.City,searchCriteria.Country,searchCriteria.Postcode ,searchCriteria.PreferedName,searchCriteria.HouseName,searchCriteria.Branch,true); var constituentsData = HttpHelper.Get<ConstituentsData>(uriString); mapper = new AutoDataContractMapper(); var constituents = new Constituents(); mapper.MapList(constituentsData, constituents,typeof(Constituent)); ViewData["Constituents"] = constituents; return this.Json(constituents); }
private Emails GetEmails() { var constituentId = Convert.ToInt32(Session["constituentId"]); var emailsData = HttpHelper.Get<EmailsData>(serviceBaseUri+"/Emails?ConstituentId="+constituentId); mapper = new AutoDataContractMapper(); var emails = new Emails(); mapper.MapList(emailsData, emails, typeof(Email)); return emails; }
private Constituents PopulateSearchResults(string id) { var uriString = serviceBaseUri + "/SearchUnRegistered?constituentId=" + id; var constituentsData = HttpHelper.Get<ConstituentsData>(uriString); mapper = new AutoDataContractMapper(); var constituents = new Constituents(); mapper.MapList(constituentsData, constituents, typeof (Constituent)); return constituents; }
private Constituents GetRegistrations() { var constituentsData = HttpHelper.Get<ConstituentsData>(serviceBaseUri + "/Registrations"); mapper = new AutoDataContractMapper(); var constituents = new Constituents(); mapper.MapList(constituentsData, constituents, typeof (Constituent)); return constituents; }
private Phones GetPhones(int constituentId) { var phonesData = HttpHelper.Get<PhonesData>(string.Format(serviceBaseUri + "/Phones?ConstituentId={0}", constituentId)); mapper = new AutoDataContractMapper(); var phones = new Phones(); mapper.MapList(phonesData, phones, typeof(Phone)); return phones; }
private Occupations GetOccupations(int constituentId) { var OccupationsData = HttpHelper.Get<OccupationsData>(string.Format(serviceBaseUri + "/Occupations?ConstituentId={0}", constituentId)); mapper = new AutoDataContractMapper(); var Occupations = new Occupations(); mapper.MapList(OccupationsData, Occupations, typeof(Occupation)); return Occupations; }
private EducationDetails GetEducations(int constituentId) { var educationDetailsData = HttpHelper.Get<EducationDetailsData>(string.Format(serviceBaseUri + "/EducationDetails?ConstituentId={0}", constituentId)); mapper = new AutoDataContractMapper(); var educations = new EducationDetails(); mapper.MapList(educationDetailsData, educations, typeof(EducationDetail)); return educations; }
private Associations GetAssociations(int constituentId) { var associationsData = HttpHelper.Get<AssociationsData>(string.Format(serviceBaseUri + "/Associations?ConstituentId={0}", constituentId)); mapper = new AutoDataContractMapper(); var associations = new Associations(); mapper.MapList(associationsData, associations, typeof(Association)); return associations; }
private Addresses GetAddress(int constituentId) { var addressesData = HttpHelper.Get<AddressesData>(string.Format(serviceBaseUri + "/Addresses?ConstituentId={0}", constituentId)); mapper = new AutoDataContractMapper(); var addresses = new Addresses(); mapper.MapList(addressesData, addresses, typeof(Address)); return addresses; }
private UploadFilesModel GetFiles() { var uploadDatas = HttpHelper.Get<UploadDatas>(string.Format(serviceBaseUri + "/UploadFiles")); mapper = new AutoDataContractMapper(); var files = new UploadFilesModel(); mapper.MapList(uploadDatas, files, typeof(UploadModel)); Model = files; return files; }
public ActionResult GetConstituent(string text) { Thread.Sleep(1000); var uriString = string.Format(serviceBaseUri + @"/Search?firstName={0}&lastName={0}&email={1}&phone={1}&occupationName={1}&occupationDescription={1}&instituteName={1}&instituteLocation={1}&qualification={1}&yearOfGradutation={1}&address={1}&state={1}&city={1}&country={1}&postcode={1}&preferedName={0}&houseName={1}&branch={1}", text,null); var constituentsData = HttpHelper.Get<ConstituentsData>(uriString); mapper = new AutoDataContractMapper(); var constituents = new Constituents(); mapper.MapList(constituentsData, constituents, typeof(Constituent)); IEnumerable<Constituent> enumerable = null; if (text.HasValue()) { enumerable = constituents.Where((p) => p.Name.FirstName.StartsWith(text,true,null) || p.Name.LastName.StartsWith(text,true,null)); } IEnumerable<SelectListItem> selectList = from c in enumerable select new SelectListItem { Text = c.Name.NameWithoutSalutation, Value = c.Id.ToString() }; return new JsonResult { Data = selectList }; }
private Committees GetCommitteeMembers() { var committeesData = HttpHelper.Get<CommitteesData>(serviceBaseUri+"/Committees"); mapper = new AutoDataContractMapper(); var committees = new Committees(); mapper.MapList(committeesData, committees, typeof(Committee)); return committees; }