예제 #1
0
        public ActionResult Edit(int id, diet_planing diet)
        {
            try
            {
                using (inventorymgtEntities st = new inventorymgtEntities()) {
                    st.Entry(diet).State = EntityState.Modified;
                    st.SaveChanges();
                }
                // TODO: Add update logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #2
0
        public ActionResult Create(diet_planing diet)
        {
            try
            {
                using (inventorymgtEntities db1 = new inventorymgtEntities())
                {
                    db1.diet_planing.Add(diet);
                    db1.SaveChanges();
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }