} // sendAlert private bool Escalate(MRequest request) { // Get Supervisor MUser supervisor = request.GetSalesRep(); // self int supervisor_ID = request.GetSalesRep().GetSupervisor_ID(); if ((supervisor_ID == 0) && (m_model.GetSupervisor_ID() != 0)) { supervisor_ID = m_model.GetSupervisor_ID(); } if ((supervisor_ID != 0) && (supervisor_ID != request.GetAD_User_ID())) { supervisor = MUser.Get(GetCtx(), supervisor_ID); } // Escalated: Request {0} to {1} String subject = Msg.GetMsg(m_client.GetAD_Language(), "RequestEscalate", new String[] { request.GetDocumentNo(), supervisor.GetName() }); String to = request.GetSalesRep().GetEMail(); if ((to == null) || (to.Length == 0)) { log.Warning("SalesRep has no EMail - " + request.GetSalesRep()); } else { m_client.SendEMail(request.GetSalesRep_ID(), subject, request.GetSummary(), request.CreatePDF()); } // Not the same - send mail to supervisor if (request.GetSalesRep_ID() != supervisor.GetAD_User_ID()) { to = supervisor.GetEMail(); if ((to == null) || (to.Length == 0)) { log.Warning("Supervisor has no EMail - " + supervisor); } else { m_client.SendEMail(supervisor.GetAD_User_ID(), subject, request.GetSummary(), request.CreatePDF()); } } // ---------------- request.SetDueType(); request.SetIsEscalated(true); request.SetResult(subject); return(request.Save()); } // escalate