Beispiel #1
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();
        }
Beispiel #2
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());
        }
Beispiel #3
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();
        }
Beispiel #4
0
        public static void writeToFile()
        {
            var text = new textParser("indexFile.txt", "second passphrase test");

            text.Write(indexFile);
        }