Exemplo n.º 1
0
        public string GetCurrentClickedRequestType2(long?requestTypeId)
        {
            if (requestTypeId == null)
            {
                return("");
            }
            var          requestTypeManager = new RequestTypeManager();
            const string seperator          = " ==> ";
            RequestType  requestType        = requestTypeManager.FirstOrDefault(p => p.RequestTypeID == requestTypeId);
            string       node = requestType.Title;

            if (requestType.ParentRequestType == null)
            {
                return(node);
            }
            RequestType type = requestType;

            requestType = requestTypeManager.FirstOrDefault(p => p.RequestTypeID == type.ParentRequestType);
            node        = requestType.Title + seperator + node;

            if (requestType.ParentRequestType == null)
            {
                return(node);
            }

            RequestType type2 = requestType;

            requestType = requestTypeManager.FirstOrDefault(p => p.RequestTypeID == type2.ParentRequestType);
            node        = requestType.Title + seperator + node;
            return(node);
        }
Exemplo n.º 2
0
        public List <RequestType> GetRequestTypeChildren(long requestTypeId)
        {
            var requestTypeManager = new RequestTypeManager();

            if (requestTypeId == 0)
            {
                return(GetQuery().ToList());
            }

            var request1 = GetQuery(p => p.RequestTypeID == requestTypeId).ToList();

            var child = requestTypeManager.GetQuery(p => p.ParentRequestType == requestTypeId);

            foreach (var item in child)
            {
                var x1 = GetQuery(p => p.RequestTypeID == item.RequestTypeID).ToList();
                request1.AddRange(x1);

                var nave = requestTypeManager.GetQuery(p => p.ParentRequestType == item.RequestTypeID);

                foreach (var item1 in nave)
                {
                    var x2 = base.GetQuery(p => p.RequestTypeID == item1.RequestTypeID).ToList();
                    request1.AddRange(x2);
                }
            }

            var x3 = request1.ToList();

            return(x3);
        }
Exemplo n.º 3
0
        public List <Request> GetRequestWithChildRequestType(DateTime?toDate, DateTime?fromDate, long requestTypeId)
        {
            var requestTypeManager = new RequestTypeManager();

            if (requestTypeId == 0)
            {
                return(GetQuery(r => r.InsertDate <= toDate && r.InsertDate >= fromDate).ToList());
            }

            var request1 = GetQuery(p => p.RequestTypeID == requestTypeId).ToList();

            var child = requestTypeManager.GetQuery(p => p.ParentRequestType == requestTypeId);

            foreach (var item in child)
            {
                var x1 = GetQuery(p => p.RequestTypeID == item.RequestTypeID).ToList();
                request1.AddRange(x1);

                var nave = requestTypeManager.GetQuery(p => p.ParentRequestType == item.RequestTypeID);

                foreach (var item1 in nave)
                {
                    var x2 = base.GetQuery(p => p.RequestTypeID == item1.RequestTypeID).ToList();
                    request1.AddRange(x2);
                }
            }

            var x3 = request1.ToList().Where(r => r.InsertDate <= toDate && r.InsertDate >= fromDate).ToList();

            return(x3);
        }