Exemple #1
0
        public void Create(CreateCellarInput input)
        {
            var @entity = Cellar.Create(input.Name, input.Address, input.Phone, input.WareHouseManagerId, input.Latitude, input.Latitude,
                                        input.CreatorGuidId, _dateTime.Now, input.CostCenter, input.CompanyName);

            if (@entity == null)
            {
                throw new UserFriendlyException("No se pudo crear la Ubicación.");
            }

            if (_cellarManager.CellarExist(@entity.Name, input.Id, input.CompanyName))
            {
                throw new UserFriendlyException("Existe una Ubicación con el mismo Nombre.");
            }
            _cellarRepository.Insert(@entity);
        }
Exemple #2
0
        public static Cellar Create(string name, string address, string phone, Guid whManagerId, string latitude,
                                    string longitude, Guid creatorid, DateTime createDateTime, string costCenter, string companyName)
        {
            var @cellar = new Cellar
            {
                Id                 = Guid.NewGuid(),
                Name               = name,
                Phone              = phone,
                Address            = address,
                WareHouseManagerId = whManagerId,
                Latitude           = latitude,
                Longitude          = longitude,
                CreationTime       = createDateTime,
                CreatorUserId      = creatorid,
                IsDeleted          = false,
                CostCenter         = costCenter,
                CompanyName        = companyName,
                Active             = true
            };

            return(@cellar);
        }