示例#1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //the login form just for test (user=abs pass=a)
            //Application.Run( new Form1() );

            //just to test: read an ini file
            //var inifile = new IniFile( "inifile.ini" );
            //inifile.Write( "aValue" , "100" );
            //var result = inifile.Read( "aValue" );
            //MessageBox.Show( result );

            //just to test: read a txt file
            var text = new textParser("info.txt", "first passphrase test");
            //var idRidden = text.Read();
            //MessageBox.Show(idRidden);

            //just to text: write a txt file
            var toWrite = "date= 3/4/5; result = nothing particular ; tag1=visitTag1; tag2=visitTag2; tag3=visitTag3;";

            text.Write(toWrite);

            //read al the folders in ROOT (each folder is a patient)
            FoldersHandler fh  = new FoldersHandler("ROOT");
            List <String>  lsf = fh.getSubFolders();

            //MessageBox.Show( lsf[0] );

            //Application.Run( new GridIndex( ap.getIndexFile() ) );
            Application.Run(new GridIndex());
        }
示例#2
0
        private void Save_Click(object sender, EventArgs e)//create a directory with a new patient and all the
        //possible related information
        {
            string newDirectory = "";

            if (thisP != null) // if you are simply going to modify this patient
            {
                newDirectory = thisP.getPath();
            }
            else // if this patient is new
            {
                newDirectory = "ROOT\\" + nextFreePatient();
            }
            Directory.CreateDirectory(newDirectory);

            string toInsert = "cd = 12345 ;name = " + nameText.Text.Trim() + "; surname = " + surnameText.Text.Trim() + "; date = "
                              + dateText.Text.Trim() + "; sex = " + sexText.Text.Trim() + "; notes = " + notesText.Text.Trim();

            int options = this.optionalsGrid.RowCount;

            for (int i = 0; i < options; i++)
            {
                toInsert += "; " + this.optionalsGrid.Rows[i].Cells[0].Value + " = ";
                toInsert += this.optionalsGrid.Rows[i].Cells[1].Value;
            }

            textParser tp = new textParser(newDirectory + "\\info.txt", "first passphrase test");

            tp.Write(toInsert);
            this.Refresh();
        }
示例#3
0
 public Visit(string path)
 {
     this.path          = path;
     listOfOptionalInfo = new List <OptionalInfo>();
     infoFile           = readInfoFile();
     text = new textParser(path + "\\" + infoFile, "first passphrase test");
     buildVisit();
 }
示例#4
0
 public Patient(string path)
 {
     this.path          = path;
     visits             = new List <Visit>();
     listOfOptionalInfo = new List <OptionalInfo>();
     infoFile           = getInfoFile();
     text = new textParser(path + "\\" + infoFile, "first passphrase test");
     buildPatient();
 }
示例#5
0
        private void buildOptionalFirst()
        {
            baseTags = new textParser("visitTemplate.txt", "");
            String readText = baseTags.Read();

            String[] bricks = splitter(readText, ';');
            for (int i = 0; i < bricks.Length; i++)
            {
                OptionalInfo newOI = new OptionalInfo(leftEqual(bricks[i]), rightEqual(bricks[i]));
                listOfOptionalInfo.Add(newOI);
            }
        }
示例#6
0
        private void buildOptionalFirst()
        {
            Char delimiterEqual = '=';

            baseTags = new textParser("patientTemplate.txt", "");
            String readText           = baseTags.Read();
            Char   delimiterSemicolon = ';';

            String [] bricks = readText.Split(delimiterSemicolon);
            for (int i = 0; i < bricks.Length; i++)
            {
                OptionalInfo newOI = new OptionalInfo(leftEqual(bricks[i]), rightEqual(bricks[i]));
                listOfOptionalInfo.Add(newOI);
            }
        }
示例#7
0
        private void addOptionalNew()// if the patient is new..
        {
            int indexRow = 0;

            baseTags = new textParser("patientTemplate.txt", "");
            String readText           = baseTags.Read();
            Char   delimiterSemicolon = ';';

            String[] bricks = splitter(readText, delimiterSemicolon);
            for (int i = 0; i < bricks.Length; i++)
            {
                this.optionalsGrid.Rows.Add();
                this.optionalsGrid.Rows[indexRow].Cells[0].Value = leftEqual(bricks[i]);
                indexRow++;
            }
        }
示例#8
0
        private void Save_Click(object sender, EventArgs e)
        {
            string newDirectory = path;

            Directory.CreateDirectory(newDirectory);

            string toInsert = "";

            for (int i = 0; i < this.Visits.Rows.Count; i++)
            {
                toInsert += this.Visits.Rows[i].Cells[0].Value + " = " + this.Visits.Rows[i].Cells[1].Value + ";";
            }
            textParser tp = new textParser(newDirectory + "\\info.txt", "first passphrase test");

            tp.Write(toInsert);
            MessageBox.Show("inserted in:" + newDirectory + "\\info.txt");
            this.Refresh();
        }
示例#9
0
        public static void writeToFile()
        {
            var text = new textParser("indexFile.txt", "second passphrase test");

            text.Write(indexFile);
        }