コード例 #1
0
        // GET: Showdata
        public ActionResult Index()
        {
            Sprint_3_V1Context db = new Sprint_3_V1Context();
            var mymodel           = new HomeScreenVM();

            mymodel.plantedsss = db.Planteds.ToList().FindAll(x => x.Status == "Growing");
            mymodel.etasksss   = db.PlantedTasks.ToList().FindAll(x => x.Status == "On-Going");

            return(View(mymodel));
        }
コード例 #2
0
        public bool lowQuantitycheck(int quantity)
        {
            Sprint_3_V1Context db = new Sprint_3_V1Context();

            int id = Convert.ToInt16(StockID);

            var checkQty = db.Stocks.Where(x => x.StockID == id).Select(a => a.CurQuantity).First();

            if (checkQty >= 0)
            {
                if (checkQty >= quantity)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }