public ActionResult TrainSchedule(int id)
        {
            ViewBag.stations = repositery.getStations();
            TrainStationDetailsmodel tsdm = new TrainStationDetailsmodel();

            tsdm.TemptblStationTrainDetaillist = repositery.GetTemptrainstation(id);
            ViewBag.TrainId = id;
            return(View(tsdm));
        }
        public ActionResult TrainSchedule(TrainStationDetailsmodel tstd)
        {
            ViewBag.stations = repositery.getStations();
            ViewBag.TrainId  = tstd.TemptblStationTrainDetail.TrainId;
            TrainStationDetailsmodel tsdm = new TrainStationDetailsmodel();

            if (ModelState.IsValid)
            {
                tblStationDetail tsd = new tblStationDetail();
                tsd = repositery.GetStationName(tstd.TemptblStationTrainDetail.StationCode);
                tstd.TemptblStationTrainDetail.StationName = tsd.StationName;
                tstd.TemptblStationTrainDetail.Status      = "Y";
                TemptblStationTrainDetail temp = new TemptblStationTrainDetail();
                temp = tstd.TemptblStationTrainDetail;
                repositery.ADDstationtraindetails(temp);
                tsdm.TemptblStationTrainDetaillist = repositery.GetTemptrainstation(tstd.TemptblStationTrainDetail.TrainId);
                ViewBag.TrainId = tstd.TemptblStationTrainDetail.TrainId;
                return(View(tsdm));
            }
            return(View(tstd));
        }