Beispiel #1
0
        public void UpdateShipper(ShipperViewModel shipper)
        {
            var shipperToRemove = _shipperRepository.GetById(shipper.ShipperC);
            var updateShipper   = Mapper.Map <ShipperViewModel, Shipper_M>(shipper);

            _shipperRepository.Delete(shipperToRemove);
            _shipperRepository.Add(updateShipper);
            SaveShipper();
        }
Beispiel #2
0
        public bool UpdateShipper(ShipperEditModels model, out string message)
        {
            var shipperEntity = _ShipperRepository.GetById(model.ShipperId);

            if (shipperEntity != null)
            {
                var gr = _ShipperRepository.getshipper(model.ShipperId, model.CompanyName, model.Phone);
                if (gr != null)
                {
                    message = Constant.ShipperIsExist;
                    return(false);
                }
                shipperEntity = model.MapToEditEntity(shipperEntity);
                _ShipperRepository.Update(shipperEntity);
                UnitOfwork.SaveChanges();
                message = Constant.UpdateSuccess;
                return(true);
            }
            message = Constant.UpdateFail;
            return(false);
        }
 public IActionResult Edit(Guid id)
 {
     return(View(_repository.GetById(id)));
 }
Beispiel #4
0
 public Shipper GetShipper(Guid Id)
 {
     return(_repository.GetById(Id));
 }