예제 #1
0
 partial void DeleteTrainScheduleDetail(TrainScheduleDetail instance);
예제 #2
0
 partial void UpdateTrainScheduleDetail(TrainScheduleDetail instance);
예제 #3
0
 partial void InsertTrainScheduleDetail(TrainScheduleDetail instance);
예제 #4
0
		private void detach_TrainScheduleDetails(TrainScheduleDetail entity)
		{
			this.SendPropertyChanging();
			entity.TrainDetail = null;
		}
예제 #5
0
		private void attach_TrainScheduleDetails(TrainScheduleDetail entity)
		{
			this.SendPropertyChanging();
			entity.StationDetail = this;
		}
예제 #6
0
        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;
            }
        }