コード例 #1
0
        public async Task <dynamic> GetDocPropIdentityForSelectedDocTypes(string _OwnerID, string _DocCategoryID,
                                                                          string _DocTypeID, string _DocPropertyID, string _SearchBy)
        {
            List <DocSearch> lstDocSearch = null;

            if (!string.IsNullOrEmpty(_OwnerID) && !string.IsNullOrEmpty(_DocCategoryID) && !string.IsNullOrEmpty(_DocTypeID) && !string.IsNullOrEmpty(_DocPropertyID) && !string.IsNullOrEmpty(_SearchBy))
            {
                await Task.Run(() => _originalDocSearchingService.GetOriginalDocBySearchParam(_OwnerID, _DocCategoryID, _DocTypeID, _DocPropertyID, _SearchBy, UserID, out lstDocSearch));
            }

            var result = (from r in lstDocSearch
                          group r by new
            {
                r.DocumentID,
                r.DocDistributionID
            }
                          into g

                          select new
            {
                DocumentID = g.Key.DocumentID,
                MetaValue = String.Join(", ", g.Select(o => o.MetaValue)),
                DocPropIdentifyID = String.Join(",", g.Select(o => o.DocPropIdentifyID).Distinct()),
                DocPropIdentifyName = String.Join(",", g.Select(o => o.DocPropIdentifyName).Distinct()),
                FileServerURL = g.Select(o => o.FileServerURL).FirstOrDefault(),
                ServerIP = g.Select(o => o.ServerIP).FirstOrDefault(),
                ServerPort = g.Select(o => o.ServerPort).FirstOrDefault(),
                FtpUserName = g.Select(o => o.FtpUserName).FirstOrDefault(),
                FtpPassword = g.Select(o => o.FtpPassword).FirstOrDefault(),
                DocDistributionID = g.Select(o => o.DocDistributionID).FirstOrDefault()
            }).ToList();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public async Task <dynamic> GetDocPropIdentityForSelectedDocTypes(string _OwnerID, string _DocCategoryID, string _DocTypeID, string _DocPropertyID, string _SearchBy)
        {
            List <DocSearch> lstDocSearch = null;

            if (!string.IsNullOrEmpty(_OwnerID) && !string.IsNullOrEmpty(_DocCategoryID) && !string.IsNullOrEmpty(_DocTypeID) && !string.IsNullOrEmpty(_DocPropertyID) && !string.IsNullOrEmpty(_SearchBy))
            {
                await Task.Run(() => _originalDocSearchingService.GetOriginalDocBySearchParam(_OwnerID, _DocCategoryID, _DocTypeID, _DocPropertyID, _SearchBy, _userId, out lstDocSearch));
            }

            var result = (from r in lstDocSearch
                          select new
            {
                DocMetaID = r.DocMetaID,
                DocumentID = r.DocumentID,
                DocPropIdentifyID = r.DocPropIdentifyID,
                DocPropIdentifyName = r.DocPropIdentifyName,
                MetaValue = r.MetaValue,
                VersionMetaValue = "",
                DocPropertyID = r.DocPropertyID,
                DocPropertyName = r.DocPropertyName,
                FileServerURL = r.FileServerURL,
                ServerIP = r.ServerIP,
                ServerPort = r.ServerPort,
                FtpUserName = r.FtpUserName,
                FtpPassword = r.FtpPassword
            }).ToList();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }