コード例 #1
0
        public ActionResult CreateUserTask(UserPersonTaskDto model)
        {
            UpdateAuditInformation(model);
            DateTime scheduleStartTime = Convert.ToDateTime(model.ScheduleStartTimeString);
            DateTime scheduleEndTime   = Convert.ToDateTime(model.ScheduleEndTimeString);

            model.ScheduleStartTime = model.ScheduleStartDate.AddHours(scheduleStartTime.Hour).AddMinutes(scheduleStartTime.Minute);
            model.ScheduleEndTime   = model.ScheduleStartDate.AddHours(scheduleEndTime.Hour).AddMinutes(scheduleEndTime.Minute);
            var result = model.Id > 0 ? _employeeFacadeApiClient.PutUserTask(model.Id, model).Result :
                         _employeeFacadeApiClient.PostUserTask(model).Result;

            return(Json(new { message = "Task added to calendar successfully.", model.UserId, success = true }));
        }