public bool CreateRequest(Request request) { //TODO try catch XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; settings.IndentChars = "\t"; using (XmlWriter writer = XmlWriter.Create(GetXmlFileName(request.getId()), settings)) { writer.WriteStartDocument(); writer.WriteStartElement("request"); writer.WriteAttributeString("id", request.getId()); writer.WriteElementString("state", request.getState()); writer.WriteElementString("owner", request.getOwner()); writer.WriteElementString("subject", request.getSubject()); writer.WriteElementString("text", request.getText()); writer.WriteEndElement(); writer.WriteEndDocument(); } return true; }
public bool requestSubmission(Request newRequest, String neptun_code) { bool user = userHandler.AppendRequest(neptun_code, newRequest.getId()); bool request = requestHandler.CreateRequest(newRequest); return user && request; }