Esempio n. 1
0
        private void FillGrids()
        {
            List<vwvwProjectFile> listOfFiles = new List<vwvwProjectFile>();
            vwvwProjectFileDap newDap = new vwvwProjectFileDap();
            listOfFiles = newDap.GetProjectFiles(_tblProject.fldProjectID);
            bsFiles.DataSource = listOfFiles;

            List<tblTask> listOfTasks = new List<tblTask>();
            tblTaskDap newTaskDap = new tblTaskDap();
            listOfTasks = newTaskDap.GetByfldProjectID(_tblProject.fldProjectID);
            bsTasks.DataSource = listOfTasks;

            List<tblEmployee> listOfEmployees = new List<tblEmployee>();
            tblEmployeeDap newEmployeeDap = new tblEmployeeDap();
            listOfEmployees = newEmployeeDap.GetAll();
            bsEmployee.DataSource = listOfEmployees;
        }
Esempio n. 2
0
        private void frmErga_Single_DragDrop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                string[] filePaths = (string[])(e.Data.GetData(DataFormats.FileDrop));
                foreach (string fileLoc in filePaths)
                {
                    // Code to read the contents of the text file
                    if (File.Exists(fileLoc))
                    {
                        using (TextReader tr = new StreamReader(fileLoc))
                        {
                            tblFileDap newDap = new tblFileDap();
                            long fldFileId = newDap.InsertFile(fileLoc, 1, DateTime.Now);
                            tblProjectFileDap newProjectFileDap = new tblProjectFileDap();
                            tblProjectFile ProjectFile = new tblProjectFile();
                            ProjectFile.fldFileID = fldFileId;
                            ProjectFile.fldProjectID = _tblProject.fldProjectID;
                            newProjectFileDap.Insert(ProjectFile);

                            List<vwvwProjectFile> listOfFiles = new List<vwvwProjectFile>();
                            vwvwProjectFileDap ProjectFileDap = new vwvwProjectFileDap();
                            listOfFiles = ProjectFileDap.GetProjectFiles(_tblProject.fldProjectID);
                            bsFiles.DataSource = listOfFiles;
                        }
                    }

                }
            }
        }