public ActionResult Edit([Bind(Include = "ID,商品名,単価,総個数,総額,登録日時")] Inventory_Control inventory_Control)
        {
            if (ModelState.IsValid)
            {
                db.Entry(inventory_Control).State = EntityState.Modified;

                inventory_Control.ID = (from inventory in db.Product_Management
                                        where inventory.ID == inventory_Control.ID
                                        select inventory.ID).Single();
                inventory_Control.商品名 = (from inventory in db.Product_Management
                                         where inventory.ID == inventory_Control.ID
                                         select inventory.商品名).Single();
                inventory_Control.単価 = (from inventory in db.Product_Management
                                        where inventory.ID == inventory_Control.ID
                                        select inventory.単価).Single();


                inventory_Control.総額   = inventory_Control.単価 * inventory_Control.総個数;
                inventory_Control.登録日時 = DateTime.Now;

                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(inventory_Control));
        }
        public ActionResult DeleteConfirmed(string id)
        {
            Inventory_Control inventory_Control = db.Inventory_Control.Find(id);

            db.Inventory_Control.Remove(inventory_Control);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
    void Start()
    {
        StartCoroutine(FSM());

        memory    = GetComponent <AI_Memory>();
        vision    = GetComponent <AI_Vision>();
        inventory = GetComponent <Inventory_Control>();
        rb        = GetComponent <Rigidbody>();

        rotation.y = 1000.0f;

        On_Start();
    }
        public ActionResult DeleteConfirmed(string id)
        {
            Product_Management product_Management = db.Product_Management.Find(id);
            Inventory_Control  inventory_Control  = db.Inventory_Control.Find(id);
            Sales_Management   sales_Management   = db.Sales_Management.Find(id);

            db.Product_Management.Remove(product_Management);
            db.Inventory_Control.Remove(inventory_Control);
            db.Sales_Management.Remove(sales_Management);

            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        // GET: Inventory_Control/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Inventory_Control inventory_Control = db.Inventory_Control.Find(id);

            if (inventory_Control == null)
            {
                return(HttpNotFound());
            }
            return(View(inventory_Control));
        }
        public ActionResult Edit([Bind(Include = "ID,商品名,単価,販売価格,産地")] Product_Management product_Management)
        {
            if (ModelState.IsValid)
            {
                db.SaveChanges();
                Models.Inventory_Control inventory_Control = new Inventory_Control();
                Models.Sales_Management  sales_Management  = new Sales_Management();

                db.Entry(product_Management).State = EntityState.Modified;

                inventory_Control.ID  = product_Management.ID;
                sales_Management.ID   = product_Management.ID;
                inventory_Control.商品名 = product_Management.商品名;
                sales_Management.商品名  = product_Management.商品名;
                inventory_Control.単価  = product_Management.単価;
                sales_Management.販売価格 = product_Management.販売価格;
                inventory_Control.総個数 = (from inventory in db.Inventory_Control
                                         where inventory.ID == product_Management.ID
                                         select inventory.総個数).Single();
                inventory_Control.総額 = (from inventory in db.Inventory_Control
                                        where inventory.ID == product_Management.ID
                                        select inventory.総額).Single();
                inventory_Control.登録日時 = (from inventory in db.Inventory_Control
                                          where inventory.ID == product_Management.ID
                                          select inventory.登録日時).Single();
                sales_Management.販売個数 = (from sales in db.Sales_Management
                                         where sales.ID == product_Management.ID
                                         select sales.販売個数).Single();
                sales_Management.合計金額 = (from sales in db.Sales_Management
                                         where sales.ID == product_Management.ID
                                         select sales.合計金額).Single();
                sales_Management.登録日時 = (from sales in db.Sales_Management
                                         where sales.ID == product_Management.ID
                                         select sales.登録日時).Single();

                db.Entry(inventory_Control).State = EntityState.Modified;
                db.Entry(sales_Management).State  = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(product_Management));
        }
        public ActionResult Create([Bind(Include = "ID,商品名,単価,販売価格,産地")] Product_Management product_Management)
        {
            if (ModelState.IsValid)
            {
                Models.Inventory_Control inventory_Control = new Inventory_Control();
                Models.Sales_Management  sales_Management  = new Sales_Management();
                db.Inventory_Control.Add(inventory_Control);
                db.Product_Management.Add(product_Management);
                db.Sales_Management.Add(sales_Management);

                inventory_Control.ID  = product_Management.ID;
                sales_Management.ID   = product_Management.ID;
                inventory_Control.商品名 = product_Management.商品名;
                sales_Management.商品名  = product_Management.商品名;
                inventory_Control.単価  = product_Management.単価;
                sales_Management.販売価格 = product_Management.販売価格;

                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(product_Management));
        }
 public void Set_Target(Inventory_Control i_target)
 {
     target = i_target;
 }
 // Start is called before the first frame update
 void Start()
 {
     inventory = GetComponent <Inventory_Control>();
 }