public static Insert ( bool dbconOpened, string tableName, string uniqueID, int personID, int sessionID, double weight ) : int | ||
dbconOpened | bool | |
tableName | string | |
uniqueID | string | |
personID | int | |
sessionID | int | |
weight | double | |
return | int |
//typical constructor public PersonOld(string name, string sex, DateTime dateBorn, double height, double weight, int sportID, int speciallityID, int practice, string description, int race, int countryID, int serverUniqueID, int sessionID) { name = Util.RemoveTildeAndColon(name); description = Util.RemoveTildeAndColon(description); this.name = name; this.sex = sex; this.dateBorn = dateBorn; this.height = height; this.weight = weight; this.sportID = sportID; this.speciallityID = speciallityID; this.practice = practice; this.description = description; this.race = race; this.countryID = countryID; this.serverUniqueID = serverUniqueID; //remember don't do this on server this.sessionID = sessionID; //insert in the person table //when insert as person we don't know uniqueID uniqueID = -1; int insertedID = this.InsertAtDB(false, Constants.PersonOldTable); //we need uniqueID for personSession uniqueID = insertedID; LogB.Information(this.ToString()); //insert in the personSession table (fast way of knowing who was in each session) SqlitePersonSessionOld.Insert(false, Constants.PersonSessionOldWeightTable, "-1", uniqueID, sessionID, weight); }
public int InsertAtDB(bool dbconOpened, string tableName) { int myID = SqlitePersonSessionOld.Insert(dbconOpened, tableName, uniqueID.ToString(), personID, sessionID, weight); return(myID); }