Esempio n. 1
0
        // GET: Отделы/Details/5
        public ActionResult Details(string name)
        {
            Отделы otd = db.Отделы.Find(name);

            if (otd == null)
            {
                return(HttpNotFound());
            }
            return(View(otd));
        }
Esempio n. 2
0
 public ActionResult Delete(string name, FormCollection collection)
 {
     try
     {
         Отделы otd = db.Отделы.Find(name);
         db.Отделы.Remove(otd);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 3
0
 public ActionResult Edit([Bind(Include = "Название_подразделения, Наличие_какой-нибудь_фигни, Какая-нибудь еще штука, ID_руководителя")] Отделы otd)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Entry(otd).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
     }
     catch
     {
         return(View());
     }
     return(View(otd));
 }
Esempio n. 4
0
 public ActionResult Create([Bind(Include = "Название_подразделения, Наличие_какой-нибудь_фигни, Какая-нибудь еще штука, ID_руководителя")] Отделы otd)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Отделы.Add(otd);
             db.SaveChanges();
         }
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
     return(View(otd));
 }
Esempio n. 5
0
        // GET: Отделы/Edit/5
        public ActionResult Edit(string name)
        {
            Отделы otd = db.Отделы.Find(name);

            return(View(otd));
        }