Exemple #1
0
 public int InsertRouter(Router router)
 {
     int result = 0;
     try
     {
         String[] columns = {routerName, startPlace, destinationPlace, distance, description, status};
         Object[] values = {router.RouterName, router.StartPlace, router.DestinationPlace, router.Distance, router.Description, router.Status};
         result = DALBase.InsertTable(tableName, columns, values) ;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }
Exemple #2
0
 public int UpdateRouter(Router router)
 {
     int result = 0;
     try
     {
         String[] columnNames = { routerName, startPlace, destinationPlace, distance, description, status };
         Object[] values = { router.RouterName, router.StartPlace, router.DestinationPlace, router.Distance, router.Description, router.Status };
         String[] keyColumnNames = {routerId};
         Object[] keyColumnValues = {router.RouterID};
         result = DALBase.UpdateTable(tableName, columnNames, values, keyColumnNames, keyColumnValues);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }
Exemple #3
0
 public static int UpdateRouter(Router router)
 {
     int result = 0;
     try
     {
         result = DataAccessHelper.GetRouterDA().UpdateRouter(router);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }