Exemple #1
0
        public List <Indico.BusinessObjects.CoordinatorEmailAddressBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.CoordinatorEmailAddress> oQuery =
                (from o in context.CoordinatorEmailAddress
                 where
                 (this.ID == 0 || this.ID == o.ID) &&
                 (this.User == 0 || this.User == o.User.ID) &&
                 ((o.EmailAddress.Contains(this.EmailAddress)) ||
                  (this.EmailAddress == null))
                 orderby o.ID
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.ID).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.CoordinatorEmailAddressBO> coordinatoremailaddresss = IQueryableToList(oQuery);

            if (this.Context == null)
            {
                context.Dispose();
            }

            return(coordinatoremailaddresss);
        }
        public List <Indico.BusinessObjects.ArtWorktAccessoryBO> SearchLikeAndObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.ArtWorktAccessory> oQuery =
                (from o in context.ArtWorktAccessory
                 where
                 (this.ID == 0 || o.ID == this.ID) &&
                 (this.ArtWork == 0 || o.ArtWork.ID == this.ArtWork) &&
                 (this.Accessory == null || o.Accessory.ID == this.Accessory) &&
                 (this.AccessoryColor == null || o.AccessoryColor.ID == this.AccessoryColor)
                 orderby o.ID
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.ID).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.ArtWorktAccessoryBO> artworktaccessorys = IQueryableToList(oQuery);

            if (this.Context == null)
            {
                context.Dispose();
            }

            return(artworktaccessorys);
        }
Exemple #3
0
        public List <Indico.BusinessObjects.ReturnDetailReportByDistributorBO> SearchLikeAndObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = new IndicoEntities();
            IQueryable <Indico.DAL.ReturnDetailReportByDistributor> oQuery =
                (from o in context.ReturnDetailReportByDistributor
                 where
                 (this.MonthAndYear == null || o.MonthAndYear.Contains(this.MonthAndYear)) &&
                 (this.ID == null || o.ID == this.ID) &&
                 (this.Client == null || o.Client.Contains(this.Client)) &&
                 (this.Quantity == null || o.Quantity == this.Quantity) &&
                 (this.QuantityPercentage == null || o.QuantityPercentage == this.QuantityPercentage) &&
                 (this.Value == null || o.Value == this.Value) &&
                 (this.ValuePercentage == null || o.ValuePercentage == this.ValuePercentage) &&
                 (this.AvgPrice == null || o.AvgPrice == this.AvgPrice)
                 orderby o.MonthAndYear
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.MonthAndYear).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.ReturnDetailReportByDistributorBO> returndetailreportbydistributors = IQueryableToList(oQuery);

            context.Dispose();
            return(returndetailreportbydistributors);
        }
Exemple #4
0
        public List <Indico.BusinessObjects.PriceChangeEmailListBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.PriceChangeEmailList> oQuery =
                (from o in context.PriceChangeEmailList
                 where
                 (this.ID == 0 || this.ID == o.ID) &&
                 (this.User == null || this.User == o.User.ID) &&
                 (this.IsCC == false || this.IsCC == o.IsCC)

                 orderby o.ID
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.ID).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.PriceChangeEmailListBO> pricechangeemaillists = IQueryableToList(oQuery);

            if (this.Context == null)
            {
                context.Dispose();
            }

            return(pricechangeemaillists);
        }
        public List <Indico.BusinessObjects.AutoOrderNumberBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.AutoOrderNumber> oQuery =
                (from o in context.AutoOrderNumber
                 where
                 (this.ID == 0 || this.ID == o.ID) &&
                 (this.CreatedDate == DateTime.MinValue || this.CreatedDate == o.CreatedDate) &&
                 ((o.Name.Contains(this.Name)) ||
                  (this.Name == null))
                 orderby o.ID
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.ID).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.AutoOrderNumberBO> autoordernumbers = IQueryableToList(oQuery);

            if (this.Context == null)
            {
                context.Dispose();
            }

            return(autoordernumbers);
        }
Exemple #6
0
        public List <Indico.BusinessObjects.SettingsBO> SearchLikeAndObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.Settings> oQuery =
                (from o in context.Settings
                 where
                 (this.ID == 0 || o.ID == this.ID) &&
                 (this.Name == string.Empty || o.Name.Contains(this.Name)) &&
                 (this.Key == string.Empty || o.Key.Contains(this.Key)) &&
                 (this.Value == null || o.Value.Contains(this.Value))
                 orderby o.ID
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.ID).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.SettingsBO> settingss = IQueryableToList(oQuery);

            if (this.Context == null)
            {
                context.Dispose();
            }

            return(settingss);
        }
Exemple #7
0
        public List <Indico.BusinessObjects.VisualLayoutFabricBO> SearchLikeAndObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.VisualLayoutFabric> oQuery =
                (from o in context.VisualLayoutFabric
                 where
                 (this.ID == 0 || o.ID == this.ID) &&
                 (this.Fabric == 0 || o.Fabric.ID == this.Fabric) &&
                 (this.VisualLayout == 0 || o.VisualLayout.ID == this.VisualLayout) &&
                 (this.FabricCodeType == null || o.FabricCodeType.ID == this.FabricCodeType)
                 orderby o.ID
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.ID).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.VisualLayoutFabricBO> visuallayoutfabrics = IQueryableToList(oQuery);

            if (this.Context == null)
            {
                context.Dispose();
            }

            return(visuallayoutfabrics);
        }
Exemple #8
0
        public List <Indico.BusinessObjects.PatternCompressionImageBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.PatternCompressionImage> oQuery =
                (from o in context.PatternCompressionImage
                 where
                 (this.ID == 0 || this.ID == o.ID) &&
                 ((o.Filename.Contains(this.Filename)) ||
                  (o.Extension.Contains(this.Extension)) ||
                  (this.Filename == null && this.Extension == null))
                 orderby o.ID
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.ID).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.PatternCompressionImageBO> patterncompressionimages = IQueryableToList(oQuery);

            if (this.Context == null)
            {
                context.Dispose();
            }

            return(patterncompressionimages);
        }
Exemple #9
0
        public List <Indico.BusinessObjects.DistributorPriceMarkupBO> SearchLikeAndObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.DistributorPriceMarkup> oQuery =
                (from o in context.DistributorPriceMarkup
                 where
                 (this.ID == 0 || o.ID == this.ID) &&
                 (this.Distributor == null || o.Distributor.ID == this.Distributor) &&
                 (this.PriceLevel == 0 || o.PriceLevel.ID == this.PriceLevel) &&
                 (this.Markup == 0 || o.Markup == this.Markup)
                 orderby o.ID
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.ID).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.DistributorPriceMarkupBO> distributorpricemarkups = IQueryableToList(oQuery);

            if (this.Context == null)
            {
                context.Dispose();
            }

            return(distributorpricemarkups);
        }
Exemple #10
0
        public List <Indico.BusinessObjects.GetMeasureLocForPatternSizeViewBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = new IndicoEntities();
            IQueryable <Indico.DAL.GetMeasureLocForPatternSizeView> oQuery =
                (from o in context.GetMeasureLocForPatternSizeView
                 where
                 (this.Pattern == null || this.Pattern == o.Pattern) &&
                 (this.Size == null || this.Size == o.Size) &&
                 (this.SeqNo == null || this.SeqNo == o.SeqNo) &&
                 (this.Val == null || this.Val == o.Val) &&
                 ((o.SizeName.Contains(this.SizeName)) ||
                  (o.Key.Contains(this.Key)) ||
                  (o.Name.Contains(this.Name)) ||
                  (this.SizeName == null && this.Key == null && this.Name == null))
                 orderby o.Pattern
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.Pattern).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.GetMeasureLocForPatternSizeViewBO> getmeasurelocforpatternsizeviews = IQueryableToList(oQuery);

            context.Dispose();
            return(getmeasurelocforpatternsizeviews);
        }
Exemple #11
0
        public List <Indico.BusinessObjects.CategoryBO> SearchObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.Category> oQuery =
                (from o in context.Category
                 where
                 (this.ID == 0 || this.ID == o.ID) &&
                 (this.Name == string.Empty || this.Name == o.Name) &&
                 (this.Description == null || this.Description == o.Description)
                 orderby o.ID
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.ID).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.CategoryBO> categorys = IQueryableToList(oQuery);

            if (this.Context == null)
            {
                context.Dispose();
            }

            return(categorys);
        }
Exemple #12
0
        public List <Indico.BusinessObjects.PatternItemAttributeSubBO> SearchLikeAndObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.PatternItemAttributeSub> oQuery =
                (from o in context.PatternItemAttributeSub
                 where
                 (this.ID == 0 || o.ID == this.ID) &&
                 (this.Pattern == 0 || o.Pattern.ID == this.Pattern) &&
                 (this.ItemAttribute == 0 || o.ItemAttribute.ID == this.ItemAttribute)
                 orderby o.ID
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.ID).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.PatternItemAttributeSubBO> patternitemattributesubs = IQueryableToList(oQuery);

            if (this.Context == null)
            {
                context.Dispose();
            }

            return(patternitemattributesubs);
        }
        public List <Indico.BusinessObjects.ReturnProductionCapacitiesViewBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = new IndicoEntities();
            IQueryable <Indico.DAL.ReturnProductionCapacitiesView> oQuery =
                (from o in context.ReturnProductionCapacitiesView
                 where
                 (this.Firms == null || this.Firms == o.Firms) &&
                 (this.ResevationOrders == null || this.ResevationOrders == o.ResevationOrders) &&
                 (this.Resevations == null || this.Resevations == o.Resevations) &&
                 (this.Holds == null || this.Holds == o.Holds) &&
                 (this.Less5Items == null || this.Less5Items == o.Less5Items) &&
                 (this.Samples == null || this.Samples == o.Samples)

                 orderby o.Firms
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.Firms).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.ReturnProductionCapacitiesViewBO> returnproductioncapacitiesviews = IQueryableToList(oQuery);

            context.Dispose();
            return(returnproductioncapacitiesviews);
        }
Exemple #14
0
        public List <Indico.BusinessObjects.SupplierDetailsViewBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = new IndicoEntities();
            IQueryable <Indico.DAL.SupplierDetailsView> oQuery =
                (from o in context.SupplierDetailsView
                 where
                 (this.Supplier == null || this.Supplier == o.Supplier) &&
                 (this.CountryID == null || this.CountryID == o.CountryID) &&
                 (this.IsAccessoriesWherethisSupplier == null || this.IsAccessoriesWherethisSupplier == o.IsAccessoriesWherethisSupplier) &&
                 (this.IsFabricCodesWherethisSupplier == null || this.IsFabricCodesWherethisSupplier == o.IsFabricCodesWherethisSupplier) &&
                 ((o.Name.Contains(this.Name)) ||
                  (o.Country.Contains(this.Country)) ||
                  (this.Name == null && this.Country == null))
                 orderby o.Supplier
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.Supplier).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.SupplierDetailsViewBO> supplierdetailsviews = IQueryableToList(oQuery);

            context.Dispose();
            return(supplierdetailsviews);
        }
        public List <Indico.BusinessObjects.ProductSequenceBO> SearchLikeAndObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.ProductSequence> oQuery =
                (from o in context.ProductSequence
                 where
                 (this.ID == 0 || o.ID == this.ID) &&
                 (this.Number == 0 || o.Number == this.Number) &&
                 (this.Description == null || o.Description.Contains(this.Description))
                 orderby o.ID
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.ID).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.ProductSequenceBO> productsequences = IQueryableToList(oQuery);

            if (this.Context == null)
            {
                context.Dispose();
            }

            return(productsequences);
        }
Exemple #16
0
        public List <Indico.BusinessObjects.ItemAttributesDetailsViewBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = new IndicoEntities();
            IQueryable <Indico.DAL.ItemAttributesDetailsView> oQuery =
                (from o in context.ItemAttributesDetailsView
                 where
                 (this.Attribute == null || this.Attribute == o.Attribute) &&
                 (this.ItemID == null || this.ItemID == o.ItemID) &&
                 (this.IsItemAttributesSubWherethisFabricCode == null || this.IsItemAttributesSubWherethisFabricCode == o.IsItemAttributesSubWherethisFabricCode) &&
                 ((o.Name.Contains(this.Name)) ||
                  (o.Description.Contains(this.Description)) ||
                  (o.Item.Contains(this.Item)) ||
                  (this.Name == null && this.Description == null && this.Item == null))
                 orderby o.Attribute
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.Attribute).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.ItemAttributesDetailsViewBO> itemattributesdetailsviews = IQueryableToList(oQuery);

            context.Dispose();
            return(itemattributesdetailsviews);
        }
        public List <Indico.BusinessObjects.HSCodeDetailsBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = new IndicoEntities();
            IQueryable <Indico.DAL.HSCodeDetails> oQuery =
                (from o in context.HSCodeDetails
                 where
                 (this.HSCode == null || this.HSCode == o.HSCode) &&
                 (this.ItemSubCategoryID == null || this.ItemSubCategoryID == o.ItemSubCategoryID) &&
                 (this.GenderID == null || this.GenderID == o.GenderID) &&
                 ((o.ItemSubCategory.Contains(this.ItemSubCategory)) ||
                  (o.Gender.Contains(this.Gender)) ||
                  (o.Code.Contains(this.Code)) ||
                  (this.ItemSubCategory == null && this.Gender == null && this.Code == null))
                 orderby o.HSCode
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.HSCode).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.HSCodeDetailsBO> hscodedetailss = IQueryableToList(oQuery);

            context.Dispose();
            return(hscodedetailss);
        }
        public List <Indico.BusinessObjects.ReturnDetailReportByClientBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = new IndicoEntities();
            IQueryable <Indico.DAL.ReturnDetailReportByClient> oQuery =
                (from o in context.ReturnDetailReportByClient
                 where
                 (this.Quantity == null || this.Quantity == o.Quantity) &&
                 (this.Price == null || this.Price == o.Price) &&
                 (this.Value == null || this.Value == o.Value) &&
                 ((o.VLName.Contains(this.VLName)) ||
                  (o.SubItemName.Contains(this.SubItemName)) ||
                  (this.VLName == null && this.SubItemName == null))
                 orderby o.VLName
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.VLName).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.ReturnDetailReportByClientBO> returndetailreportbyclients = IQueryableToList(oQuery);

            context.Dispose();
            return(returndetailreportbyclients);
        }
        public List <Indico.BusinessObjects.ReturnDistributorDetailsViewBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = new IndicoEntities();
            IQueryable <Indico.DAL.ReturnDistributorDetailsView> oQuery =
                (from o in context.ReturnDistributorDetailsView
                 where
                 (this.Distributor == null || this.Distributor == o.Distributor) &&
                 (this.IsDistributor == null || this.IsDistributor == o.IsDistributor) &&
                 (this.CreatedDate == null || this.CreatedDate == o.CreatedDate) &&
                 (this.ModifiedDate == null || this.ModifiedDate == o.ModifiedDate) &&
                 (this.IsActive == null || this.IsActive == o.IsActive) &&
                 (this.IsDelete == null || this.IsDelete == o.IsDelete) &&
                 (this.Clients == null || this.Clients == o.Clients) &&
                 (this.DistributorLabels == null || this.DistributorLabels == o.DistributorLabels) &&
                 (this.DistributorPriceLevelCosts == null || this.DistributorPriceLevelCosts == o.DistributorPriceLevelCosts) &&
                 (this.DistributorPriceMarkups == null || this.DistributorPriceMarkups == o.DistributorPriceMarkups) &&
                 (this.DespatchTo == null || this.DespatchTo == o.DespatchTo) &&
                 (this.Order == null || this.Order == o.Order) &&
                 (this.ShipTo == null || this.ShipTo == o.ShipTo) &&
                 ((o.Type.Contains(this.Type)) ||
                  (o.Name.Contains(this.Name)) ||
                  (o.Number.Contains(this.Number)) ||
                  (o.Address1.Contains(this.Address1)) ||
                  (o.Address2.Contains(this.Address2)) ||
                  (o.City.Contains(this.City)) ||
                  (o.State.Contains(this.State)) ||
                  (o.PostCode.Contains(this.PostCode)) ||
                  (o.Country.Contains(this.Country)) ||
                  (o.Phone1.Contains(this.Phone1)) ||
                  (o.Phone2.Contains(this.Phone2)) ||
                  (o.Fax.Contains(this.Fax)) ||
                  (o.NickName.Contains(this.NickName)) ||
                  (o.PrimaryCoordinator.Contains(this.PrimaryCoordinator)) ||
                  (o.Owner.Contains(this.Owner)) ||
                  (o.Creator.Contains(this.Creator)) ||
                  (o.Modifier.Contains(this.Modifier)) ||
                  (o.SecondaryCoordinator.Contains(this.SecondaryCoordinator)) ||
                  (this.Type == null && this.Name == null && this.Number == null && this.Address1 == null && this.Address2 == null && this.City == null && this.State == null && this.PostCode == null && this.Country == null && this.Phone1 == null && this.Phone2 == null && this.Fax == null && this.NickName == null && this.PrimaryCoordinator == null && this.Owner == null && this.Creator == null && this.Modifier == null && this.SecondaryCoordinator == null))
                 orderby o.Distributor
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.Distributor).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.ReturnDistributorDetailsViewBO> returndistributordetailsviews = IQueryableToList(oQuery);

            context.Dispose();
            return(returndistributordetailsviews);
        }
        public List <Indico.BusinessObjects.FabricCodeDetailsViewBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = new IndicoEntities();
            IQueryable <Indico.DAL.FabricCodeDetailsView> oQuery =
                (from o in context.FabricCodeDetailsView
                 where
                 (this.Fabric == null || this.Fabric == o.Fabric) &&
                 (this.SupplierID == null || this.SupplierID == o.SupplierID) &&
                 (this.CountryID == null || this.CountryID == o.CountryID) &&
                 (this.FabricPrice == null || this.FabricPrice == o.FabricPrice) &&
                 (this.LandedCurrency == null || this.LandedCurrency == o.LandedCurrency) &&
                 (this.UnitID == null || this.UnitID == o.UnitID) &&
                 (this.FabricColorID == null || this.FabricColorID == o.FabricColorID) &&
                 (this.IsActive == null || this.IsActive == o.IsActive) &&
                 (this.IsPure == null || this.IsPure == o.IsPure) &&
                 (this.IsLiningFabric == null || this.IsLiningFabric == o.IsLiningFabric) &&
                 (this.IsCostSheetWherethisFabricCode == null || this.IsCostSheetWherethisFabricCode == o.IsCostSheetWherethisFabricCode) &&
                 (this.IsPriceWherethisFabricCode == null || this.IsPriceWherethisFabricCode == o.IsPriceWherethisFabricCode) &&
                 (this.IsQuoteWherethisFabricCode == null || this.IsQuoteWherethisFabricCode == o.IsQuoteWherethisFabricCode) &&
                 (this.IsVisualLayoutWherethisFabricCode == null || this.IsVisualLayoutWherethisFabricCode == o.IsVisualLayoutWherethisFabricCode) &&
                 (this.IsPatternSupportFabricWherethisFabricCode == null || this.IsPatternSupportFabricWherethisFabricCode == o.IsPatternSupportFabricWherethisFabricCode) &&
                 ((o.Code.Contains(this.Code)) ||
                  (o.Name.Contains(this.Name)) ||
                  (o.Material.Contains(this.Material)) ||
                  (o.GSM.Contains(this.GSM)) ||
                  (o.Supplier.Contains(this.Supplier)) ||
                  (o.Country.Contains(this.Country)) ||
                  (o.DenierCount.Contains(this.DenierCount)) ||
                  (o.Filaments.Contains(this.Filaments)) ||
                  (o.NickName.Contains(this.NickName)) ||
                  (o.SerialOrder.Contains(this.SerialOrder)) ||
                  (o.FabricWidth.Contains(this.FabricWidth)) ||
                  (o.Unit.Contains(this.Unit)) ||
                  (o.FabricColor.Contains(this.FabricColor)) ||
                  (o.ColorCode.Contains(this.ColorCode)) ||
                  (this.Code == null && this.Name == null && this.Material == null && this.GSM == null && this.Supplier == null && this.Country == null && this.DenierCount == null && this.Filaments == null && this.NickName == null && this.SerialOrder == null && this.FabricWidth == null && this.Unit == null && this.FabricColor == null && this.ColorCode == null))
                 orderby o.Fabric
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.Fabric).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.FabricCodeDetailsViewBO> fabriccodedetailsviews = IQueryableToList(oQuery);

            context.Dispose();
            return(fabriccodedetailsviews);
        }
        public List <Indico.BusinessObjects.CostSheetDetailsViewBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = new IndicoEntities();
            IQueryable <Indico.DAL.CostSheetDetailsView> oQuery =
                (from o in context.CostSheetDetailsView
                 where
                 (this.CostSheet == null || this.CostSheet == o.CostSheet) &&
                 (this.QuotedFOBCost == null || this.QuotedFOBCost == o.QuotedFOBCost) &&
                 (this.QuotedCIF == null || this.QuotedCIF == o.QuotedCIF) &&
                 (this.QuotedMP == null || this.QuotedMP == o.QuotedMP) &&
                 (this.ExchangeRate == null || this.ExchangeRate == o.ExchangeRate) &&
                 (this.SMV == null || this.SMV == o.SMV) &&
                 (this.SMVRate == null || this.SMVRate == o.SMVRate) &&
                 (this.CalculateCM == null || this.CalculateCM == o.CalculateCM) &&
                 (this.TotalFabricCost == null || this.TotalFabricCost == o.TotalFabricCost) &&
                 (this.TotalAccessoriesCost == null || this.TotalAccessoriesCost == o.TotalAccessoriesCost) &&
                 (this.HPCost == null || this.HPCost == o.HPCost) &&
                 (this.LabelCost == null || this.LabelCost == o.LabelCost) &&
                 (this.CM == null || this.CM == o.CM) &&
                 (this.JKFOBCost == null || this.JKFOBCost == o.JKFOBCost) &&
                 (this.Roundup == null || this.Roundup == o.Roundup) &&
                 (this.DutyRate == null || this.DutyRate == o.DutyRate) &&
                 (this.SubCons == null || this.SubCons == o.SubCons) &&
                 (this.MarginRate == null || this.MarginRate == o.MarginRate) &&
                 (this.Duty == null || this.Duty == o.Duty) &&
                 (this.FOBAUD == null || this.FOBAUD == o.FOBAUD) &&
                 (this.AirFregiht == null || this.AirFregiht == o.AirFregiht) &&
                 (this.ImpCharges == null || this.ImpCharges == o.ImpCharges) &&
                 (this.Landed == null || this.Landed == o.Landed) &&
                 (this.MGTOH == null || this.MGTOH == o.MGTOH) &&
                 (this.IndicoOH == null || this.IndicoOH == o.IndicoOH) &&
                 (this.InkCost == null || this.InkCost == o.InkCost) &&
                 (this.PaperCost == null || this.PaperCost == o.PaperCost) &&
                 (this.ShowToIndico == null || this.ShowToIndico == o.ShowToIndico) &&
                 ((o.Pattern.Contains(this.Pattern)) ||
                  (o.Fabric.Contains(this.Fabric)) ||
                  (o.Category.Contains(this.Category)) ||
                  (this.Pattern == null && this.Fabric == null && this.Category == null))
                 orderby o.CostSheet
                 select o);

            if (sortExpression != null && sortExpression.Length > 0)
            {
                // using System.Linq.Dynamic here in Dynamic.cs;
                if (sortDescending)
                {
                    oQuery = oQuery.OrderBy(sortExpression + " desc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
                else
                {
                    oQuery = oQuery.OrderBy(sortExpression + " asc").Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
                }
            }
            else
            {
                oQuery = oQuery.OrderBy(obj => obj.CostSheet).Skip(startIndex).Take((maximumRows == 0) ? Int32.MaxValue : maximumRows);
            }

            List <Indico.BusinessObjects.CostSheetDetailsViewBO> costsheetdetailsviews = IQueryableToList(oQuery);

            context.Dispose();
            return(costsheetdetailsviews);
        }