예제 #1
0
        public ActionResult List(FormCollection fc)
        {
            var db     = new FarmRepository();
            var source = db.GetEntities <VaccineTask>(p => p.injectDate < new DateTime(2050, 12, 31));

            return(base.DataGrid(source));

            //return base.DataGrid<VaccineTask,IFarmTable>(new FarmRepository());
        }
예제 #2
0
        //成活率低于90%的养户
        public async Task <ActionResult> LiveRateShortAsync(string view)
        {
            var reslut = await Task.Factory.StartNew(() =>
            {
                var db = new FarmRepository();

                var model = db.GetEntities <LivePig>(p => p.liveRate < (decimal)0.9);
                return(model);
            });

            return(PartialView(reslut));
        }
예제 #3
0
        //清栏超过2天没领料的养户
        public async Task <ActionResult> FeedOverTimeAsync(string view)
        {
            var reslut = await Task.Factory.StartNew(() =>
            {
                var db = new FarmRepository();

                var model = db.GetEntities <LivePig>(p => p.feedSurplusDays < -2);
                return(model);
            });

            return(PartialView(reslut));
        }
예제 #4
0
        //清栏超过25天的批次
        public async Task <ActionResult> CloseOverTimeAsync(string view)
        {
            var reslut = await Task.Factory.StartNew(() =>
            {
                var db = new FarmRepository();

                var model = db.GetEntities <ClosurePig>(p => p.closeDate < DateTime.Today.AddDays(-25));
                return(model);
            });

            return(PartialView(reslut));
        }
예제 #5
0
        //签约超过25天的合同
        public async Task <ActionResult> PactOverTimeAsync(string view)
        {
            var reslut = await Task.Factory.StartNew(() =>
            {
                var db = new FarmRepository();

                var model = db.GetEntities <Pact>(p => p.statusFlag == 0 && p.pactDate < DateTime.Today.AddDays(-25));
                //return model;
                return(PartialView(model));
            });

            //return PartialView(reslut);
            return(reslut);
        }
예제 #6
0
        public static List<SelectListItem> GetAuthoryFieldItems(string defValue, bool hasAll = false)
        {
            List<SelectListItem> Items = new List<SelectListItem>();
            if (hasAll)
                Items.Add(new SelectListItem { Text = "全部", Value = "" });

            var db = new FarmRepository();
            foreach (var f in db.GetEntities<Structure>(p => p.typeID == 1))
            {
                Items.Add(new SelectListItem { 
                    Text = f.name, Value = f.ID.ToString(), Selected = (f.ID.ToString() == defValue) });
            }
            return Items;
        }
예제 #7
0
        public static List<SelectListItem> GetAuthoryFieldItems(bool hasAll=false)
        {
            List<SelectListItem> Items = new List<SelectListItem>();
            if(hasAll)
                Items.Add(new SelectListItem { Text = "全部", Value = "", Selected = true });

            var db = new FarmRepository();
            
            foreach (var f in db.GetEntities<Structure>(p=>p.typeID==1))
            {
                SelectListItem item = new SelectListItem();
                item.Text = f.name;
                item.Value = f.ID.ToString();
                Items.Add(item);
            }
            return Items;
        }
예제 #8
0
        public ActionResult FeedReport(int?id, string raiserID)
        {
            var       db    = new FarmRepository();
            GrantFeed model = null;

            if (id.HasValue)
            {
                model = db.GetEntitie <GrantFeed>(p => p.ID == id.Value);
            }
            else
            {
                model = db.GetEntities <GrantFeed>(p => p.raiserID == raiserID).OrderByDescending(p => p.referTime).FirstOrDefault();
            }

            if (model == null)
            {
                return(HttpNotFound());
            }

            return(View("GrantReport", model));
        }