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; }
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; }
public static int UpdateRouter(Router router) { int result = 0; try { result = DataAccessHelper.GetRouterDA().UpdateRouter(router); } catch (Exception ex) { throw ex; } return result; }