Ejemplo n.º 1
0
            /// <summary>
            /// special removal method for plain pipes, if there is only reference to pipe
            /// </summary>
            /// <param name="p">pipe to remove</param>
            /// <returns>status if pipe was removed from plain pipes list</returns>
            public bool Remove(SimplePipe p)
            {
                bool removed = false;

                for (int index = 0; index < this.Count; index++)
                {
                    if (p == (SimplePipe)this[index])
                    {
                        this.RemoveAt(index);
                        removed = true;
                        break;
                    }
                }
                return(removed);
            }
Ejemplo n.º 2
0
        public List <SimpleNote> SearchReleasesAllCreteria(string number, DateTime startDate, DateTime endDate, string pipeNumber, string railcar, string certificate, string reciver)
        {
            try
            {
                SimpleNote    note = null;
                SimpleRailcar car  = null;
                SimplePipe    pipe = null;

                var s = session.QueryOver <SimpleNote>(() => note)
                        .JoinAlias(() => note.Railcars, () => car, JoinType.LeftOuterJoin)
                        .JoinAlias(() => car.Pipes, () => pipe, JoinType.LeftOuterJoin)
                        .TransformUsing(Transformers.DistinctRootEntity);

                if (!string.IsNullOrWhiteSpace(pipeNumber))
                {
                    s.WhereRestrictionOn(() => pipe.Number).IsInsensitiveLike(pipeNumber, MatchMode.Start);
                }

                if (!string.IsNullOrWhiteSpace(railcar))
                {
                    s.WhereRestrictionOn(() => car.Number).IsInsensitiveLike(railcar, MatchMode.Start);
                }
                if (!string.IsNullOrWhiteSpace(number))
                {
                    s.WhereRestrictionOn(x => x.Number).IsInsensitiveLike(number, MatchMode.Start);
                }
                if (!string.IsNullOrWhiteSpace(certificate))
                {
                    s.WhereRestrictionOn(() => car.Certificate).IsInsensitiveLike(certificate, MatchMode.Start);
                }
                if (!string.IsNullOrWhiteSpace(reciver))
                {
                    s.WhereRestrictionOn(() => car.Destination).IsInsensitiveLike(reciver, MatchMode.Start);
                }
                if (startDate != DateTime.MinValue && endDate != DateTime.MinValue)
                {
                    s.WhereRestrictionOn(x => x.Date).IsBetween(startDate).And(endDate.AddHours(23).AddMinutes(59).AddSeconds(59));
                }
                var list = new List <SimpleNote>(s.List <SimpleNote>().OrderBy(x => x.Number));

                return(list);
            }
            catch (GenericADOException ex)
            {
                throw new RepositoryException("SearchReleasesAllCreteria", ex);
            }
        }
Ejemplo n.º 3
0
 private protected SimpleRespConnection()
 {
     _outBuffer = new SimplePipe();
     _inBuffer  = new SimplePipe();
 }
Ejemplo n.º 4
0
 private protected SimpleRespConnection(object?state) : base(state)
 {
     _outBuffer = new SimplePipe();
     _inBuffer  = new SimplePipe();
 }
Ejemplo n.º 5
0
 public void SaveOrUpdatePipe(SimplePipe pipe)
 {
     session.SaveOrUpdate(pipe);
 }
Ejemplo n.º 6
0
 public PlainPipe(SimplePipe p)
 {
     pipe = p;
 }