public ActionResult DeleteConfirmed(long id)
        {
            CarrierServicesPost carrierservices = _carrierservicesService.GetPost(id);

            carrierservices.UserName = User.Identity.Name;
            _carrierservicesService.Delete(carrierservices);
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit([Bind("ixCarrierService,sCarrierService,ixCarrier")] CarrierServicesPost carrierservices)
        {
            if (ModelState.IsValid)
            {
                carrierservices.UserName = User.Identity.Name;
                _carrierservicesService.Edit(carrierservices);
                return(RedirectToAction("Index"));
            }
            ViewBag.ixCarrier = new SelectList(_carrierservicesService.selectCarriers().Select(x => new { x.ixCarrier, x.sCarrier }), "ixCarrier", "sCarrier", carrierservices.ixCarrier);

            return(View(carrierservices));
        }
        public ActionResult Edit(long id)
        {
            CarrierServicesPost carrierservices = _carrierservicesService.GetPost(id);

            if (carrierservices == null)
            {
                return(NotFound());
            }
            ViewBag.ixCarrier = new SelectList(_carrierservicesService.selectCarriers().Select(x => new { x.ixCarrier, x.sCarrier }), "ixCarrier", "sCarrier", carrierservices.ixCarrier);

            return(View(carrierservices));
        }
        public ActionResult CreateWithID([Bind("ixCarrierService,sCarrierService,ixCarrier")] CarrierServicesPost carrierservices)
        {
            if (ModelState.IsValid)
            {
                carrierservices.UserName = User.Identity.Name;
                _carrierservicesService.Create(carrierservices);
                return(RedirectToAction("Edit", "Carriers", new { id = carrierservices.ixCarrier }));
            }
            ViewBag.ixCarrier = new SelectList(_carrierservicesService.selectCarriers().Where(x => x.ixCarrier == carrierservices.ixCarrier).Select(x => new { x.ixCarrier, x.sCarrier }), "ixCarrier", "sCarrier");

            return(View(carrierservices));
        }
        public Task Delete(CarrierServicesPost carrierservicesPost)
        {
            // Additional validations

            // Pre-process

            // Process
            this._carrierservicesRepository.RegisterDelete(carrierservicesPost);
            try
            {
                this._carrierservicesRepository.Commit();
            }
            catch (Exception ex)
            {
                this._carrierservicesRepository.Rollback();
                // Log exception
                throw;
            }

            // Post-process

            return(Task.CompletedTask);
        }
        public Task <Int64> Create(CarrierServicesPost carrierservicesPost)
        {
            // Additional validations

            // Pre-process

            // Process
            this._carrierservicesRepository.RegisterCreate(carrierservicesPost);
            try
            {
                this._carrierservicesRepository.Commit();
            }
            catch (Exception ex)
            {
                this._carrierservicesRepository.Rollback();
                // Log exception
                throw;
            }

            // Post-process

            return(Task.FromResult(carrierservicesPost.ixCarrierService));
        }
Ejemplo n.º 7
0
 public void RegisterDelete(CarrierServicesPost carrierservicesPost)
 {
     _context.CarrierServicesPost.Remove(carrierservicesPost);
 }
Ejemplo n.º 8
0
 public void RegisterEdit(CarrierServicesPost carrierservicesPost)
 {
     _context.Entry(carrierservicesPost).State = EntityState.Modified;
 }
Ejemplo n.º 9
0
 public void RegisterCreate(CarrierServicesPost carrierservicesPost)
 {
     _context.CarrierServicesPost.Add(carrierservicesPost);
 }