示例#1
0
        // GET: Dealers/Edit
        public ActionResult Edit(int id)
        {
            var dp     = new DealerProcess();
            var dealer = dp.Find(id);

            return(View(dealer));
        }
示例#2
0
        // GET: Dealers/Delete
        public ActionResult Delete(int id)
        {
            var cp = new DealerProcess();

            cp.Delete(id);
            return(RedirectToAction("Index"));
        }
示例#3
0
        // POST: Dealers/Create
        public ActionResult Create(Dealer dealer)
        {
            var dp = new DealerProcess();

            dp.Insert(dealer);
            return(RedirectToAction("Index"));
        }
示例#4
0
        // GET: Dealers/Dealer
        public ActionResult Index()
        {
            var dp    = new DealerProcess();
            var lista = dp.SelectList();

            return(View(lista));
        }
示例#5
0
        // POST: Dealers/Edit
        public ActionResult Edit(Dealer dealer)
        {
            var dp = new DealerProcess();

            dp.Edit(dealer);
            return(RedirectToAction("Index"));
        }
示例#6
0
        // GET: Dealers/Details
        public ActionResult Details(int id)
        {
            var dp   = new DealerProcess();
            var pais = dp.Find(id);

            return(View(pais));
        }
示例#7
0
        // GET: Products/Create
        public ActionResult Create()
        {
            var dp    = new DealerProcess();
            var lista = dp.SelectList();

            ViewData["Dealer"] = lista;
            return(View());
        }
示例#8
0
        // GET: Dealer/Edit/5
        public ActionResult Edit(int id)
        {
            var category = new CategoryProcess().SelectList();
            var country  = new CountryProcess().SelectList();

            ViewBag.Category = new SelectList(category, "Id", "Name", id);
            ViewBag.Country  = new SelectList(country, "Id", "Name", id);

            var cp = new DealerProcess();

            return(View(cp.findDealer(id)));
        }
示例#9
0
        // GET: Products/Edit
        public ActionResult Edit(int id)
        {
            var pp  = new ProductProcess();
            var prd = pp.Find(id);

            var dp    = new DealerProcess();
            var lista = dp.SelectList();

            ViewData["Dealer"] = lista;

            return(View(prd));
        }
示例#10
0
        public ActionResult Index()
        {
            var pp    = new ProductProcess();
            var lista = pp.SelectList();

            var dp          = new DealerProcess();
            var listadealer = dp.SelectList();

            ViewData["Dealer"] = listadealer;

            return(View(lista));
        }
示例#11
0
        // GET: Products/Details
        public ActionResult Details(int id)
        {
            var pp  = new ProductProcess();
            var prd = pp.Find(id);

            var dp         = new DealerProcess();
            var descDealer = dp.Find(prd.DealerId);

            ViewData["Dealer"] = descDealer.FirstName + " " + descDealer.LastName;

            return(View(prd));
        }
        //public void DealerListRemove()
        //{
        //    _cacheServices.Remove(DataCacheSetting.Dealer.Key);

        //    var lista = _cacheServices.GetOrAdd(
        //        DataCacheSetting.Dealer.Key,
        //        () =>
        //        {
        //            var dp = new DealerProcess();
        //            return dp.SelectList();
        //        },
        //        DataCacheSetting.Dealer.SlidingExpiration);
        //}

        public void DealerListRemoveDTO()
        {
            _cacheServices.Remove(DataCacheSetting.DealerDTO.Key);

            var lista = _cacheServices.GetOrAdd(
                DataCacheSetting.DealerDTO.Key,
                () =>
            {
                var dp = new DealerProcess();
                return(dp.SelectList());
            },
                DataCacheSetting.DealerDTO.SlidingExpiration);
        }
示例#13
0
 public ActionResult Delete(int id, Dealer dealer)
 {
     try
     {
         var cp = new DealerProcess();
         cp.deleteDealer(id);
         DataCache.Instance.DealerListRemoveDTO();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
示例#14
0
 public ActionResult Edit(Dealer dealer)
 {
     try
     {
         var cp = new DealerProcess();
         cp.editDealer(dealer);
         DataCache.Instance.DealerListRemoveDTO();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
示例#15
0
        // GET: Dealers/Dealer
        public ActionResult Index()
        {
            var dp    = new DealerProcess();
            var lista = dp.SelectList();

            var cp           = new CountryProcess();
            var listaCountry = cp.SelectList();

            ViewData["Country"] = listaCountry;

            var cp2           = new CategoryProcess();
            var listaCategory = cp2.SelectList();

            ViewData["Category"] = listaCategory;

            return(View(lista));
        }
示例#16
0
        // GET: Dealers/Edit
        public ActionResult Edit(int id)
        {
            var dp     = new DealerProcess();
            var dealer = dp.Find(id);

            var cp           = new CountryProcess();
            var listaCountry = cp.SelectList();

            ViewData["Country"] = listaCountry;

            var cp2           = new CategoryProcess();
            var listaCategory = cp2.SelectList();

            ViewData["Category"] = listaCategory;

            return(View(dealer));
        }
示例#17
0
        // GET: Dealers/Details
        public ActionResult Details(int id)
        {
            var dp     = new DealerProcess();
            var dealer = dp.Find(id);

            var cp          = new CountryProcess();
            var nameCountry = cp.Find(dealer.CountryId);

            ViewData["Country"] = nameCountry.Name;

            var cp2          = new CategoryProcess();
            var nameCategory = cp2.Find(dealer.CategoryId);

            ViewData["Category"] = nameCategory.Name;

            return(View(dealer));
        }
示例#18
0
        // GET: Dealer/Delete/5
        public ActionResult Delete(int id)
        {
            var cp = new DealerProcess();

            return(View(cp.findDealer(id)));
        }