Esempio n. 1
0
 public List<StationDetail> GetAllStationDetails()
 {
     DataCenterDataContext dbContext = new DataCenterDataContext();
     var getAllStations = from stations in dbContext.StationDetails
                          select stations;
     return getAllStations.ToList();
 }
Esempio n. 2
0
 public StationDetail findStationById(int StationID)
 {
     DataCenterDataContext db = new DataCenterDataContext();
     StationDetail result = (from station in db.StationDetails
                  where station.STATION_ID == StationID
                  select station).Single();
     return result;
 }
Esempio n. 3
0
 public bool CreateStation(string StationName, string StationCode, string StationDescription)
 {
     StationDetail sd = new StationDetail
     {
         STATION_TITLE = StationName,
         STATION_CODE = StationCode,
         STATION_DESCRIPTION = StationDescription
     };
     DataCenterDataContext db = new DataCenterDataContext();
     db.StationDetails.InsertOnSubmit(sd);
     try
     {
         db.SubmitChanges();
         return true;
     }
     catch (Exception e)
     {
         return false;
     }
 }