Example #1
0
        public int AddInventoryGroup(string json)
        {
            InventoryGroup ig = InventoryGroup.FromJsonString(json);

            if (!Validate.NameValidation(ig.Name))
            {
                throw new ValidationException("Invalid name");
            }

            if (!Validate.NameValidation(ig.Description))
            {
                throw new ValidationException("Invalid description");
            }

            InventoryGroupPM pm = new InventoryGroupPM()
            {
                Name        = ig.Name,
                Description = ig.Description,
            };

            return(_posRepository.AddInventoryGroup(pm, GetCurrentUserId()));
        }