本文整理汇总了C#中Allberg.Shooter.WinShooterServerRemoting.Structs.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Structs.ToString方法的具体用法?C# Structs.ToString怎么用?C# Structs.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Allberg.Shooter.WinShooterServerRemoting.Structs
的用法示例。
在下文中一共展示了Structs.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTeamResults
internal ResultsReturnTeam[] GetTeamResults(Structs.ResultWeaponsClass wclass,
Structs.Competition competition)
{
Trace.WriteLine("CResults.GetResults(" + wclass.ToString() +
") started on thread \"" +
System.Threading.Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
while (resultsAlreadyRunning)
System.Threading.Thread.Sleep(50);
Trace.WriteLine("CResults: GetResults() " +
" locking \"GetResultsLock\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
lock(GetResultsLock)
{
Trace.WriteLine("CResults: GetResults() " +
" locked \"GetResultsLock\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
try
{
resultsAlreadyRunning = true;
CompetitionType = myInterface.CompetitionCurrent.Type;
database = myInterface.databaseClass.Database;
useNorwegianCount = competition.NorwegianCount;
// Ok, now lets count the real ones
DSResults results = getAllTeams(wclass);
results = sortTeams(results);
ResultsReturnTeam[] toReturn =
convertIntoArray(results);
return toReturn;
}
finally
{
Trace.WriteLine("CResultsTeam: GetResults() " +
" unlocking \"GetResultsLock\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
Trace.WriteLine("CResults.GetResults ended.");
resultsAlreadyRunning = false;
}
}
}
示例2: getPatrols
internal Structs.Patrol[] getPatrols(
Structs.PatrolClass patrolClass,
bool alsoIncludeUnknownClass,
bool OnlyIncludePatrolsWithSpace,
int PatrolIdToAlwaysView)
{
Trace.WriteLine("CDatabase: Entering getPatrols(PatrolClass=" +
patrolClass.ToString() + ", alsoIncludeUnknownClass=" +
alsoIncludeUnknownClass.ToString() + ")");
string select = "PClass=" + ((int)patrolClass).ToString();
if (alsoIncludeUnknownClass)
select += " or PClass=" +
((int)Structs.PatrolClass.Okänd).ToString();
ArrayList patrols = new ArrayList();
Structs.Patrol patrol = new Structs.Patrol();
Structs.Competition competition = getCompetitions()[0];
DateTime compStart = competition.StartTime;
foreach(DatabaseDataset.PatrolsRow row in Database.Patrols.Select(
select, "PatrolId"))
{
patrol = new Structs.Patrol();
patrol.CompetitionId = row.CompetitionId;
patrol.PatrolId = row.PatrolId;
patrol.StartDateTime = compStart.AddMinutes(row.StartDateTime);
patrol.PClass = (Structs.PatrolClass)row.PClass;
if (row.StartDateTimeDisplay > -1054800000)
patrol.StartDateTimeDisplay = compStart.AddMinutes(row.StartDateTimeDisplay);
else
patrol.StartDateTimeDisplay = patrol.StartDateTime;
patrol.LockedForAutomatic = row.Automatic;
if (!OnlyIncludePatrolsWithSpace |
Database.Competitors.Select("PatrolId=" +
patrol.PatrolId.ToString()).Length<competition.PatrolSize |
patrol.PatrolId == PatrolIdToAlwaysView)
{
patrols.Add(patrol);
}
}
return (Structs.Patrol[])patrols.ToArray(patrol.GetType());
}
示例3: createTeamResults
private string createTeamResults(Structs.ResultsReturnTeam[] results,
Structs.ResultWeaponsClass wclass)
{
StringBuilder html = new StringBuilder();
html.Append("<h1>Lagtävling</h1>");
html.Append("Vapenklass " + wclass.ToString() + ":");
html.Append("<table>\r\n");
html.Append("<tr>" +
"<td><b>Pl</b></td>" +
"<td><b>Klubb</b></td>" +
"<td><b>Lag</b></td>" +
"<td><b>Resultat</b></td>" +
"</tr>\r\n");
int place = 0;
foreach(Structs.ResultsReturnTeam result in results)
{
place++;
html.Append("<tr>");
html.Append("<td class=\"resultevenline\">" + place.ToString() + "</td>");
html.Append("<td class=\"resultevenline\">" + myInterface.GetClub( result.ClubId ).Name + "</td>");
html.Append("<td class=\"resultevenline\">" + result.TeamName + "</td>");
if (myInterface.GetCompetitions()[0].NorwegianCount)
html.Append("<td class=\"resultevenline\">" + (result.Hits + result.FigureHits).ToString() + "</td>");
else
html.Append("<td class=\"resultevenline\">" + result.Hits.ToString() + "/" + result.FigureHits.ToString() + "</td>");
html.Append("</tr>\r\n");
// The total results
html.Append("<tr><td colspan=2></td>");
html.Append("<td colspan=2>" + result.HitsPerStn.Replace(";", " ") + "</td>");
html.Append("</tr>\r\n");
Structs.Team team = myInterface.GetTeam( result.TeamId );
ArrayList comps = new ArrayList();
if (team.CompetitorId1 != -1)
comps.Add(team.CompetitorId1);
if (team.CompetitorId2 != -1)
comps.Add(team.CompetitorId2);
if (team.CompetitorId3 != -1)
comps.Add(team.CompetitorId3);
if (team.CompetitorId4 != -1)
comps.Add(team.CompetitorId4);
foreach(int compId in (int[])comps.ToArray(typeof(int)))
{
Structs.Competitor comp = myInterface.GetCompetitor(compId);
html.Append("<tr><td colspan=2></td>");
html.Append("<td>" + GetNameForCompetitor(comp) + "</td>");
html.Append("<td>" + GetResultForCompetitor(comp) + "</td>");
html.Append("</tr>\r\n");
}
}
html.Append("</table>");
return html.ToString();
}
示例4: ResultsGetUClasses
internal Structs.ShootersClass[] ResultsGetUClasses(
Structs.ResultWeaponsClass wclass)
{
Trace.WriteLine("CResult.ResultsGetUClasses(\"" +
wclass.ToString() + "\") " +
"started on thread \"" +
System.Threading.Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
DateTime start = DateTime.Now;
database = myInterface.databaseClass.Database;
List<int> sClassesIntTable = new List<int>();
List<Structs.ShootersClass> shooterClasses = new List<Structs.ShootersClass>();
foreach(DatabaseDataset.CompetitorsRow row in
database.Competitors)
{
Structs.Weapon weapon = myInterface.GetWeapon(row.WeaponId);
if (myInterface.ConvertWeaponsClassToResultClass(weapon.WClass) ==
wclass)
{
if (row.GetChildRows("CompetitorsCompetitorResults").Length > 0)
{
if (!sClassesIntTable.Contains(row.ShooterClass))
{
sClassesIntTable.Add(row.ShooterClass);
Structs.ShootersClass uclass =
(Structs.ShootersClass)row.ShooterClass;
shooterClasses.Add(uclass);
}
}
}
}
if (myInterface.CompetitionCurrent.OneClass)
{
if (shooterClasses.Contains(Structs.ShootersClass.Klass1) ||
shooterClasses.Contains(Structs.ShootersClass.Klass2) ||
shooterClasses.Contains(Structs.ShootersClass.Klass3))
{
shooterClasses.Add(Structs.ShootersClass.Klass);
shooterClasses.Remove(Structs.ShootersClass.Klass1);
shooterClasses.Remove(Structs.ShootersClass.Klass2);
shooterClasses.Remove(Structs.ShootersClass.Klass3);
}
if (shooterClasses.Contains(Structs.ShootersClass.Damklass1) ||
shooterClasses.Contains(Structs.ShootersClass.Damklass2) ||
shooterClasses.Contains(Structs.ShootersClass.Damklass3))
{
shooterClasses.Add(Structs.ShootersClass.Damklass);
shooterClasses.Remove(Structs.ShootersClass.Damklass1);
shooterClasses.Remove(Structs.ShootersClass.Damklass2);
shooterClasses.Remove(Structs.ShootersClass.Damklass3);
}
}
/*for(int i=0 ; i<=Structs.ShootersClassMax ; i++)
{
try
{
if (sClassesIntTable.Contains(i))
{
int.Parse(((Structs.ShootersClass)i).ToString());
}
}
catch(System.FormatException)
{
// Ok, we got a class
Structs.ShootersClass uclass =
(Structs.ShootersClass)i;
shooterClasses.Add(uclass);
}
}*/
shooterClasses.Sort();
Trace.WriteLine("CResult.ResultsGetUClasses(\"" +
wclass.ToString() + "\") " +
"ending after " +
(DateTime.Now-start).TotalMilliseconds.ToString() +
" ms.");
return shooterClasses.ToArray();
}
示例5: GetResults
internal ResultsReturn[] GetResults(
Structs.ResultWeaponsClass wclass,
Structs.ShootersClass uclass,
Structs.Competition competition,
bool finalResults)
{
Trace.WriteLine("CResults.GetResults(" + wclass.ToString()
+ ", " + uclass.ToString() +
") started on thread \"" +
System.Threading.Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
while (resultsAlreadyRunning)
System.Threading.Thread.Sleep(50);
Trace.WriteLine("CResults: GetResults() " +
" locking \"GetResultsLock\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
lock(GetResultsLock)
{
Trace.WriteLine("CResults: GetResults() " +
" locked \"GetResultsLock\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
try
{
resultsAlreadyRunning = true;
database = myInterface.databaseClass.Database;
useNorwegianCount = competition.NorwegianCount;
// First find out about the standard medals
calculateStandardMedals(wclass, uclass);
// Ok, now lets count the real ones
if (competition.OneClass)
{
switch (uclass)
{
case Structs.ShootersClass.Damklass:
uclass = Structs.ShootersClass.Damklass;
break;
case Structs.ShootersClass.Damklass1:
uclass = Structs.ShootersClass.Damklass;
break;
case Structs.ShootersClass.Damklass2:
uclass = Structs.ShootersClass.Damklass;
break;
case Structs.ShootersClass.Damklass3:
uclass = Structs.ShootersClass.Damklass;
break;
case Structs.ShootersClass.Juniorklass:
break;
case Structs.ShootersClass.Klass:
uclass = Structs.ShootersClass.Klass;
break;
case Structs.ShootersClass.Klass1:
uclass = Structs.ShootersClass.Klass;
break;
case Structs.ShootersClass.Klass2:
uclass = Structs.ShootersClass.Klass;
break;
case Structs.ShootersClass.Klass3:
uclass = Structs.ShootersClass.Klass;
break;
case Structs.ShootersClass.VeteranklassYngre:
break;
case Structs.ShootersClass.VeteranklassÄldre:
break;
case Structs.ShootersClass.Öppen:
break;
default:
throw new NotSupportedException("Structs.ShootersClass." +
uclass.ToString() + " is not supported");
}
}
List<ResultsReturn> results = getAllCompetitors(wclass, uclass, false);
results.Sort();
if (myInterface.CompetitionCurrent.Championship !=
Structs.CompetitionChampionshipEnum.Club)
{
results = markMedals(results);
}
else
{
// Mark all as not having medals
foreach (ResultsReturn row in results)
{
row.Medal = Structs.Medal.None;
}
}
if (finalResults)
{
results = markPriceMoney(results);
}
//.........这里部分代码省略.........
示例6: delCompetitorResult
internal void delCompetitorResult(Structs.CompetitorResult res)
{
Trace.WriteLine("CDatabase: Entering delCompetitorResult(" +
res.ToString() + ")");
Trace.WriteLine("CDatabase: delCompetitorResult() " +
" locking \"DatabaseLocker\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
lock(_databaseLocker)
{
Trace.WriteLine("CDatabase: delCompetitorResult() " +
" locked \"DatabaseLocker\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
foreach(DatabaseDataset.CompetitorResultsRow row in
Database.CompetitorResults.Select(
"ResultId=" + res.ResultId.ToString()))
{
if(row.ResultId == res.ResultId)
{
row.Delete();
}
}
Trace.WriteLine("CDatabase: delCompetitorResult() " +
" unlocking \"DatabaseLocker\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
}
MyInterface.updatedCompetitorResult(res);
return;
}
示例7: delWeapon
internal void delWeapon(Structs.Weapon weapon)
{
Trace.WriteLine("CDatabase: Entering delWeapon(" +
weapon.ToString() + ")");
Trace.WriteLine("CDatabase: delWeapon() " +
" locking \"DatabaseLocker\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
lock(_databaseLocker)
{
Trace.WriteLine("CDatabase: delWeapon() " +
" locked \"DatabaseLocker\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
foreach(DatabaseDataset.WeaponsRow row in Database.Weapons.Select(
"WeaponId='" + weapon.WeaponId + "'"))
{
if(row.WeaponId == weapon.WeaponId)
{
row.Delete();
}
}
Trace.WriteLine("CDatabase: delWeapon() " +
" unlocking \"DatabaseLocker\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
}
MyInterface.updatedWeapon();
return;
}
示例8: delShooter
internal void delShooter(Structs.Shooter shooter)
{
Trace.WriteLine("CDatabase: Entering delShooter(" +
shooter.ToString() + ")");
Trace.WriteLine("CDatabase: delShooter() " +
" locking \"DatabaseLocker\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
lock(_databaseLocker)
{
Trace.WriteLine("CDatabase: delShooter() " +
" locked \"DatabaseLocker\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
foreach(DatabaseDataset.ShootersRow row in Database.Shooters
.Select("ShooterId=" + shooter.ShooterId.ToString()))
{
if(row.ShooterId == shooter.ShooterId)
{
row.Delete();
}
}
Trace.WriteLine("CDatabase: delShooter() " +
" unlocking \"DatabaseLocker\" on thread \"" +
Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");
}
MyInterface.updatedShooter(shooter);
return;
}
示例9: updatePatrol
internal void updatePatrol(Structs.Patrol patrol, bool updateGui)
{
Trace.WriteLine("CDatabase: Entering updatePatrol(" +
patrol.ToString() + ", " + updateGui.ToString() + ")");
DateTime compStart = getCompetitions()[0].StartTime;
bool found = false;
foreach(DatabaseDataset.PatrolsRow row in
Database.Patrols.Select("PatrolId=" + patrol.PatrolId.ToString()))
{
if (row.PatrolId == patrol.PatrolId)
{
row.CompetitionId = patrol.CompetitionId;
row.StartDateTime = (int)(patrol.StartDateTime-compStart).TotalMinutes;
row.StartDateTimeDisplay = (int)(patrol.StartDateTimeDisplay-compStart).TotalMinutes;
row.PClass = (int)patrol.PClass;
row.Automatic = patrol.LockedForAutomatic;
found = true;
}
}
if (!found)
throw new CannotFindIdException("Could not find PatrolId " +
patrol.PatrolId.ToString() + " to update");
else
if (updateGui)
MyInterface.updatedPatrol();
}
示例10: updateCompetition
internal void updateCompetition(Structs.Competition competition)
{
Trace.WriteLine("CDatabase: Entering updateCompetition(" +
competition.ToString() + ")");
bool found = false;
bool PatrolConnectionTypeChanged = false;
foreach(DatabaseDataset.CompetitionRow row in Database.Competition.Select(
"CompetitionId=" + competition.CompetitionId.ToString()))
{
if (row.CompetitionId == competition.CompetitionId)
{
row.Name = competition.Name;
row.NorwegianCount = competition.NorwegianCount;
row.PatrolSize = competition.PatrolSize;
row.PatrolTime = competition.PatrolTime;
row.PatrolTimeBetween = competition.PatrolTimeBetween;
row.PatrolTimeRest = competition.PatrolTimeRest;
row.StartDate = competition.StartTime.Date;
row.StartTime = (int)competition.StartTime.TimeOfDay.TotalMinutes;
row.DoFinalShooting = competition.DoFinalShooting;
row.FirstPrice = competition.FirstPrice;
row.PriceMoneyPercentToReturn = competition.PriceMoneyPercentToReturn;
row.ShooterFee1 = competition.ShooterFee1;
row.ShooterFee2 = competition.ShooterFee2;
row.ShooterFee3 = competition.ShooterFee3;
row.ShooterFee4 = competition.ShooterFee4;
row.UsePriceMoney = competition.UsePriceMoney;
row.PriceMoneyShooterPercent = competition.PriceMoneyShooterPercent;
row.Type = (int)competition.Type;
row.Championship = (int)competition.Championship;
row.OneClass = competition.OneClass;
if (row.PatrolConnectionType != (int)competition.PatrolConnectionType)
{
PatrolConnectionTypeChanged = true;
row.PatrolConnectionType = (int)competition.PatrolConnectionType;
}
found = true;
}
}
if (!found)
throw new CannotFindIdException("Could not find competitionId " +
competition.CompetitionId.ToString() + " to update");
else
MyInterface.updatedCompetition();
if (PatrolConnectionTypeChanged)
{
MyInterface.patrolClass.ChangePatrolConnectionType(competition.PatrolConnectionType);
}
}
示例11: updateWeapon
internal void updateWeapon(Structs.Weapon weapon)
{
Trace.WriteLine("CDatabase: Entering updateWeapon(" +
weapon.ToString() + ")");
bool found = false;
foreach(DatabaseDataset.WeaponsRow row in Database.Weapons.Select(
"WeaponId='" + weapon.WeaponId + "'"))
{
if (row.WeaponId == weapon.WeaponId)
{
row.Manufacturer = weapon.Manufacturer;
row.Model = weapon.Model;
row.Caliber = weapon.Caliber;
row.Class = (int)weapon.WClass;
row.Automatic = weapon.Automatic;
row.ToAutomatic = weapon.ToAutomatic;
row.LastUpdate = DateTime.Now;
found = true;
}
}
if (!found)
throw new CannotFindIdException("Could not find WeaponId " +
weapon.WeaponId.ToString() + " to update");
else
MyInterface.updatedWeapon();
}
示例12: updateCompetitor
internal void updateCompetitor(Structs.Competitor competitor,
bool updateGui)
{
Trace.WriteLine("CDatabase: Entering updateCompetitor(" +
competitor.ToString() + ")");
if (competitor.WeaponId == null)
{
Trace.WriteLine("CDatabase: updateCompetitor " +
"competitor.WeaponId is null.");
throw new CannotFindIdException("competitor.WeaponId is null.");
}
bool found = false;
foreach(DatabaseDataset.CompetitorsRow row in
Database.Competitors.Select("CompetitorId=" +
competitor.CompetitorId.ToString()))
{
lock(_databaseLocker)
{
int oldPatrol = -1;
int newPatrol = -1;
try
{
// Check there isn't anyone already on that lane and patrol
if (Database.Competitors.Select("PatrolId=" + competitor.PatrolId +
" and Lane=" + competitor.Lane +
" and CompetitorId<>" + competitor.CompetitorId).Length>0)
{
throw new PatrolAndLaneAlreadyTakenException(
"There already exist a competitor with patrol " +
competitor.PatrolId + " and lane " +
competitor.Lane + ". Error occured when updating " +
"competitorId " + competitor.CompetitorId.ToString());
}
// Save new and old values for patrols
if (!row.IsPatrolIdNull())
oldPatrol = row.PatrolId;
newPatrol = competitor.PatrolId;
row.CompetitionId = competitor.CompetitionId;
if (competitor.PatrolId == -1)
row.SetPatrolIdNull();
else
row.PatrolId = competitor.PatrolId;
row.ShooterId = competitor.ShooterId;
row.WeaponId = competitor.WeaponId;
row.ShooterClass = (int)competitor.ShooterClass;
if (competitor.PatrolId != -1)
{
if (competitor.Lane == -1)
{
try
{
competitor.Lane =
MyInterface.patrolClass
.GetNextLane(competitor.PatrolId);
}
catch(PatrolAlreadyFullException)
{
competitor.PatrolId = -1;
row.SetPatrolIdNull();
row.SetLaneNull();
throw;
}
}
}
else
{
competitor.Lane = -1;
}
if (competitor.Lane == -1)
row.SetLaneNull();
else
row.Lane = competitor.Lane;
row.FinalShootingPlace = competitor.FinalShootingPlace;
found = true;
}
finally
{
// Update patroltypes
checkForPatrolClassUpdate(oldPatrol, updateGui);
checkForPatrolClassUpdate(newPatrol, updateGui);
}
}
}
if (!found)
throw new CannotFindIdException("Could not find CompetitorId " +
competitor.CompetitorId.ToString() + " to update");
else
if (updateGui)
MyInterface.updatedCompetitor(competitor);
}
示例13: updateShooter
internal void updateShooter(Structs.Shooter shooter)
{
Trace.WriteLine("CDatabase: Entering updateShooter(" +
shooter.ToString() + ")");
bool found = false;
foreach(DatabaseDataset.ShootersRow row in Database.Shooters.Select(
"ShooterId=" + shooter.ShooterId.ToString()))
{
if (row.ShooterId == shooter.ShooterId)
{
row.Arrived = shooter.Arrived;
row.ClubId = shooter.ClubId;
row.Cardnr = shooter.CardNr;
row.Email = shooter.Email;
row.Givenname = shooter.Givenname;
row.Payed = shooter.Payed;
row.Surname = shooter.Surname;
row.ToAutomatic = shooter.ToAutomatic;
row.Automatic = shooter.Automatic;
row.Class = (int)shooter.Class;
row.LastUpdate = DateTime.Now;
found = true;
}
}
if (!found)
throw new CannotFindIdException("Could not find shooterId " +
shooter.ShooterId.ToString() + " to update");
else
MyInterface.updatedShooter(shooter);
}
示例14: updateClub
internal void updateClub(Structs.Club club)
{
Trace.WriteLine("CDatabase: Entering updateClub(" +
club.ToString() + ")");
bool found = false;
foreach(DatabaseDataset.ClubsRow row in Database.Clubs.Select(
"ClubId='" + club.ClubId + "'"))
{
if (row.ClubId == club.ClubId)
{
row.Country = club.Country;
row.Name = club.Name;
row.Automatic = club.Automatic;
row.ToAutomatic = club.ToAutomatic;
row.Plusgiro = club.Plusgiro;
row.Bankgiro = club.Bankgiro;
row.LastUpdate = DateTime.Now;
found = true;
}
}
if (!found)
throw new CannotFindIdException("Could not find ClubId " +
club.ClubId.ToString() + " to update");
else
MyInterface.updatedClub();
}
示例15: getCompetitorResultsExist
internal bool getCompetitorResultsExist(Structs.ResultWeaponsClass wclass,
Structs.ShootersClass uclass)
{
Trace.WriteLine("CDatabase: Entering getCompetitorResultsExist(" +
wclass.ToString() + ", " + uclass.ToString() + ") on thread \"" +
System.Threading.Thread.CurrentThread.Name + "\" ( " +
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " ) ");
try
{
Hashtable compsList = new Hashtable();
Hashtable weaponsList = new Hashtable();
foreach(DatabaseDataset.CompetitorResultsRow row in
Database.CompetitorResults)
{
Structs.Competitor comp;
if (compsList.ContainsKey(row.CompetitorId))
comp = (Structs.Competitor)compsList[row.CompetitorId];
else
{
comp = MyInterface.GetCompetitor(row.CompetitorId);
compsList.Add(row.CompetitorId, comp);
}
Structs.Weapon weapon;
if (weaponsList.ContainsKey(comp.WeaponId))
weapon = (Structs.Weapon)weaponsList[comp.WeaponId];
else
{
weapon = MyInterface.GetWeapon(comp.WeaponId);
weaponsList.Add(comp.WeaponId, weapon);
}
if ( MyInterface.ConvertWeaponsClassToResultClass(
weapon.WClass) == wclass)
{
// Weaponsclass is correct. Check Shooters class
//Interface.Shooter shooter =
// myInterface.GetShooter(comp.ShooterId);
if (comp.ShooterClass == uclass)
return true;
}
}
}
catch(System.InvalidOperationException)
{
// this occurs when the collection changed during testing.
// try again
Trace.WriteLine("CDatabase: getCompetitorResultsCount failed to changed collection. Retrying.");
return getCompetitorResultsExist(wclass, uclass);
}
Trace.WriteLine("CDatabase: Leaving getCompetitorResultsExist()");
return false;
}