Beispiel #1
0
        public async Task <ActionResult> updateActivity(string activityId, string activityName, string avtivityPeople, string avtivityDescription, string avtivityDate)
        {
            Dictionary <string, string> newData = new Dictionary <string, string>();

            newData.Add("ActivityName", activityName);
            newData.Add("NumberOfPeople", avtivityPeople);
            newData.Add("ActivityNote", avtivityDescription);
            newData.Add("ActivityDate", avtivityDate);
            await _databaseSystem.UpdateActivity(activityId, newData);

            return(Json(new { success = true, responseText = "更新成功" }, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public async Task UpdateActivityTest()
        {
            DatabaseSystem databaseSystem         = new DatabaseSystem();
            Dictionary <string, string> testValue = new Dictionary <string, string>();

            testValue.Add("ActivityId", "99");
            testValue.Add("ActivityName", "unitTest2");
            testValue.Add("HomeOwnerId", "unitTest1");
            testValue.Add("ActivityDate", "1998/02/11");
            testValue.Add("ActivityNote", "unitTest");
            testValue.Add("NumberOfPeople", "3");

            var result = await databaseSystem.UpdateActivity("99", testValue);

            await databaseSystem.Delete("99", "Activity");

            Assert.IsTrue(result);
        }