public void SaveActivityLog(ActivityLog activitylog)
 {
     if (activitylog.ActivityLogId == 0)
     {
         context.ActivityLogs.Add(activitylog);
     }
     context.SaveChanges();
 }
        public ActionResult Edit(ActivityLog activitylog)
        {
            if (ModelState.IsValid)
            {
                // save the activitylog
                repository.SaveActivityLog(activitylog);
                // add a message to the viewbag
                TempData["message"] = string.Format("{0} has been saved", activitylog.Activity);

                return RedirectToAction("Index");
            }
            else
            {
                // there is something wrong with the data values
                return View(activitylog);
            }
        }
 public void DeleteActivityLog(ActivityLog activitylog)
 {
     context.ActivityLogs.Remove(activitylog);
     context.SaveChanges();
 }