예제 #1
0
        public override async Task CreateAndSaveAsync(ModelsClassLibrary.ModelsNS.SharedNS.ControllerCreateEditParameter parm)
        {
            Product product = Product.Unbox(parm.Entity);

            if (UserId.IsNullOrWhiteSpace())
            {
                return;
            }

            await base.CreateAndSaveAsync(parm);
        }
예제 #2
0
        public override void CreateAndSave(ModelsClassLibrary.ModelsNS.SharedNS.ControllerCreateEditParameter parm)
        {
            Product product = Product.Unbox(parm.Entity);

            if (UserId.IsNullOrWhiteSpace())
            {
                return;
            }

            if (product.OwnerId.IsNullOrWhiteSpace())
            {
                Owner owner = OwnerBiz.GetPlayerFor(UserId);
                owner.IsNullThrowException("You must first become a seller. Go to ' I Want To...' to become a seller.");

                product.OwnerId = owner.Id;
                if (owner.Shops.IsNull())
                {
                    owner.Shops = new List <Product>();
                }
                owner.Shops.Add(product);
            }

            base.CreateAndSave(parm);
        }