Exemplo n.º 1
0
        public ActionResult Edit(int?id)
        {
            var          datastation = _StationService.Get(id);
            StationParam station     = new StationParam(datastation);

            return(View(station));
        }
Exemplo n.º 2
0
 public virtual void Update(StationParam _stationparam)
 {
     this.Name       = _stationparam.Name;
     this.Districts  = _stationparam.Districts;
     this.UpdateBy   = "";//isi
     this.UpdateDate = DateTimeOffset.Now.LocalDateTime;
 }
Exemplo n.º 3
0
 public Station(StationParam _stationparam)
 {
     this.Name       = _stationparam.Name;
     this.Districts  = _stationparam.Districts;
     this.CreateBy   = "";//isi
     this.CreateDate = DateTimeOffset.Now.LocalDateTime;
 }
Exemplo n.º 4
0
 public ActionResult Edit(StationParam _stationparam)
 {
     if (ModelState.IsValid)
     {
         _StationService.Update(_stationparam);
         return(RedirectToAction("Index"));
     }
     return(View(_stationparam));
 }
Exemplo n.º 5
0
        public bool Insert(StationParam _stationparam)
        {
            var push = new Station(_stationparam);

            _context.Stations.Add(push);
            var result = _context.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
Exemplo n.º 6
0
        public bool Update(StationParam _stationparam)
        {
            var getStation = Get(_stationparam.Id);

            getStation.Update(_stationparam);
            _context.Entry(getStation).State = EntityState.Modified;
            var result = _context.SaveChanges();

            //_context.SaveCanges()==jumlah result yang terupdate
            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
Exemplo n.º 7
0
 public bool Update(StationParam _stationparam)
 {
     return(_istationrepository.Update(_stationparam));
 }
Exemplo n.º 8
0
 public bool Insert(StationParam _stationparam)
 {
     return(_istationrepository.Insert(_stationparam));
 }