/// <summary> /// Delete this Operation from the database /// </summary> /// <returns></returns> public int Delete() { // First remove the reference to the Operation from the database OperationsDAO lwDataAccess = new OperationsDAO(); lwDataAccess.OperationDelete(this); return(0); }
/// <summary> /// Add a new Operation to the database (or possibly update an existing item) /// </summary> /// <returns></returns> public int Add() { OperationsDAO lwDataAccess = new OperationsDAO(); if (OperationID == 0) { OperationID = lwDataAccess.OperationAdd(this); } else { lwDataAccess.OperationUpdate(this); } return(0); }
public int Populate(Operation.OPERATION operationType, Operation.STATUS status) { // Ensure that the list is empty initially this.Clear(); OperationsDAO lwDataAccess = new OperationsDAO(); DataTable table = lwDataAccess.EnumerateOperations(operationType, status); // Iterate through the returned rows in the table and create AssetType objects for each foreach (DataRow row in table.Rows) { AddOperation(row); } return(this.Count); }