//Inserts file into db if not there yet //returns IDFile private int getORinsertIdFile(string file, int IdTask) { if (Convert.ToInt32(qta.FileExists(file)) == 0) { //Insert File taFiles.Insert(file); //Get IdFile taFiles1.FillByFileName(dtFiles1, file); int IdFile = dtFiles1[0].IdFile; //Insert IdTask and IdFile taR_taskFile.Insert(IdTask, IdFile); return(IdFile); } //Get old fileid taFiles1.FillByFileName(dtFiles1, file); return(dtFiles1[0].IdFile); }