Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        public bool requestSubmission(Request newRequest, String neptun_code)
        {
            bool user = userHandler.AppendRequest(neptun_code, newRequest.getId());
            bool request = requestHandler.CreateRequest(newRequest);
            return user && request;

        }