public ActionResult <RoomInformationAddResModel> Manage_Room_add(RoomInformationAddViewModel roomInformationAddViewModel) { int Room_Add_Count; RoomInformationAddResModel roomInformationAddResModel = new RoomInformationAddResModel(); Room_Add_Count = _RoomInformationService.Room_Add(roomInformationAddViewModel); if (Room_Add_Count > 0) { roomInformationAddResModel.IsSuccess = true; roomInformationAddResModel.AddCount = Room_Add_Count; roomInformationAddResModel.baseViewModel.Message = "添加成功"; roomInformationAddResModel.baseViewModel.ResponseCode = 200; _ILogger.Information("增添会议室信息成功"); return(Ok(roomInformationAddResModel)); } else { roomInformationAddResModel.IsSuccess = false; roomInformationAddResModel.AddCount = 0; roomInformationAddResModel.baseViewModel.Message = "添加失败"; roomInformationAddResModel.baseViewModel.ResponseCode = 200; _ILogger.Information("增添会议室信息失败"); return(Ok(roomInformationAddResModel)); } }
/// <summary> /// 增加会议室 /// </summary> /// <param name="departAddViewModel"></param> /// <returns></returns> public int Room_Add(RoomInformationAddViewModel roomInformationAddViewModel) { var meetingroom_information = _IMapper.Map <RoomInformationAddViewModel, MeetingRoom_Information>(roomInformationAddViewModel); meetingroom_information.IsDelete = "0"; meetingroom_information.Status = "0"; meetingroom_information.CreateDate = DateTime.Now; _IRoomInformationRepository.AddByNum(meetingroom_information); return(_IRoomInformationRepository.SaveChanges()); }