Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }