private int CheckPerantEmail(string subject) { string emailRef = getBetween(subject, "{", "}"); int emailParentId; EmailRepository parentEmails = new EmailRepository(); if (!(emailRef == "")) { emailParentId = parentEmails.GetParentEmailId(emailRef); if (!(emailParentId == -1)) { return(emailParentId); } //else //{ // emailParentId = SearchSameSubject(subject); // if (!(emailParentId == -1)) // { // return emailParentId; // } //} } //else //{ // emailParentId = SearchSameSubject(subject); // if (!(emailParentId == -1)) // { // return emailParentId; // } //} return(-1); }