示例#1
0
        public void CreateServiceStation(ServiceStationEntity serviceStation, string currentServiceStationId)
        {
            if (serviceStation == null)
            {
                throw new ArgumentException("ServiceStationEntity cannot be null.");
            }
            if (string.IsNullOrEmpty(currentServiceStationId))
            {
                throw new ArgumentException("CurrentServiceStationId cannot be Null or empty.");
            }

            //DB

            using (var unitOfWork = _dependencyResolver.Resolve <IUnitOfWork>())
            {
                unitOfWork.ServiceStationRepository.CreateServiceStation(serviceStation);
                unitOfWork.SaveChanges();
            }
        }
示例#2
0
        public void UpdateServiceStation(ServiceStationEntity serviceStation, string currentServiceStationId)
        {
            if (serviceStation == null)
            {
                throw new ArgumentException("ServiceStationEntity cannot be null.");
            }
            if (string.IsNullOrEmpty(currentServiceStationId))
            {
                throw new ArgumentException("CurrentServiceStationId cannot be Null or empty.");
            }

            //customer.ModifiedByUserId = currentUserId;
            //customer.ModifiedDateTimeUtc = DateTime.UtcNow;

            using (var unitOfWork = _dependencyResolver.Resolve <IUnitOfWork>())
            {
                unitOfWork.ServiceStationRepository.UpdateServiceStation(serviceStation);
                unitOfWork.SaveChanges();
            }
        }