Exemplo n.º 1
0
        public static ICollection <Tote> GetAllTotesByType(IUnitOfWork uow, ToteType type)
        {
            BinaryOperator criteria = new BinaryOperator("ToteType", type);

            return(Repository
                   .GetList <Tote>(uow)
                   .ByCriteria(criteria));
        }
Exemplo n.º 2
0
        public static string Next(ToteType type)
        {
            ICollection <Tote> totes =
                AreaRepository.GetAllTotesByType(Scout.Core.Data.GetUnitOfWork(), type);
            int largestId = -1;

            foreach (Tote tote in totes)
            {
                int    nextNumber = -1;
                string toteNumber = "";
                string toteLabel  = tote.Label.Trim();

                int spaceIndex   = toteLabel.IndexOf(" ");
                int numberLength = toteLabel.Length - (spaceIndex + 1);

                toteNumber = toteLabel.Substring
                             (
                    spaceIndex + 1,
                    numberLength
                             );

                Int32.TryParse(toteNumber, out nextNumber);

                if (largestId == -1 || nextNumber > largestId)
                {
                    largestId = nextNumber;
                }
            }

            if (largestId > -1)
            {
                largestId += 1;
                return(largestId.ToString());
            }

            return("1");
        }
Exemplo n.º 3
0
 public ToteCreateCommandArguments(IUnitOfWork unitOfWork, ToteType toteType)
 {
     m_unitOfWork = unitOfWork;
     m_toteType   = toteType;
 }