Пример #1
0
        // This function reads data from a file and return it as 'List<Process>'
        public List <Process> ReadFromFile(string filePath)
        {
            try {
                List <Process> processList = new List <Process>();

                using (StreamReader sr = new StreamReader(filePath))
                {
                    String line;

                    while ((line = sr.ReadLine()) != null)
                    {
                        string[]         tokenizedLine = new string[4];
                        Entities.Process proc          = new Entities.Process();

                        tokenizedLine = line.Split();

                        proc.ID             = Int32.Parse(tokenizedLine[0]);
                        proc.ArrivalTime    = int.Parse(tokenizedLine[1]);
                        proc.ProccesingTime = int.Parse(tokenizedLine[2]);
                        proc.Priority       = int.Parse(tokenizedLine[3]);

                        processList.Add(proc);
                    }
                }
                return(processList);
            }
            catch (Exception ex) { MessageBox.Show("Error reading file. File formating or parsing to integer error. \n\n" + ex); return(null); }
        }
Пример #2
0
 /// <summary>
 /// Powiązuje rodzaj procesu z błędemi
 /// </summary>
 /// <param name="process">proces do którego przypisany ma zostac błąd</param>
 /// <param name="errors">lista błędow do powiązania</param>
 /// <param name="delete">czy usunąć powiązanie? Tak jeśli <c>true</c>, nie w przeciwnym wypadku</param>
 /// <returns></returns>
 public bool BoundErrorWithProcess(Entities.Process process, List <Entities.Error> errors, bool delete = false)
 {
     return(wfsDao.BoundErrorWithProcess(this.getUser(), process, errors, delete));
 }
Пример #3
0
 public bool BoundErrorWithProcess(Entities.User user, Entities.Process process, List <Entities.Error> errors, bool delete = false)
 {
     return(manager.HPService.BoundErrorWithProcess(user, process, errors.ToArray(), delete));
 }