Skip to content

Commit

Permalink
Merge branch 'master' of https://catalindumitru@github.com/catalindum…
Browse files Browse the repository at this point in the history
…itru/Proiect-AI-2012---GUI.git
  • Loading branch information
colin-dumitru committed Jan 5, 2012
2 parents 83bd630 + 5898c4f commit a810dd4
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
56 changes: 56 additions & 0 deletions WebServer/Data/ApelareModul.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;

namespace ApelareCelelalteModule
{
// numele clasei se poate schimba
// asta mi-a venit pe moment
public class ApelareModul
{
public int ObtineStatus(Stream fisierXML)
{
// se va cauta in baza de date fisierul
// si se va returna statusul
return 0;
}

public string ObtineTip(Stream fisierXML)
{
// se va cauta in baza de date
// si se va returna tipul
return "";
}

public Stream ObtineOutputul(Stream fisierXML)
{
// se cauta in baza de date
return null;
}

public Stream PrimesteCerere(Stream fisierXML)
{
int status = ObtineStatus(fisierXML);
if (status == 1) // verificam mai intai daca statusul este ok
// adica, daca s-a terminat parsarea si poate intoarce rezultatul
{
// se cauta in baza de date output.xml si se intoarce
return ObtineOutputul(fisierXML);
}
// else
string tip = ObtineTip(fisierXML);

if (tip == "summary")
{
// se seteaza statusul la 2 (parsing)
ClientThread ct = new ClientThread(fisierXML);
new Thread(new ThreadStart(ct.TrateazaCerere)).Start();
return null;
}
return null;
}
}
}
22 changes: 22 additions & 0 deletions WebServer/Data/ClientThread.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ApelareCelelalteModule
{
// Thread-ul in care se va trata cererea
public class ClientThread
{
private Stream fisierXML;
public ClientThread(Stream fisierXML)
{
this.fisierXML = fisierXML;
}
public void TrateazaCerere()
{
// se va trata cererea baza lui fisierXML
}
}
}

0 comments on commit a810dd4

Please sign in to comment.