public static void Save(NewAccount NewAccount) { List <OleDbParameter> Params = new List <OleDbParameter> { }; if (NewAccount.User.UserId != 0) { Params.Add(new OleDbParameter("UserID", NewAccount.User.UserId)); } Init.SQLi.Execute(@"INSERT INTO Account (Balance,UserID) VALUES (0,@UserID);", Params); }
public string TwitchId = "", DiscordId = ""; // Create propertys to replicate the tables collumns public static void Save(NewUser NewUser) { List <OleDbParameter> Params = new List <OleDbParameter> { new OleDbParameter("TwitchID", NewUser.TwitchId), new OleDbParameter("DiscordID", NewUser.DiscordId) }; Init.SQLi.Execute(@"INSERT INTO UserData (TwitchID,DiscordID) VALUES (@TwitchID,@DiscordID)", Params); NewAccount NewAccount = new NewAccount(); NewAccount.Balance = 0; NewAccount.User = User.FromNewUser(NewUser); NewAccount.Save(NewAccount); }