示例#1
0
 public static void CreateTable(SQLiteConnection connection)
 {
     using (SQLiteCommand command = connection.CreateCommand())
     {
         DBFixtureBeingUsedAreaCommands.CreateTable(command);
         command.ExecuteNonQuery();
     }
 }
示例#2
0
 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.");
     }
 }
示例#3
0
 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.");
     }
 }