Beispiel #1
0
        public ShipperEditModels CreateShipper(ShipperEditModels model, out string message)
        {
            var ship = _ShipperRepository.getshipper(model.ShipperId, model.CompanyName, model.Phone);

            if (ship != null)
            {
                message = Constant.ShipperIsExist;
                return(null);
            }
            var CreateShipper = _ShipperRepository.Insert(model.MapToEditEntity());

            UnitOfwork.SaveChanges();
            if (CreateShipper == null)
            {
                message = Constant.CreateFail;
                return(null);
            }
            message = Constant.CreateSuccess;
            return(CreateShipper.MapToEditModel());
        }