public bool Delete(int Id) { bool isSaved = true; try { using (WTCCeresEntities d = new WTCCeresEntities()) { vs = d.VesselVoyageStatus.Find(Id); d.VesselVoyageStatus.Remove(vs); d.SaveChanges(); } } catch (Exception ex) { isSaved = false; } return(isSaved); }
public bool Update(int VesselId, string StatusName) { bool isSave = true; try { using (WTCCeresEntities db = new WTCCeresEntities()) { vs = db.VesselVoyageStatus.Find(VesselId); vs.StatusName = StatusName; db.VesselVoyageStatus.AddOrUpdate(vs); db.SaveChanges(); } } catch (Exception) { isSave = false; } return(isSave); }