[longomatch] Fix creation of default templates



commit 97e7dcc51cce07008e4ae7954c0cd3db9f4fc06f
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Sep 16 15:51:15 2011 +0200

    Fix creation of default templates

 LongoMatch/Store/Templates/CategoriesTemplate.cs |    2 +-
 LongoMatch/Store/Templates/TeamTemplate.cs       |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/LongoMatch/Store/Templates/CategoriesTemplate.cs b/LongoMatch/Store/Templates/CategoriesTemplate.cs
index 7a28538..7363683 100644
--- a/LongoMatch/Store/Templates/CategoriesTemplate.cs
+++ b/LongoMatch/Store/Templates/CategoriesTemplate.cs
@@ -115,7 +115,7 @@ namespace LongoMatch.Store.Templates
 
 		private void FillDefaultTemplate(int count) {
 			for(int i=1; i<=count; i++)
-				AddDefaultItem(i);
+				AddDefaultItem(i-1);
 		}
 	}
 }
diff --git a/LongoMatch/Store/Templates/TeamTemplate.cs b/LongoMatch/Store/Templates/TeamTemplate.cs
index 49f5ae2..16b944f 100644
--- a/LongoMatch/Store/Templates/TeamTemplate.cs
+++ b/LongoMatch/Store/Templates/TeamTemplate.cs
@@ -56,11 +56,11 @@ namespace LongoMatch.Store.Templates
 		
 		public void AddDefaultItem (int i) {
 			Insert(i, new Player {
-					Name = "Player " + i,
+					Name = "Player " + i+1,
 					Birthday = new DateTime(),
 					Height = 1.80f,
 					Weight = 80,
-					Number = i,
+					Number = i+1,
 					Position = "",
 					Photo = null,
 					Playing = true,});
@@ -79,7 +79,7 @@ namespace LongoMatch.Store.Templates
 		private void FillDefaultTemplate(int playersCount) {
 			Clear();
 			for(int i=1; i<=playersCount; i++)
-				AddDefaultItem(i);
+				AddDefaultItem(i-1);
 		}
 	}
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]