public Int64 Save([FromBody] EBugComment eBugComment) { if (eBugComment.id < 1) { eBugComment.creationDateUTC = DateTime.UtcNow; eBugComment.comment = eBugComment.comment.Trim(); } Int64 bugCommentID = table.Save(eBugComment); SBugTrackingService sBugTrackingService = SDefines.ApplicationContainer.Resolve <SBugTrackingService>(); EBug eBug = sBugTrackingService.GetByID(eBugComment.bugID); // //se o comentário é criado pelo bdchain, enviamos um email ao criador do erro. // //se o comentario é adicionado pelo criador do erro, enviamos um email ao [email protected] // SCompanyUsers sCompanyUsers=new SCompanyUsers(); // ECompanyUser eCreatorUser = sCompanyUsers.GetByID(eBug.companyUserID); // ECompanyUser eCommentUser= sCompanyUsers.GetByID(eBugComment.companyUserID); // if (eCommentUser.email == "*****@*****.**" && eCreatorUser.email != eCommentUser.email) { // //comentario criado por mim. vamos enviar email ao criador do bug // await SEmail.SendEmail(eCreatorUser.email, "New Bug Comment", "You have a new comment on bug " + eBug.id); // }else if (eCommentUser.email != "*****@*****.**") { // //comentario nao criado por mim. Vamos enviar um email pra mim. // await SEmail.SendEmail("*****@*****.**", "New Bug Comment", "You have a new comment on bug " + eBug.id); // } return(bugCommentID); }
public EBugComment GetByID(Int64 id) { EBugComment eBug = table.SelectByID <EBugComment>(id); eBug.comment = eBug.comment.Trim(); return(eBug); }