Esempio n. 1
0
 public OperationController(IOperationCRUD opCRUD)
 {
     handler = new BL.Handler();
     handler.Connect(Sales.MVCClient.Helper.MagicString.PathSalesDataBase);
     operationCRUD = opCRUD;
     mapper        = new MVCMapper();
 }
Esempio n. 2
0
 public ProductController(IProductCRUD handlerCRUD)
 {
     handler = new BL.Handler();
     handler.Connect(Sales.MVCClient.Helper.MagicString.PathSalesDataBase);
     productCRUD = handlerCRUD;
     mapper      = new MVCMapper();
 }
 public PriceHistoryController(IPriceHistoryCRUD phCRUD)
 {
     handler = new BL.Handler();
     handler.Connect(Sales.MVCClient.Helper.MagicString.PathSalesDataBase);
     priceHistoryCRUD = phCRUD;
     mapper           = new MVCMapper();
 }
        public ActionResult Index()
        {
            List <Supplier> supplierInfo = new List <Supplier>();

            try
            {
                List <SupplierDO> allSuppliers = Dao.ObtainAllSuppliers();
                supplierInfo = MVCMapper.FromDoToPo(allSuppliers);
            }
            catch (Exception)
            {
            }

            return(View(supplierInfo));
        }
        public ActionResult CreateSupplier(Supplier form)
        {
            ActionResult response;

            if (ModelState.IsValid)
            {
                try
                {
                    SupplierDO newSupplier = MVCMapper.PoToDo(form);
                    Dao.CreateSupplier(newSupplier);
                    response = RedirectToAction("Index", "Supplier");
                }
                catch (SqlException sqlex)
                {
                    response = View(form);
                }
            }
            else
            {
                response = View();
            }
            return(response);
        }
 public AccountController()
 {
     mapper = new MVCMapper();
 }
 public AccountManagerController()
 {
     mapper = new MVCMapper();
 }