Ejemplo n.º 1
0
        public ActionResult <ReminderInfoAddResModel> Manage_Reminder_Add(ReminderInfoAddViewModel reminderInfoAddViewModel)
        {
            int Node_Add_Count;

            Node_Add_Count = _IReminderInfoService.ReminderInfo_Add(reminderInfoAddViewModel);
            ReminderInfoAddResModel reminderInfoAddResModel = new ReminderInfoAddResModel();

            if (Node_Add_Count > 0)
            {
                reminderInfoAddResModel.IsSuccess                  = true;
                reminderInfoAddResModel.AddCount                   = Node_Add_Count;
                reminderInfoAddResModel.baseViewModel.Message      = "添加成功";
                reminderInfoAddResModel.baseViewModel.ResponseCode = 200;
                _ILogger.Information("增加催单信息成功");
                return(Ok(reminderInfoAddResModel));
            }
            else
            {
                reminderInfoAddResModel.IsSuccess                  = false;
                reminderInfoAddResModel.AddCount                   = 0;
                reminderInfoAddResModel.baseViewModel.Message      = "添加失败";
                reminderInfoAddResModel.baseViewModel.ResponseCode = 400;
                _ILogger.Information("增加催单信息失败");
                return(BadRequest(reminderInfoAddResModel));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 增加催单信息
        /// </summary>
        /// <param name="reminderInfoAddViewModel"></param>
        /// <returns></returns>
        public int ReminderInfo_Add(ReminderInfoAddViewModel reminderInfoAddViewModel)
        {
            var reminderInfo_Info = _IMapper.Map <ReminderInfoAddViewModel, Reminder_Info>(reminderInfoAddViewModel);

            _IReminderInfoRepository.Add(reminderInfo_Info);
            return(_IReminderInfoRepository.SaveChanges());
        }