Exemple #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            GreigeProduction rpt = new GreigeProduction();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
        public IQueryable <TLKNI_GreigeProduction> SOHGreigeProduction(KnitQueryParameters parameters)
        {
            IQueryable <TLKNI_GreigeProduction> GreigeProduction;

            if (!parameters.BoughtInFabric)
            {
                GreigeProduction = _context.TLKNI_GreigeProduction.Where(x => x.GreigeP_Captured && !x.GreigeP_Dye && x.GreigeP_weightAvail > 0 && !x.GreigeP_BoughtIn).AsQueryable();
            }
            else
            {
                GreigeProduction = _context.TLKNI_GreigeProduction.Where(x => x.GreigeP_Captured && !x.GreigeP_Dye && x.GreigeP_weightAvail > 0 && x.GreigeP_BoughtIn).AsQueryable();
            }

            if (parameters.Grade.Length != 0)
            {
                var GradePredicate = PredicateBuilder.False <TLKNI_GreigeProduction>();
                GreigeProduction = GreigeProduction.AsExpandable().Where(x => x.GreigeP_Grade.Contains(parameters.Grade.ToUpper()));
            }

            if (parameters.Greiges.Count > 0)
            {
                var GreigePredicate = PredicateBuilder.False <TLKNI_GreigeProduction>();
                foreach (var Greige in parameters.Greiges)
                {
                    var temp = Greige;
                    GreigePredicate = GreigePredicate.Or(s => s.GreigeP_Greige_Fk == temp.TLGreige_Id);
                }

                GreigeProduction = GreigeProduction.AsExpandable().Where(GreigePredicate);
            }

            if (parameters.WhseStores.Count > 0)
            {
                var WhsePredicate = PredicateBuilder.False <TLKNI_GreigeProduction>();
                foreach (var whse in parameters.WhseStores)
                {
                    var temp = whse;
                    WhsePredicate = WhsePredicate.Or(s => s.GreigeP_Store_FK == temp.WhStore_Id);
                }

                GreigeProduction = GreigeProduction.AsExpandable().Where(WhsePredicate);
            }


            return(GreigeProduction);
        }