public bool UpdateIsActive(int VesselId, bool isActive) { bool isSave = true; try { v = db.Vessel.Find(VesselId); v.IsActiveVessel = isActive; db.Vessel.Attach(v); db.Entry(v).Property(p => p.IsActiveVessel).IsModified = true; db.SaveChanges(); } catch (Exception ex) { string msg = ex.ToString(); isSave = false; } return(isSave); }
public bool SuspendTruckDriver(int TruckDriverId, bool Suspendy) { bool isSave = true; try { td = db.TruckDriver.Find(TruckDriverId); td.SuspendTruckDriver = Suspendy; db.TruckDriver.Attach(td); db.Entry(td).Property(p => p.SuspendTruckDriver).IsModified = true; db.SaveChanges(); } catch (Exception ex) { string msg = ex.ToString(); isSave = false; } return(isSave); }