Exemple #1
0
        public Activity CreateActivity(Activity activity)
        {
            using (var db = new CardsDb())
            {
                db.Activities.Add(activity);
                db.SaveChanges();

                return activity;
            }
        }
Exemple #2
0
        public static Activity Create(int cardId, int currentAreaId, CardChangeType changeType, string comments)
        {
            var db = DbFactory.Create();

            var activity = new Activity()
            {
                CardID = cardId,
                CurrentAreaID = currentAreaId,
                ChangeType = changeType,
                Comment = comments,
                StampDate = DateProvider.UtcNow()
            };

            return db.CreateActivity(activity);
        }