Account constructor with int calling other constructor
This commit is contained in:
@ -19,8 +19,7 @@ namespace NightmareCoreWeb2
|
||||
public List<Character> Characters { get; set; }
|
||||
public List<AccountAccess> Access { get; set; }
|
||||
|
||||
|
||||
public static Account AccountByID(int id)
|
||||
public Account(int id)
|
||||
{
|
||||
|
||||
MySqlConnection conn = new MySqlConnection(Program.connStr);
|
||||
@ -33,7 +32,7 @@ namespace NightmareCoreWeb2
|
||||
{
|
||||
try
|
||||
{
|
||||
return new Account(rdr.GetString(0));
|
||||
new Account(rdr.GetString(0));
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -41,9 +40,9 @@ namespace NightmareCoreWeb2
|
||||
Console.WriteLine(e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public Account(string username)
|
||||
{
|
||||
MySqlConnection conn = new MySqlConnection(Program.connStr);
|
||||
|
||||
@ -66,11 +66,11 @@ namespace NightmareCoreWeb2
|
||||
this.LastModifiedTime = DateTimeOffset.FromUnixTimeSeconds(rdr.GetInt32(3)).UtcDateTime;
|
||||
if (rdr.GetInt32(4) != 0)
|
||||
{
|
||||
this.ClosedBy = Account.AccountByID(rdr.GetInt32(4));
|
||||
this.ClosedBy = new Account(rdr.GetInt32(4));
|
||||
}
|
||||
if (rdr.GetInt32(5) != 0)
|
||||
{
|
||||
this.AssignedTo = Account.AccountByID(rdr.GetInt32(5));
|
||||
this.AssignedTo = new Account(rdr.GetInt32(5));
|
||||
}
|
||||
this.Description = rdr.GetString(6);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user