partial void DeleteTrainScheduleDetail(TrainScheduleDetail instance);
partial void UpdateTrainScheduleDetail(TrainScheduleDetail instance);
partial void InsertTrainScheduleDetail(TrainScheduleDetail instance);
private void detach_TrainScheduleDetails(TrainScheduleDetail entity) { this.SendPropertyChanging(); entity.TrainDetail = null; }
private void attach_TrainScheduleDetails(TrainScheduleDetail entity) { this.SendPropertyChanging(); entity.StationDetail = this; }
public string Insert(int TrainID, int Distance, int StationCode, string ArrivalTime, string DepartureTime) { var select = from obj in db.TrainScheduleDetails where obj.TRAIN_ID == TrainID select obj; if (select.Any()) return "Station already exits"; TrainScheduleDetail tsd = new TrainScheduleDetail { TRAIN_ID = TrainID, TSD_DISTANCE = Distance, TSD_STATION_CODE = StationCode, TSD_ARRIVAL_TIME = ToTimeSpan(ArrivalTime), TSD_DEPARTURE_TIME = ToTimeSpan(DepartureTime) }; db.TrainScheduleDetails.InsertOnSubmit(tsd); try { db.SubmitChanges(); return Constants.INSERT_SUCCESS; } catch (Exception ex) { return ex.Message; } }