Exemplo n.º 1
0
        public static void ProcessRequest(PageRequest request)
        {
            if (request.Domain == null) return;
            var site = _sitesRepository.GetById(request.SiteId);
            var pages = _pagesRepository.GetPagesBySiteId(request.SiteId);
            //if (!request.Domain.EndsWith(site.Domain, StringComparison.InvariantCultureIgnoreCase)) return;

            var regex = "[a-z_.-]*";
            var pattern = site.Domain.Replace("*", regex);

            if (site.ContainsSubdomains)
            {
                pattern = @"([a-z_-]+\.)?" + pattern;
            }
            else
            {
                pattern = @"(www\.)?" + pattern;
            }

            var match = Regex.Match(request.Domain, pattern);
            if (match == null || !match.Success) return;

            request.ParentDomain = request.Domain;

            if (match.Groups.Count == 2 && match.Groups[1].Success)
            {
                request.ParentDomain = request.ParentDomain.Substring(match.Groups[1].Length);
            }

            request.ParentDomain = request.ParentDomain ?? "dummy";

            var page = pages.FirstOrDefault(i => i.Check(request.Url));
            if (page != null) request.PageId = page.Id;
        }
Exemplo n.º 2
0
        protected override void OnSendRequest(PageRequest request)
        {
            RequestHelper.ProcessRequest(request);

            //if (request.Id == default(Guid)) _requestsRepository.Create(request);
            _streamInsightCore.PingInputService.PushEvent(request);
        }
 public ContentItem(PageRequest page, SimpleUri originalUrl)
 {
     PageRequest = page;
     OriginalUrl = originalUrl;
     MimeType = "";
     IsDojoJQuery = originalUrl != null &&
         (originalUrl.ToString().EndsWith("/jquery-1.3.2.js") ||
         originalUrl.ToString().EndsWith("/jquery-1.3.2.min.js") ||
         originalUrl.ToString().EndsWith("/jquery.js") ||
         originalUrl.ToString().Contains("/dojo/") && originalUrl.ToString().EndsWith(".js"));
 }
Exemplo n.º 4
0
 public IDictionary<string, Silanis.ESL.SDK.Sender> GetSenders(Direction direction, PageRequest request)
 {
     Silanis.ESL.API.Result<Silanis.ESL.API.Sender> apiResponse = apiClient.GetSenders(direction, request);
     
     IDictionary<string, Silanis.ESL.SDK.Sender> result = new Dictionary<string, Silanis.ESL.SDK.Sender>();
     foreach ( Silanis.ESL.API.Sender apiSender in apiResponse.Results ) {
         result.Add(apiSender.Email, new SenderConverter( apiSender ).ToSDKSender() );
     }
     
     return result;
 }
Exemplo n.º 5
0
 public PageResult<UserDto> Search(UserSearchCriteria criteria, PageRequest request)
 {
     using (var db = base.NewDB())
     {
         return db.Users
             .WhereByTagId(criteria.TagId)
             .WhereByKeyword(criteria.Keyword)
             .ToDtos()
             .ToPageResult(request)
             .Build(db);
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// Get the list of account custom fields.
        /// </summary>
        /// 
        /// <returns>The list of custom fields</returns>
        /// <param name="direction">Direction of retrieved list to be sorted in ascending or descending order by id</param>
        /// <param name="request">Identifying which page of results to return.</param>
        public IList<CustomField> GetCustomFields(Direction direction, PageRequest request)
        {
            IList<Silanis.ESL.API.CustomField> apiCustomFieldList = apiClient.GetCustomFields(direction, request);

            IList<Silanis.ESL.SDK.CustomField> result = new List<Silanis.ESL.SDK.CustomField>();
            foreach (Silanis.ESL.API.CustomField apiCustomField in apiCustomFieldList)
            {
                result.Add(new CustomFieldConverter(apiCustomField).ToSDKCustomField());
            }

            return result;
        }
Exemplo n.º 7
0
 /// <summary>
 /// 添加一条页面访问记录
 /// </summary>
 /// <param name="pageRequest"></param>
 public int AddPageRequest(PageRequest pageRequest)
 {
     string sql = string.Format(
        "INSERT INTO [LiveSupport].[dbo].[LiveChat_PageRequest]"
        + "([AccountId]"
        + " ,[SessionId]"
        + " ,[Page]"
        + " ,[RequestTime]"
        + " ,[Referrer])"
        + "VALUES('{0}','{1}','{2}','{3}','{4}')"
        , pageRequest.AccountId, pageRequest.SessionId, pageRequest.Page, pageRequest.RequestTime, pageRequest.Referrer);
        return  DBHelper.ExecuteCommand(sql);
 }
Exemplo n.º 8
0
        public RequestSessionGroup(PageRequest element, List<PageRequest> other)
        {
            Domain = element.Domain;
            Url = element.Url;
            IpAddress = element.IpAddress;
            Browser = element.Browser;
            Duration = element.Duration;
            Id = element.Id;
            SessionIdentifier = element.SessionIdentifier;
            SiteId = element.SiteId;
            UserId = element.UserId;

            AditionalRequests = other;
        }
 public void HandleNewPageRequest(string url)
 {
     m_InitialPage = new PageRequest();
     m_InitialPage.Location = new SimpleUri(url);
     m_InitialPage.Date = DateTime.Now;
     if (PageRequested != null)
         PageRequested(this, new CustomEventArgs<PageRequest>(m_InitialPage));
 }
Exemplo n.º 10
0
 public async Task <PageList <MultiTenantOutPutPageDto> > GetLoadPageAsync([FromBody] PageRequest request)
 {
     return((await _multiTenantContract.GetLoadPageAsync(request)).PageList());
 }
Exemplo n.º 11
0
 public async Task <PageList <UserOutputPageListDto> > GetUserPageAsync([FromBody] PageRequest request)
 {
     return((await _userService.GetUserPageAsync(request)).ToPageList());
 }
        public List<Product> SearcProducts(string fts, string catId, string brandFilterID, string retailerFilterID,
            string priceFilterId, string discountFilterId, string productSetName)
        {
            var query = new ProductQuery();
            if (!string.IsNullOrEmpty(fts))
                query.withFreeText(fts);
            if (!string.IsNullOrEmpty(catId))
                query.withCategory(catId); // Category jackets
            if (!string.IsNullOrEmpty(brandFilterID))
                query.withFilter(brandFilterID); // Brand filter id
            if (!string.IsNullOrEmpty(retailerFilterID))
                query.withFilter(retailerFilterID);// Retailer filter id
            if (!string.IsNullOrEmpty(priceFilterId))
                query.withFilter(priceFilterId); // Price filter id
            if (!string.IsNullOrEmpty(discountFilterId))
                query.withFilter(discountFilterId); // Discount filter id

            var response = api.getProducts(query);
            ProductSearchMetadata metadata = response.getMetadata();
            int total = metadata.getTotal(); // pageCounter = total/limit, these three values are being used to calculate paging.
            int limit = metadata.getLimit();
            int offset = metadata.getOffset();
            int pageCount = (int)Math.Ceiling((double)total / 100);
            var list = new List<Product>();
            for (int i = 0; i < pageCount; i++)
            {
                PageRequest page = new PageRequest().withLimit(100).withOffset(offset);
                var productResponse = api.getProducts(query, page, ProductSort.PriceLoHi);
                list.AddRange(productResponse.getProducts());
            }
            return list;
        }
Exemplo n.º 13
0
 public void AddItemInCounter(PageRequest request)
 {
     Requests.Enqueue(request);
 }
Exemplo n.º 14
0
        private List <View_Template> getTemplateApprovalList(NameValueCollection queryParams, List <Department> departmentList)
        {
            try
            {
                var query = new TemplateQuery(queryParams);

                var sqlCondition = new StringBuilder();
                sqlCondition.Append("ISNULL(IsDelete,0)!=1 and status=0");//Status审批状态为0(草稿),1同意,2拒绝

                if (departmentList != null && departmentList.Count > 0)
                {
                    sqlCondition.Append($" and DepartId in ({string.Join(",", departmentList.Select(x => x.Id))}) ");
                }

                //if (userType != GDS.Entity.Constant.ConstantDefine.Admin)  //验证审批权限
                //{
                //    var departmentList = new DepartmentBLL().GetDepartmentByAuditor(loginName);

                //    if (departmentList != null && departmentList.Count > 0)
                //    {
                //        sqlCondition.Append($" and DepartId in ({string.Join(",", departmentList.Select(x => x.Id))}) ");
                //    }
                //    else
                //    {
                //        return Json(new ResponseEntity<dynamic>(10, "权限不足", null), JsonRequestBehavior.AllowGet);
                //    }
                //}

                if (!string.IsNullOrEmpty(query.DepartId) && query.DepartId != "0")
                {
                    sqlCondition.Append($" and DepartId = {query.DepartId}");
                }

                if (!string.IsNullOrEmpty(query.ProjectType))
                {
                    sqlCondition.Append($" and ProjectType = {query.ProjectType}");
                }

                if (!string.IsNullOrEmpty(query.Name))
                {
                    sqlCondition.Append($" and Name like '%{query.Name}%'");
                }

                if (!string.IsNullOrEmpty(query.CreateBy))
                {
                    sqlCondition.Append($" and CreateBy like '%{query.CreateBy}%'");
                }

                PageRequest preq = new PageRequest
                {
                    TableName      = " [View_Template] ",
                    Where          = sqlCondition.ToString(),
                    Order          = " Id DESC ",
                    IsSelect       = true,
                    IsReturnRecord = true,
                    PageSize       = query.PageSize,
                    PageIndex      = query.PageIndex,
                    FieldStr       = "*"
                };

                var result = new TemplateBLL().GetView_TemplateByPage(preq);
                result.ForEach(template => {
                    template.CreateTimeStr = template.CreateTime.HasValue ? template.CreateTime.Value.ToString("yyyy-MM-dd") : string.Empty;
                });

                //var response = new ResponseEntity<object>(true, string.Empty,
                //    new DataGridResultEntity<View_Template>
                //    {
                //        TotalRecords = preq.Out_AllRecordCount,
                //        DisplayRecords = preq.Out_PageCount,
                //        ResultData = result
                //    });

                return(result); //Json(response, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                return(new List <View_Template>());
            }
        }
Exemplo n.º 15
0
 private void SendEvent(PageRequest evt)
 {
     evt.Domain = (evt.Domain ?? "").Replace("www.", "");
     requestModule.SendRequest(evt);
 }
        public ActionResult List(testSearchCriteria csc, PageRequest request)
        {
            var list = Ioc.Get <ItestService>().Search(csc, request);

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
 public async Task <List <TDocumentHeader> > GetAllAsync(PageRequest pageRequest)
 {
     return(await SelectEntityQuery.PagedSortBy(pageRequest).ToListAsync());
 }
Exemplo n.º 18
0
        public IHttpActionResult GetLinks([FromUri] PageRequest paging)
        {
            var result = _linkRepository.GetLinkDetails(paging);

            return(Ok(result));
        }
Exemplo n.º 19
0
        protected override IEnumerable ExecuteSelect(DataSourceSelectArguments arguments)
        {
            int pageSize = Int32.MaxValue;

            if (arguments.MaximumRows > 0)
            {
                pageSize = arguments.MaximumRows;
            }
            int         pageIndex = (arguments.StartRowIndex / pageSize);
            PageRequest request   = null;

            if (!(String.IsNullOrEmpty(_owner.PageRequestParameterName)))
            {
                string r = HttpContext.Current.Request.Params[_owner.PageRequestParameterName];
                if (!(String.IsNullOrEmpty(r)))
                {
                    request           = JsonConvert.DeserializeObject <PageRequest>(r);
                    request.PageIndex = pageIndex;
                    request.PageSize  = pageSize;
                    request.View      = _owner.DataView;
                }
            }
            if (request == null)
            {
                request = new PageRequest(pageIndex, pageSize, arguments.SortExpression, null);
                List <string> filter = new List <string>();
                System.Collections.Specialized.IOrderedDictionary filterValues = FilterParameters.GetValues(HttpContext.Current, _owner);
                foreach (Parameter p in FilterParameters)
                {
                    object v = filterValues[p.Name];
                    if (v != null)
                    {
                        string query = (p.Name + ":");
                        if ((p.DbType == DbType.Object) || (p.DbType == DbType.String))
                        {
                            foreach (string s in Convert.ToString(v).Split(',', ';'))
                            {
                                string q = Controller.ConvertSampleToQuery(s);
                                if (!(String.IsNullOrEmpty(q)))
                                {
                                    query = (query + q);
                                }
                            }
                        }
                        else
                        {
                            query = String.Format("{0}={1}", query, v);
                        }
                        filter.Add(query);
                    }
                }
                request.Filter = filter.ToArray();
            }
            request.RequiresMetaData = true;
            request.RequiresRowCount = arguments.RetrieveTotalRowCount;
            ViewPage page = ControllerFactory.CreateDataController().GetPage(_dataController, _dataView, request);

            if (arguments.RetrieveTotalRowCount)
            {
                arguments.TotalRowCount = page.TotalRowCount;
            }
            return(page.ToDataTable().DefaultView);
        }
Exemplo n.º 20
0
        private bool ProcessDownloadViaBusinessRule(Stream stream)
        {
            bool supportsContentType       = false;
            bool supportsFileName          = false;
            List <FieldValue> actionValues = CreateActionValues(stream, null, null, 0);

            DetectSupportForSpecialFields(actionValues, out supportsContentType, out supportsFileName);
            // try processing download via a business rule
            ActionArgs args = new ActionArgs();

            args.Controller      = DataController;
            args.CommandName     = "DownloadFile";
            args.CommandArgument = ControllerFieldName;
            args.Values          = actionValues.ToArray();
            ActionResult r = ControllerFactory.CreateDataController().Execute(DataController, UploadDownloadViewName, args);

            foreach (FieldValue v in r.Values)
            {
                if (v.Name.Equals(ContentTypeField))
                {
                    Current.ContentType = Convert.ToString(v.Value);
                }
                else
                if (v.Name.Equals(FileNameField))
                {
                    Current.FileName = Convert.ToString(v.Value);
                }
            }
            // see if we still need to retrieve the content type or the file name from the database
            bool needsContentType = String.IsNullOrEmpty(Current.ContentType);
            bool needsFileName    = String.IsNullOrEmpty(Current.FileName);

            if ((needsContentType && supportsContentType) || (needsFileName && supportsFileName))
            {
                actionValues = CreateActionValues(null, null, null, 0);
                List <string> filter = new List <string>();
                foreach (FieldValue v in actionValues)
                {
                    filter.Add(String.Format("{0}:={1}", v.Name, v.Value));
                }
                PageRequest request = new PageRequest();
                request.Controller       = DataController;
                request.View             = UploadDownloadViewName;
                request.PageSize         = 1;
                request.RequiresMetaData = true;
                request.Filter           = filter.ToArray();
                ViewPage page = ControllerFactory.CreateDataController().GetPage(request.Controller, request.View, request);
                if (page.Rows.Count == 1)
                {
                    object[] row = page.Rows[0];
                    if (supportsContentType)
                    {
                        Current.ContentType = Convert.ToString(page.SelectFieldValue(ContentTypeField, row));
                    }
                    if (supportsFileName)
                    {
                        Current.FileName = Convert.ToString(page.SelectFieldValue(FileNameField, row));
                    }
                }
            }
            return(r.Canceled);
        }
Exemplo n.º 21
0
 public virtual Task <PageResult <TModel> > ReadAsync(PageRequest request, CancellationToken cancellationToken = default) => request
 .ToPageResultAsync(_repository, cancellationToken);
        public async Task<PageResult<Customer>> GetCustomersAsync(PageRequest<Customer> request)
        {
            // Where
            IQueryable<Customer> items = _dataSource.Customers;
            if (request.Where != null)
            {
                items = items.Where(request.Where);
            }

            // Query
            if (!String.IsNullOrEmpty(request.Query))
            {
                items = items.Where(r => r.SearchTerms.Contains(request.Query.ToLower()));
            }

            // Count
            int count = items.Count();
            if (count > 0)
            {
                int pageSize = Math.Min(count, request.PageSize);
                int index = Math.Min(Math.Max(0, count - 1) / pageSize, request.PageIndex);

                // Order By
                if (request.OrderBy != null)
                {
                    items = items.OrderBy(request.OrderBy);
                }
                if (request.OrderByDesc != null)
                {
                    items = items.OrderByDescending(request.OrderByDesc);
                }

                // Execute
                var records = await items.Skip(index * pageSize).Take(pageSize)
                    .Select(r => new Customer
                    {
                        CustomerID = r.CustomerID,
                        Title = r.Title,
                        FirstName = r.FirstName,
                        MiddleName = r.MiddleName,
                        LastName = r.LastName,
                        Suffix = r.Suffix,
                        Gender = r.Gender,
                        EmailAddress = r.EmailAddress,
                        AddressLine1 = r.AddressLine1,
                        AddressLine2 = r.AddressLine2,
                        City = r.City,
                        Region = r.Region,
                        CountryCode = r.CountryCode,
                        PostalCode = r.PostalCode,
                        Phone = r.Phone,
                        CreatedOn = r.CreatedOn,
                        LastModifiedOn = r.LastModifiedOn,
                        Thumbnail = r.Thumbnail
                    })
                    .AsNoTracking()
                    .ToListAsync();

                return new PageResult<Customer>(index, pageSize, count, records);
            }
            return PageResult<Customer>.Empty();
        }
 private static void LogPageView(PageRequest preq)
 {
     try
     {
       using (var client = new WebClient())
      {
        client.Headers.Add("X-CloudMine-ApiKey", appSecret);
        client.Headers.Add("Content-Type", "application/json");
        var serializer = new JavaScriptSerializer();
        var data = serializer.Serialize(preq);
        var payload = "{\"PV_" + DateTime.Now.Ticks + "\":" + data + "}";
        var bytes = Encoding.Default.GetBytes(payload);
        client.UploadDataAsync(new Uri("https://api.cloudmine.me/v1/app/" + appId + "/text"), "PUT", bytes);
       }
     }
     catch (Exception e)
     {
         //log error
     }
 }
Exemplo n.º 24
0
        public object Get(JObject req)
        {
            using (var db = new LUOLAI1401Context())
            {
                try
                {
                    // 准备输入条件
                    var       sbCondition = new StringBuilder();
                    ArrayList parameters  = new ArrayList();

                    var getValue = HttpContext.Current.Request.Get("UserCode", HttpRequestGetMode.GetOnly);
                    if (!string.IsNullOrEmpty(getValue))
                    {
                        sbCondition.Append("UserCode = @userCode AND ");
                        parameters.Add(new System.Data.SqlClient.SqlParameter("@userCode", getValue));
                    }

                    getValue = HttpContext.Current.Request.Get("UserName", HttpRequestGetMode.GetOnly);
                    if (!string.IsNullOrEmpty(getValue))
                    {
                        sbCondition.Append("UserName = @userName AND ");
                        parameters.Add(new System.Data.SqlClient.SqlParameter("@userName", getValue));
                    }

                    getValue = HttpContext.Current.Request.Get("Time", HttpRequestGetMode.GetOnly);
                    if (!string.IsNullOrEmpty(getValue))
                    {
                        DateTime?start = null, end = null;
                        var      datePair = getValue.Split('到');
                        if (datePair.Length == 2)
                        {
                            DateTime date;
                            if (DateTime.TryParseExact(datePair[0].Trim(), "yyyy-MM-dd", null, System.Globalization.DateTimeStyles.None, out date))
                            {
                                start = date;
                            }
                            if (DateTime.TryParseExact(datePair[1].Trim(), "yyyy-MM-dd", null, System.Globalization.DateTimeStyles.None, out date))
                            {
                                end = date.AddDays(1);
                            }
                        }
                        else
                        {
                            DateTime date;
                            if (DateTime.TryParseExact(datePair[0].Trim(), "yyyy-MM-dd", null, System.Globalization.DateTimeStyles.None, out date))
                            {
                                start = new DateTime(date.Year, date.Month, date.Day);
                                end   = start.Value.AddDays(1);
                            }
                        }

                        if (start != null)
                        {
                            sbCondition.Append("CreateDate >= @start AND ");
                            parameters.Add(new System.Data.SqlClient.SqlParameter("@start", start.Value));
                        }

                        if (end != null)
                        {
                            sbCondition.Append("CreateDate < @end AND ");
                            parameters.Add(new System.Data.SqlClient.SqlParameter("@end", end.Value));
                        }
                    }

                    sbCondition.Append("(CompCode ='" + System.Web.HttpContext.Current.Session["CompCode"] + "' or 'super'='" + ((sys_user)System.Web.HttpContext.Current.Session["sys_user"]).UserCode + "') and");
                    if (sbCondition.Length > 4)
                    {
                        sbCondition.Length -= 4;
                    }

                    // 分页组件初始化
                    PageRequest pr = new PageRequest();
                    return(pr.ToPageList <AttendTrack>(db.Database, "*", "attendTrack_v", sbCondition.ToString(), "CreateDate", "asc", parameters.ToArray()));
                }
                finally
                {
                    db.Database.Connection.Close();
                }
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// Gets all grants for a given subject ID.
        /// </summary>
        /// <param name="subjectId">The subject identifier.</param>
        /// <returns></returns>
        public async Task <IEnumerable <Grant> > GetAllGrantsAsync(string subjectId)
        {
            var request = new PageRequest
            {
                Take   = null,
                Filter = $"{nameof(Entity.IGrant.UserId)} eq '{subjectId}'"
            };

            var consentList = (await _userConsentStore.GetAsync(request).ConfigureAwait(false)).Items
                              .Select(c => _serializer.Deserialize <Consent>(c.Data))
                              .Select(c => new Grant
            {
                ClientId     = c.ClientId,
                CreationTime = c.CreationTime,
                Expiration   = c.Expiration,
                Scopes       = c.Scopes,
                SubjectId    = subjectId
            });

            var codeList = (await _authorizationCodeStore.GetAsync(request).ConfigureAwait(false)).Items
                           .Select(c => _serializer.Deserialize <AuthorizationCode>(c.Data))
                           .Select(c => new Grant
            {
                ClientId     = c.ClientId,
                CreationTime = c.CreationTime,
                Description  = c.Description,
                Expiration   = c.CreationTime.AddSeconds(c.Lifetime),
                Scopes       = c.RequestedScopes,
                SubjectId    = subjectId
            });

            var refreshTokenList = (await _refreshTokenStore.GetAsync(request).ConfigureAwait(false)).Items
                                   .Select(t => _serializer.Deserialize <RefreshToken>(t.Data))
                                   .Select(t => new Grant
            {
                ClientId     = t.ClientId,
                CreationTime = t.CreationTime,
                Description  = t.Description,
                Expiration   = t.CreationTime.AddSeconds(t.Lifetime),
                Scopes       = t.Scopes,
                SubjectId    = subjectId
            });

            var referenceTokenList = (await _referenceTokenStore.GetAsync(request).ConfigureAwait(false)).Items
                                     .Select(t => _serializer.Deserialize <Token>(t.Data))
                                     .Select(t => new Grant
            {
                ClientId     = t.ClientId,
                CreationTime = t.CreationTime,
                Description  = t.Description,
                Expiration   = t.CreationTime.AddSeconds(t.Lifetime),
                Scopes       = t.Scopes,
                SubjectId    = subjectId
            });

            consentList = Join(consentList, codeList);
            consentList = Join(consentList, refreshTokenList);
            consentList = Join(consentList, referenceTokenList);

            return(consentList);
        }
Exemplo n.º 26
0
        private List <View_Project> getPojectApprovalList(NameValueCollection queryParams, List <Department> departmentList)
        {
            try
            {
                var query = new ProjectQuery(queryParams);

                var sqlCondition = new StringBuilder();
                sqlCondition.Append("ISNULL(IsDelete,0)!=1 and CurrentStatus=0"); //CurrentStatus审批状态为0(草稿)

                if (departmentList != null && departmentList.Count > 0)
                {
                    sqlCondition.Append($" and DepartId in ({string.Join(",", departmentList.Select(x => x.Id))}) ");
                }

                //if (userType != GDS.Entity.Constant.ConstantDefine.Admin)  //验证审批权限
                //{
                //    var departmentList = new DepartmentBLL().GetDepartmentByAuditor(loginName);

                //    if (departmentList != null && departmentList.Count > 0)
                //    {
                //        sqlCondition.Append($" and DepartId in ({string.Join(",", departmentList.Select(x => x.Id))}) ");
                //    }
                //    else
                //    {
                //        return Json(new ResponseEntity<dynamic>(10, "权限不足", null), JsonRequestBehavior.AllowGet);
                //    }
                //}

                int    userType  = CurrenUserInfo.UserType;
                string loginName = CurrenUserInfo.LoginName;

                if (userType == GDS.Entity.Constant.ConstantDefine.ProjectManager) //
                {
                    sqlCondition.Append($" and (createby = '{loginName}' or projectmanager = '{loginName}' or charindex(';{loginName};', ';' + TeamMembers + ';') > 0) ");
                }
                else if (userType == GDS.Entity.Constant.ConstantDefine.User) //
                {
                    sqlCondition.Append($"and charindex(';{loginName};', ';' + TeamMembers + ';') > 0");
                }
                if (!string.IsNullOrEmpty(query.DepartId) && query.DepartId != "0")
                {
                    sqlCondition.Append($" and BusinessDept = {query.DepartId}");
                }

                if (!string.IsNullOrEmpty(query.ProjectType))
                {
                    sqlCondition.Append($" and ProjectType = {query.ProjectType}");
                }

                if (!string.IsNullOrEmpty(query.Name))
                {
                    sqlCondition.Append($" and Name like '%{query.Name}%'");
                }

                if (!string.IsNullOrEmpty(query.CreateBy))
                {
                    sqlCondition.Append($" and CreateBy like '%{query.CreateBy}%'");
                }

                PageRequest preq = new PageRequest
                {
                    TableName      = " [View_Project] ",
                    Where          = sqlCondition.ToString(),
                    Order          = " Id DESC ",
                    IsSelect       = true,
                    IsReturnRecord = true,
                    PageSize       = query.PageSize,
                    PageIndex      = query.PageIndex,
                    FieldStr       = "*"
                };

                var result = new ProjectBLL().GetView_ProjectByPage(preq);

                result.ForEach(project => {
                    project.CreateTimeStr = project.CreateTime.HasValue ? project.CreateTime.Value.ToString("yyyy-MM-dd") : string.Empty;
                });

                //var response = new ResponseEntity<object>(true, string.Empty,
                //    new DataGridResultEntity<View_Project>
                //    {
                //        TotalRecords = preq.Out_AllRecordCount,
                //        DisplayRecords = preq.Out_PageCount,
                //        ResultData = result
                //    });

                return(result);
            }
            catch (Exception ex)
            {
                return(new List <View_Project>());
            }
        }
Exemplo n.º 27
0
 public async Task <IActionResult> GetAllUserByPage(PageRequest pageRequest)
 {
     return(Ok(await _unitOfWork.GetRepository <Role>().GetPagedListAsyncCurrent(pageIndex: pageRequest.PageIndex, pageSize: pageRequest.PageSize)));
 }
Exemplo n.º 28
0
        public decimal Create(PageRequest request)
        {
            try
            {
                var spParameter = new SqlParameter[10];

                #region Set param
                var parameter = new SqlParameter("@P_Title", SqlDbType.NVarChar)
                {
                    Direction = ParameterDirection.Input,
                    Value     = request.Title
                };
                spParameter[0] = parameter;

                parameter = new SqlParameter("@P_Content", SqlDbType.NVarChar)
                {
                    Direction = ParameterDirection.Input,
                    Value     = request.Content
                };
                spParameter[1] = parameter;

                parameter = new SqlParameter("@P_Tag", SqlDbType.NVarChar)
                {
                    Direction = ParameterDirection.Input,
                    Value     = request.Tag
                };
                spParameter[2] = parameter;

                parameter = new SqlParameter("@P_CreateDate", SqlDbType.VarChar)
                {
                    Direction = ParameterDirection.Input,
                    Value     = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")
                };
                spParameter[3] = parameter;

                parameter = new SqlParameter("@P_CreateBy", SqlDbType.NVarChar)
                {
                    Direction = ParameterDirection.Input,
                    Value     = request.CreateBy
                };
                spParameter[4] = parameter;

                parameter = new SqlParameter("@P_Return", SqlDbType.Int)
                {
                    Direction = ParameterDirection.Output,
                    Value     = -1
                };
                spParameter[5] = parameter;
                #endregion

                SqlHelper.ExecuteNonQuery(ConfigInfo.ConnectString, CommandType.StoredProcedure, "PROC_PAGE_INSERT",
                                          spParameter);

                return(Convert.ToDecimal(spParameter[5].Value));
            }
            catch (Exception ex)
            {
                Logger.Log.Error(ex.ToString());
                return(-1);
            }
        }
Exemplo n.º 29
0
 public List<MyCompany.Data.Objects.Prefix> Select(string filter, string sort, string dataView, BusinessObjectParameters parameters)
 {
     PageRequest request = new PageRequest(0, Int32.MaxValue, sort, new string[0]);
     request.RequiresMetaData = true;
     IDataController c = ControllerFactory.CreateDataController();
     IBusinessObject bo = ((IBusinessObject)(c));
     bo.AssignFilter(filter, parameters);
     ViewPage page = c.GetPage("Prefix", dataView, request);
     return page.ToList<MyCompany.Data.Objects.Prefix>();
 }
Exemplo n.º 30
0
 public void Enqueue(PageRequest request)
 {
     _requestQueue.Enqueue(request);
 }
Exemplo n.º 31
0
        private PageRequest ProcessEvent(Guid siteId, Uri urlReferrer, Guid? requestId = null, TimeSpan? duration = null, string refferer = "")
        {
            Guid sessionId = Guid.Empty;
            var sessionCookie = Request.Cookies["SkynerSessionId"];
            if (sessionCookie != null) Guid.TryParse(sessionCookie.Value, out sessionId);

            if (sessionId == null || sessionId.Equals(Guid.Empty)) sessionId = Guid.NewGuid();

            var httpCookie = new HttpCookie("SkynerSessionId");
            httpCookie.Domain = Request.Url.Host;
            httpCookie.Value = sessionId.ToString();
            httpCookie.HttpOnly = true;
            Response.SetCookie(httpCookie);

            var request = new PageRequest
            {
                Id = requestId.GetValueOrDefault(Guid.NewGuid()),
                SessionIdentifier = sessionId,
                Url = urlReferrer.AbsolutePath,
                Domain = urlReferrer.Host,
                IpAddress = Request.UserHostAddress,
                Browser = (byte)Request.Browser.Browser.GetBrowserFromString(),
                Duration = duration.GetValueOrDefault(TimeSpan.Zero),
                Refferer = refferer,
                SiteId = siteId
            };

            try
            {
                SendEvent(request);
            }
            catch
            {
                throw new HttpException(404, "not found");
            }

            return request;
        }
Exemplo n.º 32
0
 internal static void ProcessRequest(int threadIndex, PageRequest request)
 {
     _currentSlot.ThreadSlots[threadIndex].ProcessRequest(request);
 }
        public void DownloadProducts(string fts, string catID, string brandFilterID, string retailerFilterID, string priceFilterID, string discountFilterID, string productSetName)
        {
            ProductQuery query = new ProductQuery();
            if (!string.IsNullOrEmpty(fts))
                query.withFreeText(fts);
            if (!string.IsNullOrEmpty(catID))
                query.withCategory(catID); // Category jackets
            if (!string.IsNullOrEmpty(brandFilterID))
                query.withFilter(brandFilterID); // Brand filter id
            if (!string.IsNullOrEmpty(retailerFilterID))
                query.withFilter(retailerFilterID);// Retailer filter id
            if (!string.IsNullOrEmpty(priceFilterID))
                query.withFilter(priceFilterID); // Price filter id
            if (!string.IsNullOrEmpty(discountFilterID))
                query.withFilter(discountFilterID); // Discount filter id

            var response = api.getProducts(query);

            ProductSearchMetadata metadata = response.getMetadata();
            int total = metadata.getTotal(); // pageCounter = total/limit, these three values are being used to calculate paging.
            int limit = metadata.getLimit();
            int offset = metadata.getOffset();
            int pageCount = (int)Math.Ceiling((double)total / 100);

            System.Guid productSetID;

            using (CatalogDataContext context = new CatalogDataContext())
            {
                var ps = (from set in context.SS_Product_Sets where set.product_set_name == productSetName select set).SingleOrDefault();
                if (ps == null)
                {
                    SS_Product_Set productSet = new SS_Product_Set()
                    {
                        id = System.Guid.NewGuid(),
                        product_set_name = productSetName,
                        tb_seller_cid = ProductService.AddSellerCat(productSetName).Cid,
                        datetimecreated = (DateTime?)DateTime.Now
                    };

                    context.SS_Product_Sets.InsertOnSubmit(productSet);
                    context.SubmitChanges();
                    productSetID = productSet.id;
                }
                else
                    productSetID = ps.id;

            }

            for (int i = 0; i < pageCount; i++)
            {
                PageRequest page = new PageRequest().withLimit(100).withOffset(offset);
                var productResponse = api.getProducts(query, page, ProductSort.PriceLoHi);

                foreach (var product in productResponse.getProducts())
                {
                    try
                    {
                         using (CatalogDataContext dc = new CatalogDataContext())
                    {
                        if (dc.SS_Products.FirstOrDefault(x => x.product_id == product.getId()) != null)
                        {
                            continue;
                        }
                    }

                    using (CatalogDataContext dc = new CatalogDataContext())
                    {

                        SS_Product ssProduct = new SS_Product()
                        {
                            id = System.Guid.NewGuid(),
                            brand_id = (int?)product.getBrand().getId(),
                            click_url = product.getClickUrl(),
                            currency = product.getCurrency().getCurrencyCode(),
                            description = product.getDescription(),
                            chinese_description = getTranslateResult(stripOffHTMLTags(product.getDescription()), true) ?? string.Empty,
                            image_id = product.getImage().getId(),
                            in_stock = product.isInStock(),
                            locale = product.getLocale().getDisplayCountry(),
                            name = product.getName(),
                            chinese_name = product.getBrand().getName() + getTranslateResult(product.getName(), false) ?? string.Empty,
                            price = (decimal?)product.getPrice(),
                            price_label = product.getPriceLabel(),
                            retailer_id = (int?)product.getRetailer().getId(),
                            product_id = (int)product.getId(),
                            sale_price = (decimal?)product.getSalePrice() == 0 ? null : (decimal?)product.getSalePrice(),
                            sale_price_label = product.getSalePriceLabel(),
                            istranslated = false,
                            keyword = fts,
                            datetimecreated = DateTime.Now,
                            product_set_name_id = productSetID
                        };
                        dc.SS_Products.InsertOnSubmit(ssProduct);
                        dc.SubmitChanges();

                    }

                    using (CatalogDataContext dc = new CatalogDataContext())
                    {
                        SS_Product ssProduct = dc.SS_Products.FirstOrDefault(x => x.product_id == product.getId());

                        //Insert categories and product-category mapping records
                        if (!string.IsNullOrEmpty(catID))
                        {
                            SS_Product_Category_Mapping pcMapping = new SS_Product_Category_Mapping() { id = System.Guid.NewGuid(), product_id = ssProduct.product_id, cat_id = catID };
                            dc.SS_Product_Category_Mappings.InsertOnSubmit(pcMapping);
                            dc.SubmitChanges();
                        }
                        else
                        {
                            foreach (var category in product.getCategories())
                            {
                                if (ssProduct != null)
                                {
                                    SS_Product_Category_Mapping pcMapping = new SS_Product_Category_Mapping() { id = System.Guid.NewGuid(), product_id = ssProduct.product_id, cat_id = category.getId() };
                                    dc.SS_Product_Category_Mappings.InsertOnSubmit(pcMapping);
                                    dc.SubmitChanges();
                                }
                                else
                                {
                                    throw new ArgumentNullException("Could not find the newly inserted product");
                                }
                            }
                        }
                    }

                    //insert main image
                    foreach (ImageSize imageSize in product.getImage().getSizes().values().toArray())
                    {
                        using (CatalogDataContext dc1 = new CatalogDataContext())
                        {
                            SS_Product ssProduct = dc1.SS_Products.FirstOrDefault(x => x.product_id == product.getId());

                            SS_Image image = new SS_Image()
                            {
                                id = System.Guid.NewGuid(),
                                size_name = imageSize.getSizeName().toString(),
                                image_id = ssProduct.image_id,
                                url = imageSize.getUrl(),
                                height = imageSize.getHeight(),
                                width = imageSize.getWidth()
                            };
                            dc1.SS_Images.InsertOnSubmit(image);
                            dc1.SubmitChanges();

                        }
                    }

                    //Isert product_color_image_mapping records
                    foreach (var color in product.getColors())
                    {
                        using (CatalogDataContext dc = new CatalogDataContext())
                        {

                            SS_Product ssProduct = dc.SS_Products.FirstOrDefault(x => x.product_id == product.getId());

                            SS_Product_Color_Image_Mapping pciMapping = new SS_Product_Color_Image_Mapping();
                            pciMapping.id = System.Guid.NewGuid();
                            pciMapping.color_name = color.getName();
                            pciMapping.product_id = (int)product.getId();

                            if (color.getImage() == null)
                            {
                                pciMapping.image_id = ssProduct.image_id;//if there's no image element inside color element, that means only one color available.
                            }
                            else
                            {
                                pciMapping.image_id = color.getImage().getId();
                            }

                            if (color.getImage() != null)
                            {
                                var ssImage = (from image in dc.SS_Images where image.image_id == color.getImage().getId() select image).FirstOrDefault();

                                if (ssImage == null)
                                {
                                    foreach (ImageSize imageSize in color.getImage().getSizes().values().toArray())
                                    {
                                        using (CatalogDataContext dc1 = new CatalogDataContext())
                                        {

                                            SS_Image image = new SS_Image()
                                            {
                                                id = System.Guid.NewGuid(),
                                                size_name = imageSize.getSizeName().toString(),
                                                image_id = pciMapping.image_id,
                                                url = imageSize.getUrl(),
                                                height = imageSize.getHeight(),
                                                width = imageSize.getWidth()
                                            };
                                            dc1.SS_Images.InsertOnSubmit(image);
                                            dc1.SubmitChanges();

                                        }
                                    }
                                }
                            }

                            dc.SS_Product_Color_Image_Mappings.InsertOnSubmit(pciMapping);
                            dc.SubmitChanges();
                        }

                    }

                    //Insert size and product_size_mapping
                    foreach (var size in product.getSizes())
                    {
                        using (CatalogDataContext dc = new CatalogDataContext())
                        {
                            SS_Size result = dc.SS_Sizes.FirstOrDefault(x => x.name == size.getName());

                            if (result == null)
                            {
                                System.Guid sizeId;
                                using (CatalogDataContext dc1 = new CatalogDataContext())
                                {
                                    SS_Size s = new SS_Size() { id = System.Guid.NewGuid(), name = size.getName() };
                                    dc1.SS_Sizes.InsertOnSubmit(s);
                                    dc1.SubmitChanges();

                                    sizeId = s.id;
                                }

                                using (CatalogDataContext dc2 = new CatalogDataContext())
                                {
                                    SS_Product_Size_Mapping psMapping = new SS_Product_Size_Mapping() { id = System.Guid.NewGuid(), product_id = (int)product.getId(), size_id = sizeId };
                                    dc2.SS_Product_Size_Mappings.InsertOnSubmit(psMapping);
                                    dc2.SubmitChanges();
                                }

                            }
                            else
                            {
                                SS_Product_Size_Mapping psMapping = new SS_Product_Size_Mapping() { id = System.Guid.NewGuid(), product_id = (int)product.getId(), size_id = result.id };
                                dc.SS_Product_Size_Mappings.InsertOnSubmit(psMapping);
                                dc.SubmitChanges();
                            }
                        }
                    }
                    }
                    catch (Exception)
                    {
                        continue;
                    }
                }
                offset += 100;
            }
        }
        public void SendRequest(PageRequest request)
        {
            RequestHelper.ProcessRequest(request);

            _streamInsightCore.PingInputServiceGathering.PushEvent(request);
        }
Exemplo n.º 35
0
 public void SendRequest(PageRequest request)
 {
 }
Exemplo n.º 36
0
        public async Task <PageResult <DataDictionaryOutDto> > GetResultAsync(PageRequest query)
        {
            var result = await _dataDictionary.NoTrackEntities.ToPageAsync <DataDictionaryEntity, DataDictionaryOutDto>(query);

            return(result);
        }
Exemplo n.º 37
0
		public virtual void Load( bool synchronous )
		{
			if ( !this.mDeferredProcessInProgress )
			{
				DestroyAllContentCollections();
				var req = new PageRequest( this );
				this.mDeferredProcessInProgress = true;

				Root.Instance.WorkQueue.AddRequest( this.workQueueChannel, WORKQUEUE_PREPARE_REQUEST, req, 0, synchronous );
			}
		}
Exemplo n.º 38
0
        void IHttpHandler.ProcessRequest(HttpContext context)
        {
            string      c       = context.Request["c"];
            string      q       = context.Request["q"];
            PageRequest request = this.Request;

            if ((request == null) && (String.IsNullOrEmpty(c) || String.IsNullOrEmpty(q)))
            {
                throw new Exception("Invalid report request.");
            }
            // create a data table for report
            string templateName = null;
            string aa           = null;
            string reportFormat = null;

            if (request == null)
            {
                request      = JsonConvert.DeserializeObject <PageRequest>(q);
                templateName = context.Request.Form["a"];
                aa           = context.Request["aa"];
            }
            else
            {
                templateName          = this.Arguments.TemplateName;
                reportFormat          = this.Arguments.Format;
                request.FilterDetails = this.Arguments.FilterDetails;
            }
            request.PageIndex        = 0;
            request.PageSize         = Int32.MaxValue;
            request.RequiresMetaData = true;
            // try to generate a report via a business rule
            ActionArgs args = null;

            if (!(String.IsNullOrEmpty(aa)))
            {
                args = JsonConvert.DeserializeObject <ActionArgs>(aa);
                IDataController controller = ControllerFactory.CreateDataController();
                ActionResult    result     = controller.Execute(args.Controller, args.View, args);
                if (!(String.IsNullOrEmpty(result.NavigateUrl)))
                {
                    AppendDownloadTokenCookie();
                    context.Response.Redirect(result.NavigateUrl);
                }
                if (result.Canceled)
                {
                    AppendDownloadTokenCookie();
                    return;
                }
                result.RaiseExceptionIfErrors();
                // parse action data
                SortedDictionary <string, string> actionData = new SortedDictionary <string, string>();
                ((DataControllerBase)(controller)).Config.ParseActionData(args.Path, actionData);
                List <string> filter = new List <string>();
                foreach (string name in actionData.Keys)
                {
                    string v = actionData[name];
                    if (name.StartsWith("_"))
                    {
                        if (name == "_controller")
                        {
                            request.Controller = v;
                        }
                        if (name == "_view")
                        {
                            request.View = v;
                        }
                        if (name == "_sortExpression")
                        {
                            request.SortExpression = v;
                        }
                        if (name == "_count")
                        {
                            request.PageSize = Convert.ToInt32(v);
                        }
                        if (name == "_template")
                        {
                            templateName = v;
                        }
                    }
                    else
                    if (v == "@Arguments_SelectedValues")
                    {
                        if ((args.SelectedValues != null) && (args.SelectedValues.Length > 0))
                        {
                            StringBuilder sb = new StringBuilder();
                            foreach (string key in args.SelectedValues)
                            {
                                if (sb.Length > 0)
                                {
                                    sb.Append("$or$");
                                }
                                sb.Append(key);
                            }
                            filter.Add(String.Format("{0}:$in${1}", name, sb.ToString()));
                        }
                        else
                        {
                            return;
                        }
                    }
                    else
                    if (Regex.IsMatch(v, "^(\'|\").+(\'|\")$"))
                    {
                        filter.Add(String.Format("{0}:={1}", name, v.Substring(1, (v.Length - 2))));
                    }
                    else
                    if (args.Values != null)
                    {
                        foreach (FieldValue fv in args.Values)
                        {
                            if (fv.Name == v)
                            {
                                filter.Add(String.Format("{0}:={1}", name, fv.Value));
                            }
                        }
                    }
                    request.Filter = filter.ToArray();
                }
            }
            // load report definition
            string    reportTemplate = Controller.CreateReportInstance(null, templateName, request.Controller, request.View);
            ViewPage  page           = ControllerFactory.CreateDataController().GetPage(request.Controller, request.View, request);
            DataTable table          = page.ToDataTable();

            // insert validation key
            reportTemplate = _validationKeyRegex.Replace(reportTemplate, String.Format("/Blob.ashx?_validationKey={0}&amp;", BlobAdapter.ValidationKey));
            // figure report output format
            if (this.Arguments == null)
            {
                Match m = Regex.Match(c, "^(ReportAs|Report)(Pdf|Excel|Image|Word|)$");
                reportFormat = m.Groups[2].Value;
            }
            if (String.IsNullOrEmpty(reportFormat))
            {
                reportFormat = "Pdf";
            }
            // render a report
            string mimeType          = null;
            string encoding          = null;
            string fileNameExtension = null;

            string[]  streams  = null;
            Warning[] warnings = null;
            using (LocalReport report = new LocalReport())
            {
                report.EnableHyperlinks     = true;
                report.EnableExternalImages = true;
                report.LoadReportDefinition(new StringReader(reportTemplate));
                report.DataSources.Add(new ReportDataSource(request.Controller, table));
                report.EnableExternalImages = true;
                foreach (ReportParameterInfo p in report.GetParameters())
                {
                    if (p.Name.Equals("FilterDetails") && !(String.IsNullOrEmpty(request.FilterDetails)))
                    {
                        report.SetParameters(new ReportParameter("FilterDetails", request.FilterDetails));
                    }
                    if (p.Name.Equals("BaseUrl"))
                    {
                        string baseUrl = String.Format("{0}://{1}{2}", context.Request.Url.Scheme, context.Request.Url.Authority, context.Request.ApplicationPath.TrimEnd('/'));
                        report.SetParameters(new ReportParameter("BaseUrl", baseUrl));
                    }
                    if (p.Name.Equals("Query") && !(String.IsNullOrEmpty(q)))
                    {
                        report.SetParameters(new ReportParameter("Query", HttpUtility.UrlEncode(q)));
                    }
                }
                report.SetBasePermissionsForSandboxAppDomain(new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted));
                byte[] reportData = report.Render(reportFormat, null, out mimeType, out encoding, out fileNameExtension, out streams, out warnings);
                if (this.Arguments != null)
                {
                    this.Arguments.MimeType          = mimeType;
                    this.Arguments.FileNameExtension = fileNameExtension;
                    this.Arguments.Encoding          = encoding;
                    this.OutputStream.Write(reportData, 0, reportData.Length);
                }
                else
                {
                    // send report data to the client
                    context.Response.Clear();
                    context.Response.ContentType = mimeType;
                    context.Response.AddHeader("Content-Length", reportData.Length.ToString());
                    AppendDownloadTokenCookie();
                    string fileName = FormatFileName(context, request, fileNameExtension);
                    if (String.IsNullOrEmpty(fileName))
                    {
                        fileName = String.Format("{0}_{1}.{2}", request.Controller, request.View, fileNameExtension);
                        if (args != null)
                        {
                            fileName = GenerateOutputFileName(args, fileName);
                        }
                    }
                    context.Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", fileName));
                    context.Response.OutputStream.Write(reportData, 0, reportData.Length);
                }
            }
        }
Exemplo n.º 39
0
        private static void SendRequest(int index)
        {
            var rand = new Random(Environment.TickCount + index);

            var r = new PageRequest
            {
                Id = Guid.NewGuid(),
                Domain = domains[rand.Next(0, domains.Length - 1)],
                SiteId = siteGuid,
                PageId = rand.Next(0, 1) == 0 ? null : pageGuids[rand.Next(0, pageGuids.Length - 1)],
                Refferer = "",
                Browser = 1,
                Duration = TimeSpan.FromSeconds(5),
                IpAddress = "12312",
                Url = "http://asfasdf.asd", SessionIdentifier=Guid.Empty,
                UserId = Guid.Empty
            };
            r.ParentDomain = r.Domain;

            core.SendRequest(r);
        }
Exemplo n.º 40
0
 protected virtual string FormatFileName(HttpContext context, PageRequest request, string extension)
 {
     return(null);
 }
        public void HandleNewPageLoaded(string message)
        {
            // We are unable to trace requests for local pages (like about:*, file:// urls, etc.). So simulate a first initial request when missing.
            if (m_InitialPage == null)
            {
                string[] parts = message.Split(new char[] { ',' }, 2);
                HandleNewPageRequest(parts[1]);
            }

            m_LoadedPage = m_InitialPage;
            m_InitialPage = null; // Not really necessary, but might help with finding bugs
            m_LoadedPage.StartSectionSafe(m_InMarkedSection);
        }
Exemplo n.º 42
0
        protected virtual PageRequest CreateRequest(
            decimal?autoId,
            string orderBy,
            string deliveryDestination,
            string customerMatCode,
            string partsDevision,
            string customerPO,
            string key1,
            string key2,
            string key3,
            string reliabilityDevision,
            DateTime?deliveryDate,
            int?quantity,
            string unit,
            string plngPeriod,
            string sAPCode,
            string statusCode,
            string deliveryDestinationCode,
            string sort,
            int maximumRows,
            int startRowIndex)
        {
            List <string> filter = new List <string>();

            if (autoId.HasValue)
            {
                filter.Add(("AutoId:=" + autoId.Value.ToString()));
            }
            if (!(String.IsNullOrEmpty(orderBy)))
            {
                filter.Add(("OrderBy:*" + orderBy));
            }
            if (!(String.IsNullOrEmpty(deliveryDestination)))
            {
                filter.Add(("DeliveryDestination:*" + deliveryDestination));
            }
            if (!(String.IsNullOrEmpty(customerMatCode)))
            {
                filter.Add(("CustomerMatCode:*" + customerMatCode));
            }
            if (!(String.IsNullOrEmpty(partsDevision)))
            {
                filter.Add(("PartsDevision:*" + partsDevision));
            }
            if (!(String.IsNullOrEmpty(customerPO)))
            {
                filter.Add(("CustomerPO:*" + customerPO));
            }
            if (!(String.IsNullOrEmpty(key1)))
            {
                filter.Add(("Key1:*" + key1));
            }
            if (!(String.IsNullOrEmpty(key2)))
            {
                filter.Add(("Key2:*" + key2));
            }
            if (!(String.IsNullOrEmpty(key3)))
            {
                filter.Add(("Key3:*" + key3));
            }
            if (!(String.IsNullOrEmpty(reliabilityDevision)))
            {
                filter.Add(("ReliabilityDevision:*" + reliabilityDevision));
            }
            if (deliveryDate.HasValue)
            {
                filter.Add(("DeliveryDate:=" + deliveryDate.Value.ToString()));
            }
            if (quantity.HasValue)
            {
                filter.Add(("Quantity:=" + quantity.Value.ToString()));
            }
            if (!(String.IsNullOrEmpty(unit)))
            {
                filter.Add(("Unit:*" + unit));
            }
            if (!(String.IsNullOrEmpty(plngPeriod)))
            {
                filter.Add(("PlngPeriod:*" + plngPeriod));
            }
            if (!(String.IsNullOrEmpty(sAPCode)))
            {
                filter.Add(("SAPCode:*" + sAPCode));
            }
            if (!(String.IsNullOrEmpty(statusCode)))
            {
                filter.Add(("StatusCode:*" + statusCode));
            }
            if (!(String.IsNullOrEmpty(deliveryDestinationCode)))
            {
                filter.Add(("DeliveryDestinationCode:*" + deliveryDestinationCode));
            }
            PageRequest request = new PageRequest((startRowIndex / maximumRows), maximumRows, sort, filter.ToArray());

            request.MetadataFilter = new string[] {
                "fields"
            };
            return(request);
        }
 private void HandleNewPageScripts()
 {
     m_ScriptPage = m_LoadedPage;
     m_ScriptSourceHolder = null;
 }
Exemplo n.º 44
0
 /// <summary>
 /// 添加一条页面访问记录
 /// </summary>
 /// <param name="pageRequest"></param>
 public static void AddPageRequest(PageRequest pageRequest)
 {
     Provider.AddPageRequest(pageRequest);
 }
        public override void OnResultExecuting(ResultExecutingContext context)
        {
            // if (!context.HttpContext.User.Identity.IsAuthenticated) return;
            // var uId = new CurrentUser(context.HttpContext).person.Id;
            var uname = context.HttpContext.User.Identity.Name;
            var request = context.HttpContext.Request;

            var refUrl = "";
            if (request.UrlReferrer != null) refUrl = request.UrlReferrer.ToString();

            PageRequest pv = new PageRequest
            {
                Name = request.RawUrl,
                Url = request.RawUrl,
                UrlReferrer = refUrl,
                UserIP = request.UserHostAddress,
                UserName = uname,
                // UserId = uId, CookieVal = reqInfo.Cookies["yourcookie"].Value,
                Created = ExtensionMethods.JsonDate(DateTime.Now),
                Action = (string)context.RequestContext.RouteData.Values["action"],
                Controller = (string)context.RouteData.Values["controller"],
                Param1 = (string)context.RouteData.Values["uref"],
                PageId = Convert.ToInt32(context.RouteData.Values["Id"]),
            };

            LogPageView(pv);
        }
Exemplo n.º 46
0
        public Page<DocumentPackage> GetTemplates(PageRequest request) {
            string path = template.UrlFor (UrlTemplate.PACKAGE_LIST_PATH)
                    .Replace ("{from}", request.From.ToString ())
                    .Replace ("{to}", request.To.ToString())
                    .Build();

            try 
            {
                string response = restClient.Get(path);
                Silanis.ESL.API.Result<Silanis.ESL.API.Package> results = JsonConvert.DeserializeObject<Silanis.ESL.API.Result<Silanis.ESL.API.Package>> (response, settings);

                return ConvertToPage(results, request);
            }
            catch (Exception e)
            {
                Console.WriteLine (e.StackTrace);
                throw new EslException ("Could not get template list. Exception: " + e.Message); 
            }
        }
Exemplo n.º 47
0
 /// <summary>
 /// 读取站内信列表信息
 /// </summary>
 /// <param name="request">页请求信息</param>
 /// <returns>站内信列表分页信息</returns>
 public override PageData <MessageOutputDto> Read(PageRequest request)
 {
     return(base.Read(request));
 }
Exemplo n.º 48
0
        public async Task <IActionResult> GetAllPaging(PageRequest request)
        {
            var model = await _pageService.GetAllPaging(request);

            return(new OkObjectResult(model));
        }
Exemplo n.º 49
0
 public override void ProcessPageRequest(PageRequest request, ViewPage page)
 {
     SharedBusinessRules.SetFormatField(page);
 }
        /// <summary>
        /// Download the web page specified in the ssUri
        /// </summary>
        /// <param name="sender">sender of the request</param>
        /// <param name="userState">user state - can be null</param>
        /// <param name="ssUri">uri to the page to download</param>
        /// <param name="callback">callback to call when download is complete</param>
        public void DownloadPageAsync(object sender, object userState, SmallUri ssUri, PageAsyncCallback callback)
        {
            if (_disposed)
            {
                callback(this, new PageCompletedEventArgs(new ObjectDisposedException("this"), false, userState));
                return;
            }

            if (default(SmallUri) == ssUri)
            {
                if (callback != null)
                    callback(this, new PageCompletedEventArgs(new ArgumentException("The requested page doesn't exist.", "ssUri"), false, userState));
                return;
            }

            // Make asynchronous request to download the image and get the local path.
            var pageRequest = new PageRequest
            {
                Sender = sender,
                UserState = userState,
                SmallUri = ssUri,
                Callback = callback
            };

            bool needToQueue = false;
            lock (_webLock)
            {
                needToQueue = !_asyncWebRequestPool.HasPendingRequests;
                _activeWebRequests.Enqueue(pageRequest);
            }

            if (needToQueue)
                _asyncWebRequestPool.QueueRequest(_ProcessNextWebRequest, null);
        }
Exemplo n.º 51
0
		private Page<DocumentPackage> ConvertToPage (Silanis.ESL.API.Result<Silanis.ESL.API.Package> results, PageRequest request)
		{
			IList<DocumentPackage> converted = new List<DocumentPackage> ();

			foreach (Silanis.ESL.API.Package package in results.Results)
			{
				DocumentPackage dp = new PackageBuilder (package).Build ();

				converted.Add (dp);
			}

			return new Page<DocumentPackage> (converted, results.Count, request);
		}
Exemplo n.º 52
0
        /// <summary>
        /// Deletes a page from a document in an template. Deletes a page from a document in a template based on the page number.
        /// </summary>
 	    ///<param name="accountId">The external account number (int) or account ID Guid.</param><param name="templateId">The ID of the template being accessed.</param><param name="documentId">The ID of the document being accessed.</param><param name="pageNumber">The page number being accessed.</param> <param name="pageRequest">TBD Description</param>
		/// <returns>7Task of void</returns>
        public async System.Threading.Tasks.Task DeleteDocumentPageAsync (string accountId, string templateId, string documentId, string pageNumber, PageRequest pageRequest)
        {
             await DeleteDocumentPageAsyncWithHttpInfo(accountId, templateId, documentId, pageNumber, pageRequest);

        }
 public async Task <PageList <AuditLogOutputPageDto> > GetAuditLogPageAsync([FromBody] PageRequest request)
 {
     return((await _auditStore.GetAuditLogPageAsync(request)).ToPageList());
 }
 public async Task <List <TDocumentHeader> > FindAllAsync(Expression <Func <TDocumentHeader, bool> > predicate, PageRequest pageRequest)
 {
     return(await SelectEntityQuery.Where(predicate).PagedSortBy(pageRequest).ToListAsync());
 }
Exemplo n.º 55
0
        /// <summary>
        /// Deletes a page from a document in an template. Deletes a page from a document in a template based on the page number.
        /// </summary>
 	    ///<param name="accountId">The external account number (int) or account ID Guid.</param><param name="templateId">The ID of the template being accessed.</param><param name="documentId">The ID of the document being accessed.</param><param name="pageNumber">The page number being accessed.</param> <param name="pageRequest">TBD Description</param>
		/// <returns>5</returns>
        public void DeleteDocumentPage (string accountId, string templateId, string documentId, string pageNumber, PageRequest pageRequest)
        {
             DeleteDocumentPageWithHttpInfo(accountId, templateId, documentId, pageNumber, pageRequest);
        }
Exemplo n.º 56
0
        public async Task <IActionResult> GetAllUserPaging([FromBody] PageRequest request)
        {
            var listUserPaging = await _userSerVice.GetAllUserPaging(request);

            return(Ok(listUserPaging));
        }
Exemplo n.º 57
0
        /// <summary>
        /// Deletes a page from a document in an template. Deletes a page from a document in a template based on the page number.
        /// </summary>
	    ///<param name="accountId">The external account number (int) or account ID Guid.</param><param name="templateId">The ID of the template being accessed.</param><param name="documentId">The ID of the document being accessed.</param><param name="pageNumber">The page number being accessed.</param> <param name="pageRequest">TBD Description</param>
		/// <returns>8Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task<ApiResponse<Object>> DeleteDocumentPageAsyncWithHttpInfo (string accountId, string templateId, string documentId, string pageNumber, PageRequest pageRequest)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null) throw new ApiException(400, "Missing required parameter 'accountId' when calling DeleteDocumentPage");
            // verify the required parameter 'templateId' is set
            if (templateId == null) throw new ApiException(400, "Missing required parameter 'templateId' when calling DeleteDocumentPage");
            // verify the required parameter 'documentId' is set
            if (documentId == null) throw new ApiException(400, "Missing required parameter 'documentId' when calling DeleteDocumentPage");
            // verify the required parameter 'pageNumber' is set
            if (pageNumber == null) throw new ApiException(400, "Missing required parameter 'pageNumber' when calling DeleteDocumentPage");
            
    
            var path_ = "/v2/accounts/{accountId}/templates/{templateId}/documents/{documentId}/pages/{pageNumber}";
    
            var pathParams = new Dictionary<String, String>();
            var queryParams = new Dictionary<String, String>();
            var headerParams = new Dictionary<String, String>();
            var formParams = new Dictionary<String, String>();
            var fileParams = new Dictionary<String, FileParameter>();
            String postBody = null;

            // to determine the Accept header
            String[] http_header_accepts = new String[] {
                "application/json"
            };
            String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts);
            if (http_header_accept != null)
                headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts));

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            pathParams.Add("format", "json");
            if (accountId != null) pathParams.Add("accountId", Configuration.ApiClient.ParameterToString(accountId)); // path parameter
            if (templateId != null) pathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter
            if (documentId != null) pathParams.Add("documentId", Configuration.ApiClient.ParameterToString(documentId)); // path parameter
            if (pageNumber != null) pathParams.Add("pageNumber", Configuration.ApiClient.ParameterToString(pageNumber)); // path parameter
            

						
			
			

            
            
            postBody = Configuration.ApiClient.Serialize(pageRequest); // http body (model) parameter
            

            

            // make the HTTP request
            IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams);

            int statusCode = (int) response.StatusCode;
 
            if (statusCode >= 400)
                throw new ApiException (statusCode, "Error calling DeleteDocumentPage: " + response.Content, response.Content);
            else if (statusCode == 0)
                throw new ApiException (statusCode, "Error calling DeleteDocumentPage: " + response.ErrorMessage, response.ErrorMessage);

            
            return new ApiResponse<Object>(statusCode,
                response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                null);
        }
Exemplo n.º 58
0
        public async Task <IActionResult> GetAllProductPaging([FromBody] PageRequest request)
        {
            var list = await _reViewProductSerVice.GetAllReView(request);

            return(Ok(list));
        }
Exemplo n.º 59
0
        public static void Process(ViewPage page, PageRequest request)
        {
            EventTracker tracker = new EventTracker();

            tracker.InternalProcess(page, request);
        }
Exemplo n.º 60
0
 public ViewPage GetPage(string controller, string view, PageRequest request)
 {
     return(ControllerFactory.CreateDataController().GetPage(controller, view, request));
 }