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 void ResetHook() { transform.SetPositionAndRotation(hookBase.transform.position, hookBase.transform.rotation); UniversalFunctions.SetGlobalScale(transform, new Vector3(0.1f, 0.1f, 0.2f)); transform.SetParent(joint.transform); }
protected override void Initialize() { int tmp = UniversalFunctions.Rand(1, 100); tmp %= 4 + 1; DivisionTable.Initialize(); switch (tmp) { case 1: DelGen = FloatingPointNumberFunction.GenerateAddition; DelCom = FloatingPointNumberFunction.VerifyAddition; break; case 2: DelGen = FloatingPointNumberFunction.GenerateSubtraction; DelCom = FloatingPointNumberFunction.VerifySubtraction; break; case 3: DelGen = FloatingPointNumberFunction.GenerateMultiplication; DelCom = FloatingPointNumberFunction.VerifyMultiplication; break; case 4: DelGen = DivisionTableOfFloatingPoints.GetValue; DelCom = FloatingPointNumberFunction.VerifyDivision; break; default: break; } }
public ActionResult Create(Event incomingevent) { try { string eventasstring = JsonConvert.SerializeObject(incomingevent); if (UniversalFunctions.ContainsSpecialChar(eventasstring)) { ModelState.AddModelError("Cannot contain semi-colons", "Cannot contain semi-colons"); } ModelState.Remove("NumberOfVolunteersNeeded"); ModelState.Remove("DateOfEvent"); ModelState.Remove("Duration"); if (ModelState.IsValid) { incomingevent._id = Guid.NewGuid().ToString(); incomingevent.DateOfEvent = incomingevent.DateOfEvent.AddHours(5); eventManager.AddEventToDB(incomingevent); return(RedirectToAction("Index")); } else { ViewBag.containsspecialchar = UniversalFunctions.ContainsSpecialChar(eventasstring); return(View()); } } 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[]> Events = CSVImportParser.GetListFromCSV(path); for (int i = 0; i < Events.Count; i++) { Event ev = EventFunctions.GetEventFromString(Events[i]); eventManager.AddEventToDB(ev); } UniversalFunctions.RemoveTempFile(path); return(RedirectToAction("Index")); } catch { return(RedirectToAction("IncorrectFile", "Home")); } }
public override void Initialize() { int tmp = UniversalFunctions.Rand(1, 100); tmp %= 4 + 1; DivisionTable.Initialize(); switch (tmp) { case 1: DelGen = OrdinaryFractionsFunction.GenerateAddition; DelCom = OrdinaryFractionsFunction.VerifyAswers; break; case 2: DelGen = OrdinaryFractionsFunction.GenerateSubtraction; DelCom = OrdinaryFractionsFunction.VerifyAswers; break; case 3: DelGen = OrdinaryFractionsFunction.GenerateMultiplication; DelCom = OrdinaryFractionsFunction.VerifyAswers; break; case 4: DelGen = OrdinaryFractionsFunction.GenerateDivision; DelCom = OrdinaryFractionsFunction.VerifyAswers; break; default: break; } }
public ActionResult Create(Volunteer volunteer, IFormFile image) { try { if (UniversalFunctions.ContainsSpecialChar(JsonConvert.SerializeObject(volunteer))) { ModelState.AddModelError("Cannot contain semi-colons", "Cannot contain semi-colons"); } ModelState.Remove("Birthdate"); ModelState.Remove("HourCount"); ModelState.Remove("CIEliberat"); if (ModelState.IsValid) { volunteer._id = Guid.NewGuid().ToString(); volunteer.Birthdate = volunteer.Birthdate.AddHours(5); volunteer.Image = UniversalFunctions.Addimage(image); volunteerManager.AddVolunteerToDB(volunteer); return(RedirectToAction("Index")); } else { ViewBag.containsspecialchar = UniversalFunctions.ContainsSpecialChar(JsonConvert.SerializeObject(volunteer)); return(View()); } } catch { return(RedirectToAction("Localserver", "Home")); } }
public ActionResult Create(Sponsor incomingsponsor) { try { string sponsorasstring = JsonConvert.SerializeObject(incomingsponsor); if (UniversalFunctions.ContainsSpecialChar(sponsorasstring)) { ModelState.AddModelError("Cannot contain semi-colons", "Cannot contain semi-colons"); } ModelState.Remove("Contract.RegistrationDate"); ModelState.Remove("Contract.ExpirationDate"); ModelState.Remove("Sponsorship.Date"); if (ModelState.IsValid) { incomingsponsor._id = Guid.NewGuid().ToString(); incomingsponsor.Contract.RegistrationDate = incomingsponsor.Contract.RegistrationDate.AddHours(5); incomingsponsor.Contract.ExpirationDate = incomingsponsor.Contract.ExpirationDate.AddHours(5); sponsorManager.AddSponsorToDB(incomingsponsor); return(RedirectToAction("Index")); } else { ViewBag.containsspecialchar = UniversalFunctions.ContainsSpecialChar(sponsorasstring); return(View()); } } catch { return(RedirectToAction("Localserver", "Home")); } }
public ActionResult Edit(string id, Beneficiary beneficiary, IFormFile image) { try { if (UniversalFunctions.ContainsSpecialChar(JsonConvert.SerializeObject(beneficiary))) { ModelState.AddModelError("Cannot contain semi-colons", "Cannot contain semi-colons"); } ModelState.Remove("Contract.RegistrationDate"); ModelState.Remove("Contract.ExpirationDate"); ModelState.Remove("Marca.IdAplication"); ModelState.Remove("CI.ExpirationDateCI"); ModelState.Remove("Marca.IdContract"); ModelState.Remove("Marca.IdInvestigation"); ModelState.Remove("NumberOfPortions"); ModelState.Remove("LastTimeActiv"); ModelState.Remove("Personalinfo.Birthdate"); ModelState.Remove("CI.ICExpirationDate"); if (ModelState.IsValid) { if (image != null) { beneficiary.Image = UniversalFunctions.Addimage(image); } else { Beneficiary b = beneficiaryManager.GetOneBeneficiary(id); beneficiary.Image = b.Image; } List <ModifiedIDs> modifiedidlist = modifiedDocumentManager.GetListOfModifications(); string modifiedids = JsonConvert.SerializeObject(modifiedidlist); if (!modifiedids.Contains(id)) { Beneficiary currentbeneficiary = beneficiaryManager.GetOneBeneficiary(id); string currentbenefasstring = JsonConvert.SerializeObject(currentbeneficiary); auxiliaryDBManager.AddDocumenttoDB(currentbenefasstring); } beneficiary.PersonalInfo.Birthdate = beneficiary.PersonalInfo.Birthdate.AddHours(5); beneficiaryManager.UpdateABeneficiary(beneficiary, id); return(RedirectToAction("Index")); } else { ViewBag.id = id; bool containsspecialchar = true; return(RedirectToAction("Edit", new { id, containsspecialchar })); } } catch { return(RedirectToAction("Localserver", "Home")); } }
public ActionResult FileUpload(IFormFile Files) { try { List <Volunteer> volunteers = volunteerManager.GetListOfVolunteers(); int docsimported = 0; if (UniversalFunctions.File_is_not_empty(Files)) { string path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", Files.FileName); UniversalFunctions.CreateFileStream(Files, path); List <string[]> volunteersasstring = CSVImportParser.GetListFromCSV(path); if (CSVImportParser.DefaultVolunteerCSVFormat(path)) { for (int i = 0; i < volunteersasstring.Count; i++) { Volunteer volunteer = new Volunteer(); volunteer = VolunteerFunctions.GetVolunteerFromString(volunteersasstring[i]); if (VolunteerFunctions.DoesNotExist(volunteers, volunteer)) { docsimported++; volunteerManager.AddVolunteerToDB(volunteer); } } } else { for (int i = 0; i < volunteersasstring.Count; i++) { Volunteer volunteer = new Volunteer(); volunteer = VolunteerFunctions.GetVolunteerFromOtherString(volunteersasstring[i]); if (VolunteerFunctions.DoesNotExist(volunteers, volunteer)) { docsimported++; volunteerManager.AddVolunteerToDB(volunteer); } } } UniversalFunctions.RemoveTempFile(path); return(RedirectToAction("ImportUpdate", "Home", new { docsimported })); } else { return(View()); } } catch { return(RedirectToAction("IncorrectFile", "Home")); } }
private void ClientWindow_Load(object sender, EventArgs e) { client1.Text = UniversalFunctions.GetInstence().GetAutoincreaseID("gzb_clients", "clientID"); client19.Text = "2015-07-16 12:00:00"; String sqlPara = "clientID,companyName,gzbID,address,contactName,tel,fax,postNumber,bankName,email,bankAccount,taxNumber,PrivateBank,mainContact,mainTel,mainPhone,beizhu,modifyName,modifyDate"; String sql = "SELECT " + sqlPara + " FROM gzb_clients WHERE gzb_account ='" + MainWindow.UserID + "'"; DataTable data = DatabaseManager.Ins.ExcuteDataTable(sql, null); List <BaseControl> basecontrols = new List <BaseControl>() { client1, client2, client3, client4, client5, client6, client7, client8, client9, client10, client11, client12, client13, client14, client15, client16, client17, client18, client19 }; UniversalFunctions.GetInstence().SetValuesByBaseControls(UniversalFunctions.GetInstence().DataTableConvertToList <String>(data).ToList(), basecontrols); }
internal static List <Sponsor> GetExpiringContracts(List <Sponsor> sponsors) { int currentday = UniversalFunctions.GetDayOfYear(DateTime.Today); List <Sponsor> returnlistofspons = new List <Sponsor>(); foreach (var spons in sponsors) { int daytocompare = UniversalFunctions.GetDayOfYear(spons.Contract.ExpirationDate); if (UniversalFunctions.IsAboutToExpire(currentday, daytocompare)) { returnlistofspons.Add(spons); } } return(returnlistofspons); }
internal static List <Beneficiarycontract> GetExpiringContracts(List <Beneficiarycontract> benefcontracts) { int currentday = UniversalFunctions.GetDayOfYear(DateTime.Today); List <Beneficiarycontract> returnlistofbencontracts = new List <Beneficiarycontract>(); foreach (var benefcontract in benefcontracts) { int daytocompare = UniversalFunctions.GetDayOfYear(benefcontract.ExpirationDate); if (UniversalFunctions.IsAboutToExpire(currentday, daytocompare)) { returnlistofbencontracts.Add(benefcontract); } } return(returnlistofbencontracts); }
internal static List <Volunteer> GetVolunteersWithBirthdays(List <Volunteer> volunteers) { int currentday = UniversalHelpers.UniversalFunctions.GetDayOfYear(DateTime.Today); List <Volunteer> returnlistofvols = new List <Volunteer>(); foreach (var vol in volunteers) { int daytocompare = UniversalFunctions.GetDayOfYear(vol.Birthdate); if (UniversalFunctions.IsAboutToExpire(currentday, daytocompare)) { returnlistofvols.Add(vol); } } return(returnlistofvols); }
public ActionResult Edit(string id, Volunteer volunteer, IFormFile image) { try { if (UniversalFunctions.ContainsSpecialChar(JsonConvert.SerializeObject(volunteer))) { ModelState.AddModelError("Cannot contain semi-colons", "Cannot contain semi-colons"); } ModelState.Remove("Birthdate"); ModelState.Remove("HourCount"); ModelState.Remove("CIEliberat"); if (ModelState.IsValid) { if (image != null) { volunteer.Image = UniversalFunctions.Addimage(image); } else { Volunteer v = volunteerManager.GetOneVolunteer(id); volunteer.Image = v.Image; } volunteer.Birthdate = volunteer.Birthdate.AddHours(5); List <ModifiedIDs> modifiedidlist = modifiedDocumentManager.GetListOfModifications(); string modifiedids = JsonConvert.SerializeObject(modifiedidlist); if (!modifiedids.Contains(id)) { Volunteer currentvol = volunteerManager.GetOneVolunteer(id); string currentvolasstring = JsonConvert.SerializeObject(currentvol); auxiliaryDBManager.AddDocumenttoDB(currentvolasstring); } volunteerManager.UpdateAVolunteer(volunteer, id); return(RedirectToAction("Index")); } else { ViewBag.id = id; bool containsspecialchar = true; return(RedirectToAction("Edit", new { id, containsspecialchar })); } } 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 Edit(string id, Sponsor sponsor) { try { string sponsorasstring = JsonConvert.SerializeObject(sponsor); if (UniversalFunctions.ContainsSpecialChar(sponsorasstring)) { ModelState.AddModelError("Cannot contain semi-colons", "Cannot contain semi-colons"); } Sponsor currentsavedsponsor = sponsorManager.GetOneSponsor(id); ModelState.Remove("Contract.RegistrationDate"); ModelState.Remove("Contract.ExpirationDate"); ModelState.Remove("Sponsorship.Date"); if (ModelState.IsValid) { sponsor.Contract.RegistrationDate = sponsor.Contract.RegistrationDate.AddHours(5); sponsor.Contract.ExpirationDate = sponsor.Contract.ExpirationDate.AddHours(5); sponsor.Sponsorship.Date = sponsor.Sponsorship.Date.AddHours(5); List <ModifiedIDs> modifiedidlist = modifiedDocumentManager.GetListOfModifications(); string modifiedids = JsonConvert.SerializeObject(modifiedidlist); if (!modifiedids.Contains(id)) { Sponsor currentsponsor = sponsorManager.GetOneSponsor(id); string currentsponsorasstring = JsonConvert.SerializeObject(currentsponsor); auxiliaryDBManager.AddDocumenttoDB(currentsponsorasstring); } sponsorManager.UpdateSponsor(sponsor, id); return(RedirectToAction("Index")); } else { ViewBag.id = id; ViewBag.containsspecialchar = UniversalFunctions.ContainsSpecialChar(sponsorasstring); return(View()); } } catch { return(RedirectToAction("Localserver", "Home")); } }
public ActionResult Create(Beneficiary beneficiary, IFormFile image) { try { if (UniversalFunctions.ContainsSpecialChar(JsonConvert.SerializeObject(beneficiary))) { ModelState.AddModelError("Cannot contain semi-colons", "Cannot contain semi-colons"); } ModelState.Remove("CI.ExpirationDateCI"); ModelState.Remove("Contract.RegistrationDate"); ModelState.Remove("Contract.ExpirationDate"); ModelState.Remove("Marca.IdAplication"); ModelState.Remove("CI.CIEliberat"); ModelState.Remove("Marca.IdContract"); ModelState.Remove("Marca.IdInvestigation"); ModelState.Remove("NumberOfPortions"); ModelState.Remove("LastTimeActiv"); ModelState.Remove("Personalinfo.Birthdate"); ModelState.Remove("CI.ICExpirationDate"); if (ModelState.IsValid) { beneficiary._id = Guid.NewGuid().ToString(); beneficiary.PersonalInfo.Birthdate = beneficiary.PersonalInfo.Birthdate.AddHours(5); beneficiary.Image = UniversalFunctions.Addimage(image); beneficiaryManager.AddBeneficiaryToDB(beneficiary); return(RedirectToAction("Index")); } else { ViewBag.containsspecialchar = UniversalFunctions.ContainsSpecialChar(JsonConvert.SerializeObject(beneficiary)); return(View()); } } catch { return(RedirectToAction("Localserver", "Home")); } }
public ActionResult Edit(string id, Event incomingevent) { try { string eventasstring = JsonConvert.SerializeObject(incomingevent); if (UniversalFunctions.ContainsSpecialChar(eventasstring)) { ModelState.AddModelError("Cannot contain semi-colons", "Cannot contain semi-colons"); } ModelState.Remove("NumberOfVolunteersNeeded"); ModelState.Remove("DateOfEvent"); ModelState.Remove("Duration"); if (ModelState.IsValid) { incomingevent.DateOfEvent = incomingevent.DateOfEvent.AddHours(5); List <ModifiedIDs> modifiedidlist = modifiedDocumentManager.GetListOfModifications(); string modifiedids = JsonConvert.SerializeObject(modifiedidlist); if (!modifiedids.Contains(id)) { Event currentevent = eventManager.GetOneEvent(id); string currenteventasstring = JsonConvert.SerializeObject(currentevent); auxiliaryDBManager.AddDocumenttoDB(currenteventasstring); } eventManager.UpdateAnEvent(incomingevent, id); return(RedirectToAction("Index")); } else { ViewBag.id = id; ViewBag.containsspecialchar = UniversalFunctions.ContainsSpecialChar(eventasstring); return(View()); } } catch { return(RedirectToAction("Localserver", "Home")); } }
private void clientSave_Click(object sender, EventArgs e) { if (UniversalFunctions.GetInstence().CheckIfValdated(new List <BaseControl>() { client17 })) { String sqlPara = "gzb_account,clientID,companyName,gzbID,address,contactName,tel,fax,postNumber,bankName,email,bankAccount,taxNumber,PrivateBank,mainContact,mainTel,mainPhone,beizhu,modifyName,modifyDate"; String sql = "INSERT INTO gzb_clients (" + sqlPara + ") VALUES (" + ("@" + sqlPara).Replace(",", ",@") + ");"; List <String> basecontrols = new List <String>() { MainWindow.UserID, client1.Text, client2.Text, client3.Text, client4.Text, client5.Text, client6.Text, client7.Text, client8.Text, client9.Text, client10.Text, client11.Text, client12.Text, client13.Text, client14.Text, client15.Text, client16.Text, client17.Text, client18.Text, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") }; List <MySqlParameter> Paramter = UniversalFunctions.GetInstence().CombineMysqlParametersByBaseControl(sqlPara.Split(',').ToList(), basecontrols); if (DatabaseManager.Ins.ExecuteNonquery(sql, Paramter.ToArray()) > 0) { XtraMessageBox.Show("成功", "保存成功!"); } } else { XtraMessageBox.Show("警告", "带(*)为必填项目!"); } }
public IActionResult Index() { try { List <Volcontract> volcontracts = volContractManager.GetListOfVolunteersContracts(); List <Beneficiarycontract> beneficiarycontracts = beneficiaryContractManager.GetListOfBeneficiariesContracts(); List <Volunteer> volunteers = volunteerManager.GetListOfVolunteers(); List <Sponsor> sponsors = sponsorManager.GetListOfSponsors(); Settings appsettings = settingsManager.GetSettingsItem(); TempData[VolMongoConstants.CONNECTION_LANGUAGE] = appsettings.Lang; TempData[VolMongoConstants.NUMBER_OF_ITEMS_PER_PAGE] = appsettings.Quantity; ViewBag.nrofbds = UniversalFunctions.GetNumberOfVolunteersWithBirthdays(volunteers); ViewBag.nrofvc = UniversalFunctions.GetNumberOfExpiringVolContracts(volcontracts); ViewBag.nrofsc = UniversalFunctions.GetNumberOfExpiringSponsorContracts(sponsors); ViewBag.nrofbc = UniversalFunctions.GetNumberOfExpiringBeneficiaryContracts(beneficiarycontracts); return(View()); } 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")); } }
public ActionResult FileUpload(IFormFile Files) { try { List <Beneficiary> beneficiaries = beneficiaryManager.GetListOfBeneficiaries(); int docsimported = 0; if (UniversalFunctions.File_is_not_empty(Files)) { string path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", Files.FileName); UniversalFunctions.CreateFileStream(Files, path); List <string[]> beneficiaryasstring = CSVImportParser.GetListFromCSV(path); if (CSVImportParser.DefaultBeneficiaryCSVFormat(path)) { for (int i = 0; i < beneficiaryasstring.Count; i++) { Beneficiary beneficiary = new Beneficiary(); beneficiary = BeneficiaryFunctions.GetBeneficiaryFromString(beneficiaryasstring[i]); if (BeneficiaryFunctions.DoesNotExist(beneficiaries, beneficiary)) { docsimported++; beneficiaryManager.AddBeneficiaryToDB(beneficiary); } } } else { for (int i = 0; i < beneficiaryasstring.Count; i++) { Beneficiary beneficiary = new Beneficiary(); beneficiary = BeneficiaryFunctions.GetBeneficiaryFromOtherString(beneficiaryasstring[i]); if (BeneficiaryFunctions.DoesNotExist(beneficiaries, beneficiary)) { docsimported++; beneficiaryManager.AddBeneficiaryToDB(beneficiary); } } } List <Beneficiary> beneficiarycollection = beneficiaryManager.GetListOfBeneficiaries(); List <Beneficiarycontract> beneficiaryContractCollection = beneficiaryContractManager.GetListOfBeneficiariesContracts(); List <Beneficiarycontract> beneficiaryContracts = BeneficiaryFunctions.GetBeneficiaryContractsFromCsv(beneficiaryasstring, beneficiarycollection, beneficiaryContractCollection); foreach (Beneficiarycontract bc in beneficiaryContracts) { bc._id = Guid.NewGuid().ToString(); beneficiaryContractManager.AddBeneficiaryContractToDB(bc); } UniversalFunctions.RemoveTempFile(path); return(RedirectToAction("ImportUpdate", "Home", new { docsimported })); } else { return(View()); } } catch { return(RedirectToAction("IncorrectFile", "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")); } }
// Set Instances Reference public void SetReferences(UniversalFunctions universalFunctions, MapValue mapValue) { refCore = universalFunctions; refMapValue = mapValue; }
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")); } }
void Awake() { if (alPrScr == null) { alPrScr = FindObjectOfType <AllPrefsScript>(); } if (univFunc == null) { univFunc = FindObjectOfType <UniversalFunctions>(); } if (gM == null) { gM = FindObjectOfType <GameManager> (); } if (adMob == null) { adMob = FindObjectOfType <AndroidAdMob_0>(); } if (buf == null) { buf = FindObjectOfType <Buffer>(); } if (cntrL == null) { cntrL = FindObjectOfType <CountriesList>(); } if (plL == null) { plL = FindObjectOfType <PlayersList>(); } if (prMng == null) { prMng = FindObjectOfType <ProfileManager>(); } switch (SceneManager.GetActiveScene().buildIndex) { case 1: if (upgr == null) { upgr = FindObjectOfType <Upgrades>(); } if (allAw == null) { allAw = FindObjectOfType <AllAwardsScript>(); } if (topPanMng == null) { topPanMng = FindObjectOfType <TopPanelManager>(); } if (objM == null) { objM = FindObjectOfType <Objects_Menu>(); } if (currPrPan == null) { currPrPan = FindObjectOfType <CurrentProfilePanel>(); } if (everyDayReward == null) { everyDayReward = FindObjectOfType <EverydayReward>(); } if (carMng == null) { carMng = FindObjectOfType <CareerManager>(); } break; case 2: if (fwScr == null) { fwScr = FindObjectOfType <FireworkScript>(); } if (molnia == null) { molnia = FindObjectOfType <LighteningScript>(); } if (practScr == null) { practScr = FindObjectOfType <Practice>(); } if (timFr == null) { timFr = FindObjectOfType <TimeFreeze>(); } if (rainMan == null) { rainMan = FindObjectOfType <RainManager>(); } if (bonObjMan == null) { bonObjMan = FindObjectOfType <BonusObjManager>(); } if (enOrDis == null) { enOrDis = FindObjectOfType <EnableOrDisable>(); } if (monWin == null) { monWin = FindObjectOfType <MoneyWinScript>(); } if (camSize == null) { camSize = FindObjectOfType <CameraSize>(); } if (colCorr == null) { colCorr = FindObjectOfType <ColorCorrectionControl>(); } if (marks == null) { marks = FindObjectOfType <Markers>(); } if (goalPanScr == null) { goalPanScr = FindObjectOfType <GoalPanelScript>(); } if (objLev == null) { objLev = FindObjectOfType <Objects_Level>(); } if (scoreScr == null) { scoreScr = FindObjectOfType <Score>(); } if (pMov == null) { pMov = FindObjectOfType <PlayerMovement>(); } if (tM == null) { tM = FindObjectOfType <TimeManager>(); } if (ballScr == null) { ballScr = FindObjectOfType <BallScript>(); } if (grTr == null) { grTr = FindObjectOfType <GroundTrigger1>(); } if (congrPan == null) { congrPan = FindObjectOfType <CongradulationsPanel>(); } if (levAudScr == null) { levAudScr = FindObjectOfType <LevelAudioScript>(); } if (stChScr == null) { stChScr = FindObjectOfType <StadiumChooseScript>(); } if (ballTScr == null) { ballTScr = FindObjectOfType <BallTouchScript>(); } if (jScr == null) { jScr = FindObjectOfType <JumpScript>(); } if (skyScr == null) { skyScr = FindObjectOfType <SkyScript>(); } //if (enAlg == null) enAlg = FindObjectOfType<Enemy>(); break; } }
// Set Core Reference public void SetReference(UniversalFunctions universalFunctions) { refCore = universalFunctions; }
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")); } }