Exemple #1
0
        public ActionResult AssemblyPlantEditSubmit(BaseAssemblyPlantEditViewModel edit_AssemblyPlant)
        {
            var assemblyPlant = db.AssemblyPlant.Find(edit_AssemblyPlant.Id);

            assemblyPlant.Title = edit_AssemblyPlant.Title;
            assemblyPlant.Content = edit_AssemblyPlant.Content;

            db.SaveChanges();

            return RedirectToAction("AssemblyPlant");
        }
Exemple #2
0
        public ActionResult ChemicalProductsEditSubmit(BaseAssemblyPlantEditViewModel edit_ChemicalProducts)
        {
            var chemicalProducts = db.ChemicalProducts.Find(edit_ChemicalProducts.Id);

            chemicalProducts.Title = edit_ChemicalProducts.Title;
            chemicalProducts.Content = edit_ChemicalProducts.Content;

            db.SaveChanges();

            return RedirectToAction("ChemicalProducts");
        }
Exemple #3
0
        //public ActionResult AssemblyPlantCreate()
        //{
        //    return View();
        //}

        //public ActionResult AssemblyPlantCreateSubmit(BaseAssemblyPlantEditViewModel create_AssemblyPlant)
        //{
        //    AssemblyPlant assemblyPlant = new AssemblyPlant
        //    {
        //        Title = create_AssemblyPlant.Title,
        //        Content = create_AssemblyPlant.Content
        //    };

        //    db.AssemblyPlant.Add(assemblyPlant);
        //    db.SaveChanges();

        //    return RedirectToAction("AssemblyPlant");
        //}

        public ActionResult AssemblyPlantEdit(int id)
        {
            var assemblyPlant = db.AssemblyPlant.Find(id);

            BaseAssemblyPlantEditViewModel _assemblyPlant = new BaseAssemblyPlantEditViewModel
            {
                Title = assemblyPlant.Title,
                Content = assemblyPlant.Content
            };

            return View(_assemblyPlant);
        }