Beispiel #1
0
        public async Task <ActionResult> FeedShortAsync(string view)
        {
            var reslut = await Task.Factory.StartNew(() => {
                var db         = new BaseRepository();
                var structures = db.GetEntities <tbStructure>(p => p.typeID == 1);
                var ls         = db.GetEntities <LivePig>(p => p.feedSurplusDays < 1);
                List <AreaCollectModel> model = new List <AreaCollectModel>();
                foreach (var item in structures)
                {
                    var m = new AreaCollectModel
                    {
                        areaID   = item.ID,
                        areaName = item.name,
                        value    = ls.Count(p => p.areaID == item.ID)
                    };
                    model.Add(m);
                }

                //return model;
                return(PartialView(model));
            });

            //return PartialView(reslut);
            return(reslut);
        }
Beispiel #2
0
        public async Task <ActionResult> ContractedRaiserAsync(string view)
        {
            var reslut = await Task.Factory.StartNew(() => {
                var db         = new BaseRepository();
                var structures = db.GetEntities <tbStructure>(p => p.typeID == 1);
                var ls         = db.GetEntities <Pact>(p => p.statusFlag == 0);
                List <AreaCollectModel> model = new List <AreaCollectModel>();
                foreach (var item in structures)
                {
                    var m = new AreaCollectModel
                    {
                        areaID   = item.ID,
                        areaName = item.name,
                        value    = ls.Count(p => p.areaID == item.ID)
                    };
                    model.Add(m);
                }

                return(PartialView(model));;
            });

            return(reslut);
        }