public static void CreateTable(SQLiteConnection connection) { using (SQLiteCommand command = connection.CreateCommand()) { DBFixtureBeingUsedAreaCommands.CreateTable(command); command.ExecuteNonQuery(); } }
public static long InsertRow(SQLiteConnection connection, ref FixtureBeingUsedAreaModel model) { using (SQLiteCommand command = connection.CreateCommand()) { DBFixtureBeingUsedAreaCommands.InsertRow(model, command); long check = command.ExecuteNonQuery(); if (check == 1) { model.ID = connection.LastInsertRowId; return(model.ID); } else if (check == 0) { throw new Exception("DBFixtureBeingUsed -> insertRow -> No Row is inserted."); } throw new Exception("DBFixtureBeingUsed -> insertRow -> Row insertion not successful."); } }
public static long UpdateRow(SQLiteConnection connection, FixtureBeingUsedAreaModel model) { using (SQLiteCommand command = connection.CreateCommand()) { DBFixtureBeingUsedAreaCommands.UpdateRow(command, model); long check = command.ExecuteNonQuery(); if (check == 1) { model.ID = connection.LastInsertRowId; return(model.ID); } else if (check == 0) { //throw new Exception("FixtureBeingUsedAreaModel -> UpdateRow -> No Row is Updated."); } throw new Exception("FixtureBeingUsedAreaModel -> UpdateRow -> Insert Not Successful."); } }