public ActionResult SponsorAllocation(string id, int page, string searching) { try { page = UniversalFunctions.GetCurrentPage(page); ViewBag.Page = page; List <Sponsor> sponsors = sponsorManager.GetListOfSponsors(); ViewBag.counter = sponsors.Count(); int nrofdocs = UniversalFunctions.GetNumberOfItemPerPageFromSettings(TempData); ViewBag.nrofdocs = nrofdocs; string stringofids = SponsorFunctions.GetStringOfIds(sponsors); ViewBag.stringofids = stringofids; sponsors = SponsorFunctions.GetSponsorsAfterPaging(sponsors, page, nrofdocs); List <Event> events = eventManager.GetListOfEvents(); ViewBag.strname = EventFunctions.GetAllocatedSponsorsString(events, id); ViewBag.Eventname = EventFunctions.GetNameOfEvent(events, id); ViewBag.Evid = id; sponsors = SponsorFunctions.GetSponsorsAfterSearching(sponsors, searching); return(View(sponsors)); } catch { return(RedirectToAction("Localserver", "Home")); } }
public IActionResult Index(string idofbeneficiary) { try { int nrofdocs = UniversalFunctions.GetNumberOfItemPerPageFromSettings(TempData); List <Beneficiarycontract> benficiarycontracts = beneficiaryContractManager.GetListOfBeneficiariesContracts(); Beneficiary benenficiary = beneficiaryManager.GetOneBeneficiary(idofbeneficiary); benficiarycontracts = benficiarycontracts.Where(z => z.OwnerID.ToString() == idofbeneficiary).ToList(); ViewBag.nameofbeneficiary = benenficiary.Fullname; ViewBag.idofbeneficiary = idofbeneficiary; return(View(benficiarycontracts)); } catch { return(RedirectToAction("Localserver", "Home")); } }
public IActionResult Index(string idofvol) { try { int nrofdocs = UniversalFunctions.GetNumberOfItemPerPageFromSettings(TempData); List <Volcontract> volcontracts = volContractManager.GetListOfVolunteersContracts(); Volunteer vol = volunteerManager.GetOneVolunteer(idofvol); volcontracts = volcontracts.Where(z => z.OwnerID.ToString() == idofvol).ToList(); ViewBag.nameofvol = vol.Fullname; ViewBag.idofvol = idofvol; return(View(volcontracts)); } catch { return(RedirectToAction("Localserver", "Home")); } }
public ActionResult Index(string searching, int page, string searchingPlace, string searchingActivity, string searchingType, string searchingVolunteers, string searchingSponsor, DateTime lowerdate, DateTime upperdate) { try { int nrofdocs = UniversalFunctions.GetNumberOfItemPerPageFromSettings(TempData); List <Event> events = eventManager.GetListOfEvents(); events = EventFunctions.GetEventsAfterFilters(events, searching, searchingPlace, searchingActivity, searchingType, searchingVolunteers, searchingSponsor, lowerdate, upperdate); ViewBag.counter = events.Count(); string stringofids = EventFunctions.GetStringOfIds(events); events = EventFunctions.GetEventsAfterPaging(events, page, nrofdocs); string key = VolMongoConstants.SESSION_KEY_EVENT; HttpContext.Session.SetString(key, stringofids); if (searching != null) { ViewBag.Filter1 = searching; } if (searchingPlace != null) { ViewBag.Filter2 = searchingPlace; } if (searchingActivity != null) { ViewBag.Filter3 = searchingActivity; } if (searchingType != null) { ViewBag.Filter4 = searchingType; } if (searchingVolunteers != null) { ViewBag.Filter5 = searchingVolunteers; } if (searchingSponsor != null) { ViewBag.Filter6 = searchingSponsor; } DateTime date = Convert.ToDateTime("01.01.0001 00:00:00"); if (lowerdate != date) { ViewBag.Filter7 = lowerdate.ToString(); } if (upperdate != date) { ViewBag.Filter8 = upperdate.ToString(); } ViewBag.searching = searching; ViewBag.Activity = searchingActivity; ViewBag.Place = searchingPlace; ViewBag.Type = searchingType; ViewBag.Volunteer = searchingVolunteers; ViewBag.Sponsor = searchingSponsor; ViewBag.Upperdate = upperdate; ViewBag.Lowerdate = lowerdate; ViewBag.page = UniversalFunctions.GetCurrentPage(page); ViewBag.nrofdocs = nrofdocs; ViewBag.stringofids = stringofids; return(View(events)); } catch { return(RedirectToAction("Localserver", "Home")); } }
public IActionResult Index(string searching, int page, string ContactInfo, DateTime lowerdate, DateTime upperdate, bool HasContract, string WhatGoods, string MoneyAmount, string GoodsAmounts) { try { if (searching != null) { ViewBag.Filters1 = searching; } if (ContactInfo != null) { ViewBag.Filters2 = ContactInfo; } if (HasContract == true) { ViewBag.Filters3 = ""; } if (WhatGoods != null) { ViewBag.Filters4 = WhatGoods; } if (MoneyAmount != null) { ViewBag.Filters5 = MoneyAmount; } if (GoodsAmounts != null) { ViewBag.Filters6 = GoodsAmounts; } DateTime date = Convert.ToDateTime("01.01.0001 00:00:00"); if (lowerdate != date) { ViewBag.Filter7 = lowerdate.ToString(); } if (upperdate != date) { ViewBag.Filter8 = upperdate.ToString(); } ViewBag.Contact = ContactInfo; ViewBag.searching = searching; ViewBag.Upperdate = upperdate; ViewBag.Lowerdate = lowerdate; ViewBag.HasContract = HasContract; ViewBag.WhatGoods = WhatGoods; ViewBag.GoodsAmount = GoodsAmounts; ViewBag.MoneyAmount = MoneyAmount; List <Sponsor> sponsors = sponsorManager.GetListOfSponsors(); page = UniversalFunctions.GetCurrentPage(page); ViewBag.page = page; sponsors = SponsorFunctions.GetSponsorsAfterFilters(sponsors, searching, ContactInfo, lowerdate, upperdate, HasContract, WhatGoods, MoneyAmount, GoodsAmounts); ViewBag.counter = sponsors.Count(); int nrofdocs = UniversalFunctions.GetNumberOfItemPerPageFromSettings(TempData); ViewBag.nrofdocs = nrofdocs; string stringofids = SponsorFunctions.GetStringOfIds(sponsors); ViewBag.stringofids = stringofids; sponsors = SponsorFunctions.GetSponsorsAfterPaging(sponsors, page, nrofdocs); string key = VolMongoConstants.SESSION_KEY_SPONSOR; HttpContext.Session.SetString(key, stringofids); return(View(sponsors)); } catch { return(RedirectToAction("Localserver", "Home")); } }
public ActionResult Index(string searchedFullname, string searchedContact, string sortOrder, bool Active, bool HasCar, bool HasDrivingLicence, DateTime lowerdate, DateTime upperdate, int page, string gender, string searchedAddress, string searchedworkplace, string searchedOccupation, string searchedRemarks, int searchedHourCount) { try { int nrofdocs = UniversalFunctions.GetNumberOfItemPerPageFromSettings(TempData); List <Volunteer> volunteers = volunteerManager.GetListOfVolunteers(); volunteers = VolunteerFunctions.GetVolunteersAfterFilters(volunteers, searchedFullname, searchedContact, Active, HasCar, HasDrivingLicence, lowerdate, upperdate, gender, searchedAddress, searchedworkplace, searchedOccupation, searchedRemarks, searchedHourCount); ViewBag.counter = volunteers.Count(); string stringofids = VolunteerFunctions.GetStringOfIds(volunteers); volunteers = VolunteerFunctions.GetVolunteerAfterPaging(volunteers, page, nrofdocs); volunteers = VolunteerFunctions.GetVolunteerAfterSorting(volunteers, sortOrder); string key = VolMongoConstants.SESSION_KEY_VOLUNTEER; HttpContext.Session.SetString(key, stringofids); if (HasDrivingLicence == true) { ViewBag.Filter1 = ""; } if (searchedFullname != null) { ViewBag.Filters2 = searchedFullname; } if (searchedContact != null) { ViewBag.Filter3 = searchedContact; } if (gender != null) { ViewBag.Filter5 = gender; } if (searchedAddress != null) { ViewBag.Filter6 = searchedAddress; } if (searchedworkplace != null) { ViewBag.Filter7 = searchedworkplace; } if (searchedRemarks != null) { ViewBag.Filter8 = searchedRemarks; } if (searchedOccupation != null) { ViewBag.Filter9 = searchedOccupation; } if (searchedHourCount != 0) { ViewBag.Filter10 = searchedHourCount.ToString(); } if (Active != false) { ViewBag.Filter11 = ""; } if (HasCar != false) { ViewBag.Filter12 = ""; } DateTime date = Convert.ToDateTime("01.01.0001 00:00:00"); if (lowerdate != date) { ViewBag.Filter13 = lowerdate.ToString(); } if (upperdate != date) { ViewBag.Filter14 = upperdate.ToString(); } ViewBag.page = UniversalFunctions.GetCurrentPage(page); ViewBag.searchedFullname = searchedFullname; ViewBag.active = Active; ViewBag.ContactInfo = searchedContact; ViewBag.SortOrder = sortOrder; ViewBag.Address = searchedAddress; ViewBag.Occupation = searchedOccupation; ViewBag.Remarks = searchedRemarks; ViewBag.HourCount = searchedHourCount; ViewBag.Upperdate = upperdate; ViewBag.Lowerdate = lowerdate; ViewBag.Gender = gender; ViewBag.hascar = HasCar; ViewBag.DesiredWorkplace = searchedworkplace; ViewBag.hasDriverLicence = HasDrivingLicence; ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : ""; ViewBag.DateSortParm = sortOrder == "Date" ? "date_desc" : "Date"; ViewBag.FullnameSort = sortOrder == "Fullname" ? "Fullname_desc" : "Fullname"; ViewBag.HourCountSort = sortOrder == "Hourcount" ? "Hourcount_desc" : "Hourcount"; ViewBag.Gendersort = sortOrder == "Gender" ? "Gender_desc" : "Gender"; ViewBag.Activesort = sortOrder == "Active" ? "Active_desc" : "Active"; ViewBag.nrofdocs = nrofdocs; return(View(volunteers)); } catch { return(RedirectToAction("Localserver", "Home")); } }
public ActionResult Index(string sortOrder, string searching, bool Active, string searchingBirthPlace, bool HasContract, bool Homeless, DateTime lowerdate, DateTime upperdate, DateTime activesince, DateTime activetill, int page, bool Weeklypackage, bool Canteen, bool HomeDelivery, string searchingDriver, bool HasGDPRAgreement, string searchingAddress, bool HasID, int searchingNumberOfPortions, string searchingComments, string searchingStudies, string searchingPO, string searchingSeniority, string searchingHealthState, string searchingAddictions, string searchingMarried, bool searchingHealthInsurance, bool searchingHealthCard, bool searchingHasHome, string searchingHousingType, string searchingIncome, string searchingExpences, string gender) { try { if (searching != null) { ViewBag.Filters1 = searching; } if (Active == true) { ViewBag.Filters2 = ""; } if (searchingBirthPlace != null) { ViewBag.Filters3 = searchingBirthPlace; } if (HasContract == true) { ViewBag.Filters4 = ""; } if (Homeless == true) { ViewBag.Filters5 = ""; } if (Weeklypackage == true) { ViewBag.Filters6 = ""; } if (Canteen == true) { ViewBag.Filters7 = ""; } if (HomeDelivery == true) { ViewBag.Filters8 = ""; } if (searchingDriver != null) { ViewBag.Filter9 = searchingDriver; } if (HasGDPRAgreement == true) { ViewBag.Filters10 = ""; } if (searchingAddress != null) { ViewBag.Filters11 = searchingAddress; } if (HasID == true) { ViewBag.Filters12 = ""; } if (searchingNumberOfPortions != 0) { ViewBag.Filters13 = searchingNumberOfPortions.ToString(); } if (searchingComments != null) { ViewBag.Filters14 = searchingComments; } if (searchingStudies != null) { ViewBag.Filters15 = searchingStudies; } if (searchingPO != null) { ViewBag.Filters16 = searchingPO; } if (searchingSeniority != null) { ViewBag.Filters17 = searchingSeniority; } if (searchingHealthState != null) { ViewBag.Filters18 = searchingHealthState; } if (searchingAddictions != null) { ViewBag.Filters19 = searchingAddictions; } if (searchingMarried != null) { ViewBag.Filters20 = searchingMarried; } if (searchingHealthInsurance == true) { ViewBag.Filters21 = ""; } if (searchingHealthCard == true) { ViewBag.Filters22 = ""; } if (searchingHasHome == true) { ViewBag.Filters23 = ""; } if (searchingHousingType != null) { ViewBag.Filters24 = searchingHousingType; } if (searchingIncome != null) { ViewBag.Filters25 = searchingIncome; } if (searchingExpences != null) { ViewBag.Filters26 = searchingExpences; } if (gender != null) { ViewBag.Filters27 = gender; } DateTime date = Convert.ToDateTime("01.01.0001 00:00:00"); if (lowerdate != date) { ViewBag.Filter28 = lowerdate.ToString(); } if (upperdate != date) { ViewBag.Filter29 = upperdate.ToString(); } if (activesince != date) { ViewBag.Filter30 = activesince.ToString(); } if (activetill != date) { ViewBag.Filter31 = activetill.ToString(); } ViewBag.SortOrder = sortOrder; ViewBag.searching = searching; ViewBag.active = Active; ViewBag.hascontract = HasContract; ViewBag.Upperdate = upperdate; ViewBag.Lowerdate = lowerdate; ViewBag.Homeless = Homeless; ViewBag.Weeklypackage = Weeklypackage; ViewBag.Canteen = Canteen; ViewBag.Activesince = activesince; ViewBag.Activetill = activetill; ViewBag.HomeDelivery = HomeDelivery; ViewBag.searchingDriver = searchingDriver; ViewBag.HasGDPRAgreement = HasGDPRAgreement; ViewBag.searchingAddress = searchingAddress; ViewBag.HasID = HasID; ViewBag.searchingNumberOfPortions = searchingNumberOfPortions; ViewBag.searchingComments = searchingComments; ViewBag.searchingBirthPlace = searchingBirthPlace; ViewBag.searchingStudies = searchingStudies; ViewBag.searchingPO = searchingPO; ViewBag.searchingSeniority = searchingSeniority; ViewBag.searchingHealthState = searchingHealthState; ViewBag.searchingAddictions = searchingAddictions; ViewBag.searchingMarried = searchingMarried; ViewBag.searchingHealthInsurance = searchingHealthInsurance; ViewBag.searchingHealthCard = searchingHealthCard; ViewBag.searchingHasHome = searchingHasHome; ViewBag.searchingIncome = searchingIncome; ViewBag.searchingExpences = searchingExpences; ViewBag.gender = gender; ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : ""; ViewBag.DateSortParm = sortOrder == "Date" ? "date_desc" : "Date"; ViewBag.FullnameSort = sortOrder == "Fullname" ? "Fullname_desc" : "Fullname"; ViewBag.Gendersort = sortOrder == "Gender" ? "Gender_desc" : "Gender"; ViewBag.Activesort = sortOrder == "Active" ? "Active_desc" : "Active"; List <Beneficiary> beneficiaries = beneficiaryManager.GetListOfBeneficiaries(); page = UniversalFunctions.GetCurrentPage(page); ViewBag.page = page; beneficiaries = BeneficiaryFunctions.GetBeneficiariesAfterFilters(beneficiaries, sortOrder, searching, Active, searchingBirthPlace, HasContract, Homeless, lowerdate, upperdate, activesince, activetill, page, Weeklypackage, Canteen, HomeDelivery, searchingDriver, HasGDPRAgreement, searchingAddress, HasID, searchingNumberOfPortions, searchingComments, searchingStudies, searchingPO, searchingSeniority, searchingHealthState, searchingAddictions, searchingMarried, searchingHealthInsurance, searchingHealthCard, searchingHasHome, searchingHousingType, searchingIncome, searchingExpences, gender); ViewBag.counter = beneficiaries.Count(); int nrofdocs = UniversalFunctions.GetNumberOfItemPerPageFromSettings(TempData); ViewBag.nrofdocs = nrofdocs; string stringofids = BeneficiaryFunctions.GetStringOfIds(beneficiaries); ViewBag.stringofids = stringofids; beneficiaries = BeneficiaryFunctions.GetBeneficiariesAfterPaging(beneficiaries, page, nrofdocs); string key = VolMongoConstants.SESSION_KEY_BENEFICIARY; HttpContext.Session.SetString(key, stringofids); return(View(beneficiaries)); } catch { return(RedirectToAction("Localserver", "Home")); } }