public int SearchLikeOrObjectsCount()
        {
            IndicoEntities context = new IndicoEntities();

            return((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).Count());
        }
Exemple #2
0
 internal void SetDAL(Indico.DAL.ReturnProductionPlanningDetailsView obj, IndicoEntities context)
 {
     // set the Indico.DAL.ReturnProductionPlanningDetailsView properties
     obj.WeeklyProductionCapacity = Convert.ToInt32(WeeklyProductionCapacity);
     obj.Week           = Week;
     obj.OrderDetail    = Convert.ToInt32(OrderDetail);
     obj.Pattern        = Pattern;
     obj.OrderType      = OrderType;
     obj.PurchaseOrder  = PurchaseOrder;
     obj.Product        = Product;
     obj.Quantity       = Convert.ToInt32(Quantity);
     obj.SMV            = Convert.ToDecimal(SMV);
     obj.TotalSMV       = Convert.ToDecimal(TotalSMV);
     obj.Client         = Client;
     obj.Mode           = Mode;
     obj.ShipTo         = ShipTo;
     obj.Port           = Port;
     obj.Country        = Country;
     obj.ProductionLine = Convert.ToInt32(ProductionLine);
     obj.SewingDate     = Convert.ToDateTime(SewingDate);
     obj.FOCPenalty     = Convert.ToBoolean(FOCPenalty);
 }
Exemple #3
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 #4
0
        public int SearchLikeAndObjectsCount()
        {
            IndicoEntities context = new IndicoEntities();

            return((from o in context.ReturnDownloadPriceListView
                    where
                    (this.Distributor == null || o.Distributor == this.Distributor) &&
                    (this.Label == null || o.Label == this.Label) &&
                    (this.Name == null || o.Name.Contains(this.Name)) &&
                    (this.PriceTerm == null || o.PriceTerm.Contains(this.PriceTerm)) &&
                    (this.EditedPrice == null || o.EditedPrice == this.EditedPrice) &&
                    (this.CreativeDesign == null || o.CreativeDesign == this.CreativeDesign) &&
                    (this.StudioDesign == null || o.StudioDesign == this.StudioDesign) &&
                    (this.ThirdPartyDesign == null || o.ThirdPartyDesign == this.ThirdPartyDesign) &&
                    (this.Position1 == null || o.Position1 == this.Position1) &&
                    (this.Position2 == null || o.Position2 == this.Position2) &&
                    (this.Position3 == null || o.Position3 == this.Position3) &&
                    (this.FileName == null || o.FileName.Contains(this.FileName)) &&
                    (this.CreatedDate == null || o.CreatedDate == this.CreatedDate)
                    orderby o.Distributor
                    select o).Count());
        }
Exemple #5
0
        public List <Indico.BusinessObjects.DistributorSendMailCountBO> SearchLikeAndObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.DistributorSendMailCount> oQuery =
                (from o in context.DistributorSendMailCount
                 where
                 (this.ID == 0 || o.ID == this.ID) &&
                 (this.Distributor == 0 || o.Distributor.ID == this.Distributor) &&
                 (this.WeeklyProductionCapacity == 0 || o.WeeklyProductionCapacity.ID == this.WeeklyProductionCapacity) &&
                 (this.Count == null || o.Count == this.Count)
                 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.DistributorSendMailCountBO> distributorsendmailcounts = IQueryableToList(oQuery);

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

            return(distributorsendmailcounts);
        }
Exemple #6
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 #7
0
        internal Indico.DAL.Settings SetDAL(IndicoEntities context)
        {
            this._doNotUpdateDALObject = true;

            // set the Indico.DAL.Settings properties
            Indico.DAL.Settings obj = new Indico.DAL.Settings();

            if (this.ID > 0)
            {
                obj = context.Settings.FirstOrDefault <Settings>(o => o.ID == this.ID);
            }

            obj.Key   = this.Key;
            obj.Name  = this.Name;
            obj.Value = this.Value;



            this._doNotUpdateDALObject = false;

            return(obj);
        }
Exemple #8
0
        public List <Indico.BusinessObjects.SettingsBO> SearchObjects(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 || this.ID == o.ID) &&
                 (this.Name == string.Empty || this.Name == o.Name) &&
                 (this.Key == string.Empty || this.Key == o.Key) &&
                 (this.Value == null || this.Value == o.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 #9
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 #10
0
        public List <Indico.BusinessObjects.ClientTypeBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.ClientType> oQuery =
                (from o in context.ClientType
                 where
                 (this.ID == 0 || this.ID == o.ID) &&
                 ((o.Name.Contains(this.Name)) ||
                  (o.Description.Contains(this.Description)) ||
                  (this.Name == null && this.Description == 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.ClientTypeBO> clienttypes = IQueryableToList(oQuery);

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

            return(clienttypes);
        }
Exemple #11
0
        internal Indico.DAL.PriceLevel SetDAL(IndicoEntities context)
        {
            this._doNotUpdateDALObject = true;

            // set the Indico.DAL.PriceLevel properties
            Indico.DAL.PriceLevel obj = new Indico.DAL.PriceLevel();

            if (this.ID > 0)
            {
                obj = context.PriceLevel.FirstOrDefault <PriceLevel>(o => o.ID == this.ID);
            }

            obj.Name   = this.Name;
            obj.Volume = this.Volume;


            if (_distributorPriceMarkupsWhereThisIsPriceLevelLoaded)
            {
                BusinessObject.SynchroniseEntityList(
                    Indico.BusinessObjects.DistributorPriceMarkupBO.ToEntityList(this.DistributorPriceMarkupsWhereThisIsPriceLevel, context),
                    obj.DistributorPriceMarkupsWhereThisIsPriceLevel);
            }
            if (_labelPriceMarkupsWhereThisIsPriceLevelLoaded)
            {
                BusinessObject.SynchroniseEntityList(
                    Indico.BusinessObjects.LabelPriceMarkupBO.ToEntityList(this.LabelPriceMarkupsWhereThisIsPriceLevel, context),
                    obj.LabelPriceMarkupsWhereThisIsPriceLevel);
            }
            if (_priceLevelCostsWhereThisIsPriceLevelLoaded)
            {
                BusinessObject.SynchroniseEntityList(
                    Indico.BusinessObjects.PriceLevelCostBO.ToEntityList(this.PriceLevelCostsWhereThisIsPriceLevel, context),
                    obj.PriceLevelCostsWhereThisIsPriceLevel);
            }

            this._doNotUpdateDALObject = false;

            return(obj);
        }
Exemple #12
0
        public List <Indico.BusinessObjects.HSCodeBO> SearchLikeAndObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.HSCode> oQuery =
                (from o in context.HSCode
                 where
                 (this.ID == 0 || o.ID == this.ID) &&
                 (this.ItemSubCategory == 0 || o.ItemSubCategory.ID == this.ItemSubCategory) &&
                 (this.Gender == 0 || o.Gender.ID == this.Gender) &&
                 (this.Code == string.Empty || o.Code.Contains(this.Code))
                 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.HSCodeBO> hscodes = IQueryableToList(oQuery);

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

            return(hscodes);
        }
Exemple #13
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 #14
0
        public List <Indico.BusinessObjects.PatternAccessoryBO> SearchLikeOrObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.PatternAccessory> oQuery =
                (from o in context.PatternAccessory
                 where
                 (this.ID == 0 || this.ID == o.ID) &&
                 (this.Pattern == 0 || this.Pattern == o.Pattern.ID) &&
                 (this.Accessory == null || this.Accessory == o.Accessory.ID)

                 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.PatternAccessoryBO> patternaccessorys = IQueryableToList(oQuery);

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

            return(patternaccessorys);
        }
Exemple #15
0
        public List <Indico.BusinessObjects.PatternCompressionImageBO> SearchLikeAndObjects(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 || o.ID == this.ID) &&
                 (this.Filename == null || o.Filename.Contains(this.Filename)) &&
                 (this.Extension == null || o.Extension.Contains(this.Extension))
                 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);
        }
        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);
        }
Exemple #17
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.AcquiredVisulaLayoutNameBO> SearchLikeAndObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.AcquiredVisulaLayoutName> oQuery =
                (from o in context.AcquiredVisulaLayoutName
                 where
                 (this.ID == 0 || o.ID == this.ID) &&
                 (this.Name == string.Empty || o.Name.Contains(this.Name)) &&
                 (this.CreatedDate == DateTime.MinValue || o.CreatedDate == this.CreatedDate)
                 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.AcquiredVisulaLayoutNameBO> acquiredvisulalayoutnames = IQueryableToList(oQuery);

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

            return(acquiredvisulalayoutnames);
        }
        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);
        }
        internal Indico.DAL.OrderDetailStatus SetDAL(IndicoEntities context)
        {
            this._doNotUpdateDALObject = true;

            // set the Indico.DAL.OrderDetailStatus properties
            Indico.DAL.OrderDetailStatus obj = new Indico.DAL.OrderDetailStatus();

            if (this.ID > 0)
            {
                obj = context.OrderDetailStatus.FirstOrDefault <OrderDetailStatus>(o => o.ID == this.ID);
            }

            obj.Description = this.Description;
            obj.Name        = this.Name;
            obj.Priority    = this.Priority;

            if (this.Company != null && this.Company > 0)
            {
                obj.Company = context.Company.FirstOrDefault(o => o.ID == this.Company);
            }

            if (_factoryOrderDetialsWhereThisIsOrderDetailStatusLoaded)
            {
                BusinessObject.SynchroniseEntityList(
                    Indico.BusinessObjects.FactoryOrderDetialBO.ToEntityList(this.FactoryOrderDetialsWhereThisIsOrderDetailStatus, context),
                    obj.FactoryOrderDetialsWhereThisIsOrderDetailStatus);
            }
            if (_orderDetailsWhereThisIsStatusLoaded)
            {
                BusinessObject.SynchroniseEntityList(
                    Indico.BusinessObjects.OrderDetailBO.ToEntityList(this.OrderDetailsWhereThisIsStatus, context),
                    obj.OrderDetailsWhereThisIsStatus);
            }

            this._doNotUpdateDALObject = false;

            return(obj);
        }
Exemple #21
0
        public List <Indico.BusinessObjects.QuoteChangeEmailListBO> SearchLikeAndObjects(int maximumRows, int startIndex, string sortExpression, bool sortDescending)
        {
            IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
            IQueryable <Indico.DAL.QuoteChangeEmailList> oQuery =
                (from o in context.QuoteChangeEmailList
                 where
                 (this.ID == 0 || o.ID == this.ID) &&
                 (this.User == null || o.User.ID == this.User) &&
                 (this.IsCC == false || o.IsCC == this.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.QuoteChangeEmailListBO> quotechangeemaillists = IQueryableToList(oQuery);

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

            return(quotechangeemaillists);
        }
Exemple #22
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 int SearchLikeOrObjectsCount()
        {
            IndicoEntities context = new IndicoEntities();

            return((from o in context.PriceLevelCostView
                    where
                    (this.ID == null || this.ID == o.ID) &&
                    (this.Pattern == null || this.Pattern == o.Pattern) &&
                    (this.FabricCode == null || this.FabricCode == o.FabricCode) &&
                    (this.Item == null || this.Item == o.Item) &&
                    (this.SubItem == null || this.SubItem == o.SubItem) &&
                    (this.CoreCategory == null || this.CoreCategory == o.CoreCategory) &&
                    (this.ConvertionFactor == null || this.ConvertionFactor == o.ConvertionFactor) &&
                    (this.EnableForPriceList == null || this.EnableForPriceList == o.EnableForPriceList) &&
                    ((o.Number.Contains(this.Number)) ||
                     (o.NickName.Contains(this.NickName)) ||
                     (o.FabricCodeName.Contains(this.FabricCodeName)) ||
                     (o.ItemSubCategory.Contains(this.ItemSubCategory)) ||
                     (o.OtherCategories.Contains(this.OtherCategories)) ||
                     (this.Number == null && this.NickName == null && this.FabricCodeName == null && this.ItemSubCategory == null && this.OtherCategories == null))
                    orderby o.ID
                    select o).Count());
        }
Exemple #24
0
 internal void SetDAL(Indico.DAL.IndicoCIFPriceView obj, IndicoEntities context)
 {
     // set the Indico.DAL.IndicoCIFPriceView properties
     obj.CostSheetId      = Convert.ToInt32(CostSheetId);
     obj.CoreCategory     = CoreCategory;
     obj.ItemCategory     = ItemCategory;
     obj.PatternId        = Convert.ToInt32(PatternId);
     obj.PatternCode      = PatternCode;
     obj.PatternNickName  = PatternNickName;
     obj.FabricId         = Convert.ToInt32(FabricId);
     obj.FabricCode       = FabricCode;
     obj.FabricName       = FabricName;
     obj.FabricPrice      = Convert.ToDecimal(FabricPrice);
     obj.ConversionFactor = Convert.ToDecimal(ConversionFactor);
     obj.IndimanPrice     = Convert.ToDecimal(IndimanPrice);
     obj.QuotedFOBPrice   = Convert.ToDecimal(QuotedFOBPrice);
     obj.FOBCost          = Convert.ToDecimal(FOBCost);
     obj.LastModifier     = LastModifier;
     obj.ModifiedDate     = Convert.ToDateTime(ModifiedDate);
     obj.Remarks          = Remarks;
     obj.ActMgn           = Convert.ToDecimal(ActMgn);
     obj.QuotedMp         = Convert.ToDecimal(QuotedMp);
 }
        public int SearchLikeOrObjectsCount()
        {
            IndicoEntities context = new IndicoEntities();

            return((from o in context.EmbroideryDetailsView
                    where
                    (this.Embroidery == null || this.Embroidery == o.Embroidery) &&
                    (this.EmbStrikeOffDate == null || this.EmbStrikeOffDate == o.EmbStrikeOffDate) &&
                    (this.PhotoRequiredBy == null || this.PhotoRequiredBy == o.PhotoRequiredBy) &&
                    (this.CreatedDate == null || this.CreatedDate == o.CreatedDate) &&
                    (this.ModifiedDate == null || this.ModifiedDate == o.ModifiedDate) &&
                    ((o.JobName.Contains(this.JobName)) ||
                     (o.Distributor.Contains(this.Distributor)) ||
                     (o.Client.Contains(this.Client)) ||
                     (o.Coordinator.Contains(this.Coordinator)) ||
                     (o.Product.Contains(this.Product)) ||
                     (o.Creator.Contains(this.Creator)) ||
                     (o.Modifier.Contains(this.Modifier)) ||
                     (o.Assign.Contains(this.Assign)) ||
                     (this.JobName == null && this.Distributor == null && this.Client == null && this.Coordinator == null && this.Product == null && this.Creator == null && this.Modifier == null && this.Assign == null))
                    orderby o.Embroidery
                    select o).Count());
        }
        public int SearchLikeOrObjectsCount()
        {
            IndicoEntities context = new IndicoEntities();

            return((from o in context.UsersDetailsView
                    where
                    (this.User == null || this.User == o.User) &&
                    (this.IsDistributor == null || this.IsDistributor == o.IsDistributor) &&
                    (this.StatusID == null || this.StatusID == o.StatusID) &&
                    (this.IsActive == null || this.IsActive == o.IsActive) &&
                    (this.IsDeleted == null || this.IsDeleted == o.IsDeleted) &&
                    (this.Role == null || this.Role == o.Role) &&
                    ((o.Company.Contains(this.Company)) ||
                     (o.Status.Contains(this.Status)) ||
                     (o.Name.Contains(this.Name)) ||
                     (o.UserName.Contains(this.UserName)) ||
                     (o.Email.Contains(this.Email)) ||
                     (o.RoleName.Contains(this.RoleName)) ||
                     (o.CompanyType.Contains(this.CompanyType)) ||
                     (this.Company == null && this.Status == null && this.Name == null && this.UserName == null && this.Email == null && this.RoleName == null && this.CompanyType == null))
                    orderby o.User
                    select o).Count());
        }
Exemple #27
0
 internal void SetDAL(Indico.DAL.ReturnIndimanPriceListDataView obj, IndicoEntities context)
 {
     // set the Indico.DAL.ReturnIndimanPriceListDataView properties
     obj.SportsCategory      = SportsCategory;
     obj.OtherCategories     = OtherCategories;
     obj.PatternID           = Convert.ToInt32(PatternID);
     obj.ItemSubCategoris    = ItemSubCategoris;
     obj.NickName            = NickName;
     obj.FabricName          = FabricName;
     obj.FabricCodenNickName = FabricCodenNickName;
     obj.Number           = Number;
     obj.ConvertionFactor = Convert.ToDecimal(ConvertionFactor);
     obj.Price            = Convert.ToInt32(Price);
     obj.PriceLevelCost   = Convert.ToInt32(PriceLevelCost);
     obj.PriceLevel       = Convert.ToInt32(PriceLevel);
     obj.FactoryCost      = Convert.ToDecimal(FactoryCost);
     obj.IndimanCost      = Convert.ToDecimal(IndimanCost);
     obj.Distribuotor     = Convert.ToInt32(Distribuotor);
     obj.Markup           = Convert.ToDecimal(Markup);
     obj.EditedCIFPrice   = Convert.ToDecimal(EditedCIFPrice);
     obj.EditedFOBPrice   = Convert.ToDecimal(EditedFOBPrice);
     obj.ModifiedDate     = Convert.ToDateTime(ModifiedDate);
 }
        internal Indico.DAL.DistributorPriceLevelCost SetDAL(IndicoEntities context)
        {
            this._doNotUpdateDALObject = true;

            // set the Indico.DAL.DistributorPriceLevelCost properties
            Indico.DAL.DistributorPriceLevelCost obj = new Indico.DAL.DistributorPriceLevelCost();

            if (this.ID > 0)
            {
                obj = context.DistributorPriceLevelCost.FirstOrDefault <DistributorPriceLevelCost>(o => o.ID == this.ID);
            }

            obj.IndicoCost   = this.IndicoCost;
            obj.ModifiedDate = this.ModifiedDate;

            if (this.Distributor != null && this.Distributor > 0)
            {
                obj.Distributor = context.Company.FirstOrDefault(o => o.ID == this.Distributor);
            }
            if (this.Modifier > 0)
            {
                obj.Modifier = context.User.FirstOrDefault(o => o.ID == this.Modifier);
            }
            if (this.PriceLevelCost > 0)
            {
                obj.PriceLevelCost = context.PriceLevelCost.FirstOrDefault(o => o.ID == this.PriceLevelCost);
            }
            if (this.PriceTerm != null && this.PriceTerm > 0)
            {
                obj.PriceTerm = context.PriceTerm.FirstOrDefault(o => o.ID == this.PriceTerm);
            }


            this._doNotUpdateDALObject = false;

            return(obj);
        }
        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 int SearchLikeOrObjectsCount()
        {
            IndicoEntities context = new IndicoEntities();

            return((from o in context.ReservationDetailsView
                    where
                    (this.ID == null || this.ID == o.ID) &&
                    (this.OrderDate == null || this.OrderDate == o.OrderDate) &&
                    (this.PatternID == null || this.PatternID == o.PatternID) &&
                    (this.CoordinatorID == null || this.CoordinatorID == o.CoordinatorID) &&
                    (this.DistributorID == null || this.DistributorID == o.DistributorID) &&
                    (this.ShipToID == null || this.ShipToID == o.ShipToID) &&
                    (this.ShipmentModeID == null || this.ShipmentModeID == o.ShipmentModeID) &&
                    (this.ShipmentDate == null || this.ShipmentDate == o.ShipmentDate) &&
                    (this.Qty == null || this.Qty == o.Qty) &&
                    (this.UsedQty == null || this.UsedQty == o.UsedQty) &&
                    (this.Balance == null || this.Balance == o.Balance) &&
                    (this.DateCreated == null || this.DateCreated == o.DateCreated) &&
                    (this.DateModified == null || this.DateModified == o.DateModified) &&
                    (this.CreatorID == null || this.CreatorID == o.CreatorID) &&
                    (this.ModifierID == null || this.ModifierID == o.ModifierID) &&
                    (this.StatusID == null || this.StatusID == o.StatusID) &&
                    ((o.ReservationNo.Contains(this.ReservationNo)) ||
                     (o.Pattern.Contains(this.Pattern)) ||
                     (o.Coordinator.Contains(this.Coordinator)) ||
                     (o.Distributor.Contains(this.Distributor)) ||
                     (o.Client.Contains(this.Client)) ||
                     (o.ShipTo.Contains(this.ShipTo)) ||
                     (o.ShipmentMode.Contains(this.ShipmentMode)) ||
                     (o.Notes.Contains(this.Notes)) ||
                     (o.Creator.Contains(this.Creator)) ||
                     (o.Modifier.Contains(this.Modifier)) ||
                     (o.Status.Contains(this.Status)) ||
                     (this.ReservationNo == null && this.Pattern == null && this.Coordinator == null && this.Distributor == null && this.Client == null && this.ShipTo == null && this.ShipmentMode == null && this.Notes == null && this.Creator == null && this.Modifier == null && this.Status == null))
                    orderby o.ID
                    select o).Count());
        }