Пример #1
0
        public void ReplyToPartnerCall(Guid partnerCallID, Guid replyingUserID, string message)
        {
            PartnerCall call = new PartnerCallDA().GetByID(partnerCallID);

            if (call.CreatorUserID == replyingUserID)
            {
                throw new Exception(string.Format("You cannot reply to your own partner call. call[{0}]", call.ID));
            }

            PartnerCallReply reply = new PartnerCallReplyDA().Insert(new PartnerCallReply
            {
                ID             = Guid.NewGuid(),
                ReplyDateTime  = DateTime.Now,
                ReplyingUserID = replyingUserID,
                PartnerCallID  = partnerCallID,
                Message        = message
            });

            ClimberProfile poster  = CFDataCache.GetClimberFromCache(call.ClimberProfileID);
            ClimberProfile replyer = CFDataCache.GetClimberFromCache(replyingUserID);

            MailMan.SendReplyToPartnerCall(call, reply, replyer, replyer.Email, poster.Email);

            CFLogger.RecordPartnerCallReply(replyingUserID, partnerCallID);
        }