コード例 #1
0
        public IActionResult insertMash(IEnumerable <string> material_id, IEnumerable <string> product_id)
        {
            int length = material_id.Count();

            List <string> product  = new List <string>();
            List <string> material = new List <string>();

            foreach (string p in product_id)
            {
                product.Add(p);
            }
            foreach (string m in material_id)
            {
                material.Add(m);
            }

            int i = 0;

            for (i = 0; i < length; i++)
            {
                MashModel ms = new MashModel();
                ms.mash_ref_product_id  = product[i];
                ms.mash_ref_material_id = material[i];
                ms.insert_mash();
            }



            return(RedirectToAction("mash", "Mash"));
        }
コード例 #2
0
        public void del_mash(string id)
        {
            MashModel ms = new MashModel();

            ms.mash_id = id;
            ms.del_mash();
        }
コード例 #3
0
        public string select_mash(string id)
        {
            MashModel ms = new MashModel();

            ms.select_mash("mash_id = '" + id + "'");

            return(ms.mash_ref_product_id + "^" + ms.mash_ref_material_id);
        }
コード例 #4
0
        public IActionResult update_mash(string product, string material, string mash_id)
        {
            MashModel ms = new MashModel();

            ms.mash_id              = mash_id;
            ms.mash_ref_product_id  = product;
            ms.mash_ref_material_id = material;
            ms.update_mash();

            return(RedirectToAction("mash", "Mash"));
        }
コード例 #5
0
        public IActionResult mash()
        {
            MashModel ms = new MashModel();

            ViewData["mash"] = ms.list_mash();

            productModel pd = new productModel();

            ViewData["product"] = pd.drop_product("");

            MaterialModel mt = new MaterialModel();

            ViewData["material"] = mt.drop_mtr("");


            return(View());
        }