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 ActionResult FileUpload(IFormFile Files) { try { string path = " "; if (UniversalFunctions.File_is_not_empty(Files)) { path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", Files.FileName); UniversalFunctions.CreateFileStream(Files, path); } else { return(View()); } List <string[]> Sponsors = CSVImportParser.GetListFromCSV(path); for (int i = 0; i < Sponsors.Count; i++) { Sponsor s = SponsorFunctions.GetSponsorFromString(Sponsors[i]); sponsorManager.AddSponsorToDB(s); } UniversalFunctions.RemoveTempFile(path); return(RedirectToAction("Index")); } catch { return(RedirectToAction("IncorrectFile", "Home")); } }
public ActionResult ContractExp() { try { List <Sponsor> sponsors = sponsorManager.GetListOfSponsors(); sponsors = SponsorFunctions.GetExpiringContracts(sponsors); return(View(sponsors)); } catch { return(RedirectToAction("Localserver", "Home")); } }
public ActionResult CSVSaver(bool All, bool NameOfSponsor, bool Date, bool MoneyAmount, bool WhatGoods, bool GoodsAmount, bool HasContract, bool ContractDetails, bool PhoneNumber, bool MailAdress) { string IDS = HttpContext.Session.GetString(VolMongoConstants.SECONDARY_SESSION_KEY_SPONSOR); HttpContext.Session.Remove(VolMongoConstants.SECONDARY_SESSION_KEY_SPONSOR); string ids_and_fields = SponsorFunctions.GetIdAndFieldString(IDS, All, NameOfSponsor, Date, MoneyAmount, WhatGoods, GoodsAmount, HasContract, ContractDetails, PhoneNumber, MailAdress); string key1 = VolMongoConstants.SPONSORSESSION; string header = ControllerHelper.GetHeaderForExcelPrinterSponsor(_localizer); string key2 = VolMongoConstants.SPONSORHEADER; ControllerHelper.CreateDictionaries(key1, key2, ids_and_fields, header); string csvexporterlink = "csvexporterapp:" + key1 + ";" + key2; return(Redirect(csvexporterlink)); }
public ActionResult SponsorAllocation(string[] sponsorids, string Evid) { try { List <Sponsor> sponsors = sponsorManager.GetListOfSponsors(); sponsors = SponsorFunctions.GetSponsorsByIds(sponsors, sponsorids); Event eventtoallocateto = eventManager.GetOneEvent(Evid); string nameofsponsors = SponsorFunctions.GetSponsorNames(sponsors); eventtoallocateto.AllocatedSponsors = nameofsponsors; eventManager.UpdateAnEvent(eventtoallocateto, Evid); return(RedirectToAction("Index")); } catch { return(View()); } }
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")); } }