private JassActivityHistory ActivitySaveHistory(JassActivity activity, JassActivityReview review)
 {
     JassActivityHistory activityHistory = new JassActivityHistory();
     var mapper = new JassCommonAttributesMapper<JassActivityCommon, JassActivity, JassActivityHistory>();
     mapper.map(activity, activityHistory);
     activityHistory.JassActivityID = activity.JassActivityID;
     activityHistory.JassActivityReviewID = review.JassActivityReviewID;
     ActivityHistoryCreate(activityHistory);
     return activityHistory;
 }
 public void ActivityHistorySave(JassActivityHistory ActivityHistory)
 {
     checkIfMine(ActivityHistory);
     _db.Entry(ActivityHistory).State = EntityState.Modified;
     _db.SaveChanges();
 }
        public JassActivityHistory ActivitySaveIfNew(JassActivity activity)
        {
            var resultActivityHistory = new JassActivityHistory();

            JassActivity activityCurrent = _db.JassActivities.Find(activity.JassActivityID);

            if (activityCurrent != null)
            {
                if (IfMine(activityCurrent))
                {
                    if (activity.LastUpdated > activityCurrent.LastUpdated)
                    {
                        resultActivityHistory = ActivitySave(activity, true);
                    }
                }
            }

            return resultActivityHistory;
        }
        public int ActivityHistoryCreate(JassActivityHistory ActivityHistory)
        {
            _db.JassActivityHistories.Add(ActivityHistory);
            ActivityHistory.UserName = _username;
            ActivityHistory.TimeStamp= DateTime.Now;
            ActivityHistory.Created = DateTime.Now;
            ActivityHistory.LastUpdated = DateTime.Now;

            _db.SaveChanges();
            return ActivityHistory.JassActivityHistoryID;
        }