public void Destroy(SessionViewModel db)
        {
            var entity = new Session_Table();

            entity.sessionID = db.sessionID;

            entities.Session_Table.Attach(entity);

            entities.Session_Table.Remove(entity);

            entities.SaveChanges();
        }
        public void Create(SessionViewModel db)
        {
            var entity = new Session_Table();

            entity.CaseID      = db.CaseID;
            entity.sessionDate = (DateTime)db.sessionDate.Date;

            entity.sessionResult          = HttpUtility.HtmlDecode(db.sessionResult);
            entity.sessionRecommendations = HttpUtility.HtmlDecode(db.sessionRecommendations);

            entities.Session_Table.Add(entity);
            entities.SaveChanges();

            db.sessionID = entity.sessionID;
        }
        public void Update(SessionViewModel db)
        {
            var entity = new Session_Table();

            entity.sessionID   = db.sessionID;
            entity.CaseID      = db.CaseID;
            entity.sessionDate = db.sessionDate.Date;


            entity.sessionResult          = HttpUtility.HtmlDecode(db.sessionResult);
            entity.sessionRecommendations = HttpUtility.HtmlDecode(db.sessionRecommendations);

            entities.Session_Table.Attach(entity);
            entities.Entry(entity).State = EntityState.Modified;
            entities.SaveChanges();
        }