예제 #1
0
        private IEnumerable <ActivityLogActivity> CreateDebugActivities()
        {
            List <ActivityLogActivity> activities = new List <ActivityLogActivity>();
            ActivityLogActivity        running    = new ActivityLogActivity()
            {
                ActivityId = 1, ActivityLogId = 1, Description = "Running"
            };
            ActivityLogActivity smoking = new ActivityLogActivity()
            {
                ActivityId = 2, ActivityLogId = 1, Description = "Not Smoking"
            };
            ActivityLogActivity meditation = new ActivityLogActivity()
            {
                ActivityId = 3, ActivityLogId = 1, Description = "Meditation"
            };
            ActivityLogActivity gym = new ActivityLogActivity()
            {
                ActivityId = 4, ActivityLogId = 1, Description = "Gym"
            };
            ActivityLogActivity coding = new ActivityLogActivity()
            {
                ActivityId = 5, ActivityLogId = 1, Description = "Coding Ammo"
            };

            activities.Add(running);
            activities.Add(smoking);
            activities.Add(meditation);
            activities.Add(gym);
            activities.Add(coding);

            return(activities);
        }
예제 #2
0
        public int AddUpdate(ActivityLogActivity Activity, string SessionUserId)
        {
            if (Activity == null || string.IsNullOrEmpty(SessionUserId))
            {
                return(0);
            }

            return(_activityRepository.AddUpdate(Activity, SessionUserId));
        }
예제 #3
0
        public ActionResult Create(int ActivityLogId)
        {
            ActivityLogActivity activity = new ActivityLogActivity()
            {
                ActivityLogId = ActivityLogId,
                Description   = ""
            };

            return(PartialView("_Create", activity));
        }
예제 #4
0
 public int AddUpdate(ActivityLogActivity Activity, string SessionUserId)
 {
     using (var connection = new SqlConnection(base.ConnectionString))
     {
         return(Task.FromResult(connection.ExecuteScalar <int>("spActivityLogActivityAddUpdate",
                                                               new
         {
             @ACTIVITYLOGACTIVITYID = Activity.ActivityId,
             @ACTIVITYLOGID = Activity.ActivityLogId,
             @DESCRIPTION = Activity.Description,
             @SESSIONUSERID = Guid.Parse(SessionUserId)
         },
                                                               null,
                                                               null,
                                                               CommandType.StoredProcedure)).Result);
     }
 }