Esempio n. 1
0
        public void Run(string runItem, string count)
        {
            checkIfExists = new CheckIfExists(_checkIfExistRepository);
            startTime     = new StartTime(_startTimeRepository, _pauseTimesRepository, _timeRepository, _dataForInLineTable);

            foreach (DataRow row in _startAllOperations.Operations(runItem).Rows)
            {
                isBusyCheck = new IsBusyCheck(_isBusyCheckRepository);

                if (isBusyCheck.GetOperationBool(row["OperationId"].ToString()) == false)
                {
                    startTime.AddStartTime(row, count);
                    _operationConditionRepository.OperationIsBusy(runItem, row["OperationId"].ToString());
                }
                else
                {
                    if (checkIfExists.IfInLineItemExists(runItem, row["OperationId"].ToString()) == false)
                    {
                        startTime.AddInLineStartTime(row, count);
                    }
                    else
                    {
                        startTime.AddInLineStartTimeIfEntryExist(row, count);
                    }
                }
            }
        }
Esempio n. 2
0
        public static string ReplaceMultiple(string fmt, NameValueCollection tags, string unique_key, CheckIfExists exists, int maxLen)
        {
            string result = ReplaceMultiple(fmt, tags, maxLen);

            if (result == String.Empty || result == null)
            {
                return(result);
            }
            int unique = 1;

            try
            {
                while (exists(result))
                {
                    var oldkey = tags[unique_key];
                    tags[unique_key] = unique.ToString();
                    string new_result = ReplaceMultiple(fmt, tags, maxLen);
                    if ((new_result == result && oldkey != tags[unique_key]) || new_result == String.Empty || new_result == null)
                    {
                        break;
                    }
                    result = new_result;
                    unique++;
                }
            }
            catch { }
            return(result);
        }
Esempio n. 3
0
 public static string ReplaceMultiple(string fmt, NameValueCollection tags, string unique_key, CheckIfExists exists, int maxLen)
 {
     string result = ReplaceMultiple(fmt, tags, maxLen);
     if (result == String.Empty || result == null)
         return result;
     int unique = 1;
     try
     {
         while (exists(result))
         {
             tags[unique_key] = unique.ToString();
             string new_result = ReplaceMultiple(fmt, tags, maxLen);
             if (new_result == result || new_result == String.Empty || new_result == null)
                 break;
             result = new_result;
             unique++;
         }
     }
     catch { }
     return result;
 }
Esempio n. 4
0
        public static string ReplaceMultiple(string fmt, NameValueCollection tags, string unique_key, CheckIfExists exists, int maxLen)
        {
            string result = ReplaceMultiple(fmt, tags, maxLen);

            if (result == String.Empty || result == null)
            {
                return(result);
            }
            // Album titles can contain three periods at the end.
            // Remove "...\" from the DirectoryName to retain the behavior as in CUETools 2.1.7
            if (result.Contains("...\\"))
            {
                result = result.Replace("...\\", "\\");
            }
            int unique = 1;

            try
            {
                while (exists(result))
                {
                    var oldkey = tags[unique_key];
                    tags[unique_key] = unique.ToString();
                    string new_result = ReplaceMultiple(fmt, tags, maxLen);
                    if (new_result.Contains("...\\"))
                    {
                        new_result = new_result.Replace("...\\", "\\");
                    }
                    if ((new_result == result && oldkey != tags[unique_key]) || new_result == String.Empty || new_result == null)
                    {
                        break;
                    }
                    result = new_result;
                    unique++;
                }
            }
            catch { }
            return(result);
        }