/// <summary> /// 发送日程请求 /// </summary> /// <param name="appointmentId"></param> /// <param name="receiverUserID"></param> public void SendAppointmentInvition(long appointmentId, long receiverUserID) { AppointmentShareToUser share = new AppointmentShareToUser() { AppointmentId = appointmentId, IsAccepted = false, UserId = receiverUserID }; share_repo.Save(share); }
/// <summary> /// 拒绝日程邀请 /// </summary> /// <param name="appointmentId"></param> /// <param name="senderUserID"></param> /// <param name="receiverUserID"></param> public void DeclineAppointmentInvition(long appointmentId, long senderUserID, long receiverUserID) { AppointmentShareToUser share = share_repo.GetFirstOrDefaultObject(s => s.AppointmentId == appointmentId && s.UserId == receiverUserID && s.Appointment.CreatorId == senderUserID && !s.IsAccepted); if (share == null) { throw new Exception("日程请求信息不存在"); } share_repo.Delete(share); // TODO: 向用户发送消息 }
/// <summary> /// 拒绝日程邀请 /// </summary> /// <param name="appointmentId"></param> /// <param name="senderUserID"></param> /// <param name="receiverUserID"></param> public void DeclineAppointmentInvition(long appointmentId) { Account currentUser = Server.HttpContext.Session["Account"] as Account; AppointmentShareToUser share = share_repo.GetFirstOrDefaultObject(s => s.AppointmentId == appointmentId && s.UserId == currentUser.Id && !s.IsAccepted); if (share == null) { throw new Exception("日程请求信息不存在"); } share_repo.Delete(share); // TODO: 向用户发送消息 }