Exemplo n.º 1
0
        public ShortRequestWithAttachmentsList GetShortRequests(RequestsSearchFilter filter)
        {
            if (!authentificated)
            {
                throw new Exception();
            }

            if (LoginOfUser == null)
            {
                throw new Exception();
            }

            List <Request> res1 = filter.FiltredCollection(db.Requests).Where(i => (i.login_senderId == LoginOfUser || i.login_recieverId == LoginOfUser)).ToList();

            List <ShortRequestWithAttachments> res2 = res1.Select((x) =>
                                                                  new ShortRequestWithAttachments(x, db.AttachmentDatas.Where(i => i.RequestId == x.Id).Select((i) => new ShortAttachmentData()
            {
                id = i.id,
                AttachmentTypeId = i.AttachmentTypeId,
                FileName         = i.FileName,
                ordinalNumber    = i.ordinalNumber,
                RequestId        = i.RequestId
            }).ToList())).ToList().ToArray().Select(i => i).ToList();

            ShortRequestWithAttachmentsList result = new ShortRequestWithAttachmentsList();

            result.ShortRequestWithAttachments = res2;

            return(result);
        }
Exemplo n.º 2
0
        public List <RequestPanel> GetRequestsList(RequestsSearchFilter filter)
        {
            ShortRequestWithAttachmentsList requestsFromContractList = contract.GetShortRequests(filter);

            List <ShortRequestWithAttachments> requestsFromContract = requestsFromContractList.ShortRequestWithAttachments;

            var result = requestsFromContract.Select((x) =>
            {
                return(new RequestPanel(x, this));
            });

            return(result.ToList());
        }
Exemplo n.º 3
0
        public ShortRequestWithAttachmentsList GetShortRequests(RequestsSearchFilter filter)
        {
            ShortRequestWithAttachmentsList result = Channel.GetShortRequests(filter);

            return(result);
        }