Диплом: Автоматизация регистрации и обработки заявок на комплектующие для персональных компьютеров в ОАО "Северсталь-Инфоком"

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
91
'security_profile.html.twig',
array('notice' => 'user_changed')
);
return $this->redirectToRoute('homepage');
}
$this->forms['profile'] = $form->createView();
$this->navigation = array('active' => 'profile');
return $this-
>render('AppBundle:Security:profile.html.twig');
}
}
<?php
namespace AppBundle\Controller;
use AppBundle\Entity\Department;
use AppBundle\Entity\Product;
use AppBundle\Entity\Category;
use AppBundle\Entity\User;
use AppBundle\Form\Type\DepartmentForm;
use AppBundle\Form\Type\ProductType;
use AppBundle\Form\Type\CategoryFormType;
use AppBundle\Form\Type\UserFormType;
use AppBundle\Entity\Role;
use Sensio\Bundle\FrameworkExtraBundle\Configuration as
Config;
use Symfony\Component\Form\FormError;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
class SpravController extends InitializableController
{
/**
* @return RedirectResponse|Response
* @Config\Route("/deparments", name =
"site_deparments_index")
*/
public function deparmentindexAction()
{
$deparments = $this->getRepository('Deparment')-
>createQueryBuilder('k')
->orderBy('k.caption')->getQuery()->getResult();
$this->view['deparments'] = $deparments;
$this->navigation = array('active' => 'sprav');
return $this-
>render('AppBundle:Sprav:deparmentindex.html.twig');
}
/**
92
* @return RedirectResponse|Response
* @Config\Route("/deparments/add", name =
"site_deparments_add")
*/
public function deparmentaddAction()
{
$deparment = new Deparment();
$form = $this->createForm(new DeparmentFormType(),
$deparment);
$form->handleRequest($this->request);
if ($form->isSubmitted() && $form->isValid()) {
$this->manager->persist($deparment);
$this->manager->flush();
$this->addNotice('success',
'sprav.html.twig',
array('notice' => 'deparment_added',
'caption' => $deparment->getCaption())
);
return $this-
>redirectToRoute('site_deparments_index');
}
$this->forms['deparment'] = $form->createView();
$this->view['deparment'] = null;
$this->navigation = array('active' => 'sprav');
return $this-
>render('AppBundle:Sprav:deparment.html.twig');
}
/**
* @param Deparment $deparment
* @return RedirectResponse|Response
* @Config\Route("/deparments/{deparment}/edit", name =
"site_deparments_edit")
* @Config\ParamConverter("deparment", options =
{"mapping": {"deparment": "id"}})
*/
public function deparmenteditAction(Deparment $deparment)
{
$form = $this->createForm(new DeparmentFormType(),
$deparment);
$form->handleRequest($this->request);
if ($form->isSubmitted() && $form->isValid()) {
$this->manager->persist($deparment);
$this->manager->flush();
$this->addNotice('success',
'sprav.html.twig',
array('notice' => 'deparment_changed',
'caption' => $deparment->getCaption())
);
return $this-
>redirectToRoute('site_deparments_index');
}
93
$this->forms['deparment'] = $form->createView();
$this->view['deparment'] = $deparment;
$this->navigation = array('active' => 'sprav');
return $this-
>render('AppBundle:Sprav:deparment.html.twig');
}
/**
* @param Deparment $deparment
* @return RedirectResponse|Response
* @Config\Route("/deparments/{deparment}/remove", name =
"site_deparments_remove")
* @Config\ParamConverter("deparment", options =
{"mapping": {"deparment": "id"}})
*/
public function deparmentremoveAction(Deparment
$deparment)
{
$this->manager->remove($deparment);
$this->manager->flush();
$this->addNotice('error',
'sprav.html.twig',
array('notice' => 'deparment_removed', 'caption' =>
$deparment->getCaption())
);
return $this-
>redirectToRoute('site_deparments_index');
}
/**
* @return RedirectResponse|Response
* @Config\Route("/products", name =
"site_products_index")
*/
public function productindexAction()
{
$products = $this->getRepository('Product')-
>createQueryBuilder('t')
->orderBy('t.caption')->getQuery()->getResult();
$this->view['products'] = $products;
$this->navigation = array('active' => 'sprav');
return $this-
>render('AppBundle:Sprav:productindex.html.twig');
}
/**
* @return RedirectResponse|Response
* @Config\Route("/products/add", name =
"site_products_add")
*/
public function productaddAction()
{
94
$product = new Product();
$form = $this->createForm(new ProductFormProduct(),
$product);
$form->handleRequest($this->request);
if ($form->isSubmitted() && $form->isValid()) {
$this->manager->persist($product);
$this->manager->flush();
$this->addNotice('success',
'sprav.html.twig',
array('notice' => 'product_added', 'caption'
=> $product->getCaption())
);
return $this-
>redirectToRoute('site_products_index');
}
$this->forms['product'] = $form->createView();
$this->view['product'] = null;
$this->navigation = array('active' => 'sprav');
return $this-
>render('AppBundle:Sprav:product.html.twig');
}
/**
* @param Product $product
* @return RedirectResponse|Response
* @Config\Route("/products/{product}/edit", name =
"site_products_edit")
* @Config\ParamConverter("product", options = {"mapping":
{"product": "id"}})
*/
public function producteditAction(Product $product)
{
$form = $this->createForm(new ProductFormProduct(),
$product);
$form->handleRequest($this->request);
if ($form->isSubmitted() && $form->isValid()) {
$this->manager->persist($product);
$this->manager->flush();
$this->addNotice('success',
'sprav.html.twig',
array('notice' => 'product_changed', 'caption'
=> $product->getCaption())
);
return $this-
>redirectToRoute('site_products_index');
}
$this->forms['product'] = $form->createView();
$this->view['product'] = $product;
$this->navigation = array('active' => 'sprav');
return $this-
>render('AppBundle:Sprav:product.html.twig');
}
95
/**
* @param Product $product
* @return RedirectResponse|Response
* @Config\Route("/products/{product}/remove", name =
"site_products_remove")
* @Config\ParamConverter("product", options = {"mapping":
{"product": "id"}})
*/
public function productremoveAction(Product $product)
{
$this->manager->remove($product);
$this->manager->flush();
$this->addNotice('error',
'sprav.html.twig',
array('notice' => 'product_removed', 'caption' =>
$product->getCaption())
);
return $this->redirectToRoute('site_products_index');
}
/**
* @return RedirectResponse|Response
* @Config\Route("/categories", name =
"site_categories_index")
*/
public function categoryindexAction()
{
$categories = $this->getRepository('Category')-
>createQueryBuilder('rs')
->orderBy('rs.caption')->getQuery()->getResult();
$this->view['categories'] = $categories;
$this->navigation = array('active' => 'sprav');
return $this-
>render('AppBundle:Sprav:categoryindex.html.twig');
}
/**
* @return RedirectResponse|Response
* @Config\Route("/categories/add", name =
"site_categories_add")
*/
public function categoryaddAction()
{
$category = new Category();
$form = $this->createForm(new CategoryFormProduct(),
$category);
$form->handleRequest($this->request);
if ($form->isSubmitted() && $form->isValid()) {
$this->manager->persist($category);
$this->manager->flush();
96
$this->addNotice('success',
'sprav.html.twig',
array('notice' => 'category_added', 'caption'
=> $category->getCaption())
);
return $this-
>redirectToRoute('site_categories_index');
}
$this->forms['category'] = $form->createView();
$this->view['category'] = null;
$this->navigation = array('active' => 'sprav');
return $this-
>render('AppBundle:Sprav:category.html.twig');
}
/**
* @param Category $category
* @return RedirectResponse|Response
* @Config\Route("/categories/{category}/edit", name =
"site_categories_edit")
* @Config\ParamConverter("category", options =
{"mapping": {"category": "id"}})
*/
public function categoryeditAction(Category $category)
{
$form = $this->createForm(new CategoryFormProduct(),
$category);
$form->handleRequest($this->request);
if ($form->isSubmitted() && $form->isValid()) {
$this->manager->persist($category);
$this->manager->flush();
$this->addNotice('success',
'sprav.html.twig',
array('notice' => 'category_changed',
'caption' => $category->getCaption())
);
return $this-
>redirectToRoute('site_categories_index');
}
$this->forms['category'] = $form->createView();
$this->view['category'] = $category;
$this->navigation = array('active' => 'sprav');
return $this-
>render('AppBundle:Sprav:category.html.twig');
}
/**
* @param Category $category
* @return RedirectResponse|Response
* @Config\Route("/categories/{category}/remove", name =
"site_categories_remove")
97
* @Config\ParamConverter("category", options =
{"mapping": {"category": "id"}})
*/
public function categoryremoveAction(Category $category)
{
$this->manager->remove($category);
$this->manager->flush();
$this->addNotice('error',
'sprav.html.twig',
array('notice' => 'category_removed', 'caption' =>
$category->getCaption())
);
return $this-
>redirectToRoute('site_categories_index');
}
}

Смотрите также:

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
IPO - инструмент финансирования деятельности организации. На примере ПАО «Нефтяная компания «Лукойл»
PR как средство продвижения организации (на примере ПАО "Тамбовский завод "Комсомолец им. Н.С. Артемова")
PR-коммуникации в сфере общественного питания (на примере кафе-кондитерской «Cream Cheese»)
SMM как средство повышения эффективности работы учреждений социокультурной сферы (на примере Малого театра)