Ejemplo n.º 1
0
        public SpecimenIntegrationDto Invoke(StoreInput input)
        {
            var service = ServiceFactory.Create();
            var result  = service.getTestInfo(input.Barcode);

            //对result进行解析组装dto
            return(null);
        }
Ejemplo n.º 2
0
        public async Task <Store> Add(StoreInput store)
        {
            var entity = mapper.MapStore(store, new StoreEntity());

            this.dbContext.Add(entity);
            await SaveChanges();

            return(mapper.MapStore(entity, new Store()));
        }
 public SpecimenIntegrationDto Invoke(StoreInput input)
 {
     using (var conn = ConnectionFactory.Create())
     {
         var reader   = conn.QueryMultiple(BuildSql(), new { @barcode = input.Barcode });
         var specimen = Map(reader).SingleOrDefault();
         return(specimen);
     }
 }
Ejemplo n.º 4
0
        public async Task <Store> Update(Guid storeId, StoreInput store)
        {
            var entity = await this.Entity(storeId);

            if (entity != null)
            {
                mapper.MapStore(store, entity);
                await SaveChanges();

                return(mapper.MapStore(entity, new Store()));
            }
            throw new KeyNotFoundException($"Cannot find store {storeId.ToString()}");
        }
Ejemplo n.º 5
0
 public SpecimenIntegrationDto Invoke(StoreInput input)
 {
     return(null);
 }
Ejemplo n.º 6
0
 public StoreEntity MapStore(StoreInput src, StoreEntity dest)
 {
     return(mapper.Map(src, dest));
 }
Ejemplo n.º 7
0
 public async Task <Store> Update(Guid storeId, [FromBody] StoreInput store)
 {
     return(await repo.Update(storeId, store));
 }
Ejemplo n.º 8
0
 public async Task <Store> Add([FromBody] StoreInput store)
 {
     return(await repo.Add(store));
 }
Ejemplo n.º 9
0
        public StoreScreen()
        {
            background = Game1.Instance.gameContent.Load<Texture2D>("GUI/store_screen");
            sideBG = Game1.Instance.gameContent.Load<Texture2D>("GUI/store_side");

            buttons = new List<GuiButton>();
            abilities = new List<IAbility>();
            pitButton = new GuiButton(new Vector2(200, 100), "Sprites/pit_button", 48, 48, 0);
            pitButton.Enabled = true;
            spikeButton = new GuiButton(new Vector2(156, 172), "Sprites/spikes_button", 48, 48, 1);
            spikeButton.Enabled = false;
            spikeButton.Cost = 50;
            spikeButton.Click += new GuiButton.ClickHandler(buyAbility);
            spikeButton.Hover += new GuiButton.HoverHandler(showCost);
            lionButton = new GuiButton(new Vector2(248, 172), "Sprites/lion_button", 48, 48, 2);
            lionButton.Enabled = false;
            lionButton.Cost = 80;
            lionButton.Click += new GuiButton.ClickHandler(buyAbility);
            lionButton.Hover += new GuiButton.HoverHandler(showCost);
            crocButton = new GuiButton(new Vector2(202, 250), "Sprites/CrocButton", 48, 48, 3);
            crocButton.Enabled = false;
            crocButton.Cost = 130;
            crocButton.Click += new GuiButton.ClickHandler(buyAbility);
            crocButton.Hover += new GuiButton.HoverHandler(showCost);
            nukeButton = new GuiButton(new Vector2(202, 350), "Sprites/nuke_button", 48, 48, 4);
            nukeButton.Enabled = false;
            nukeButton.Cost = 250;
            nukeButton.Click += new GuiButton.ClickHandler(buyAbility);
            nukeButton.Hover += new GuiButton.HoverHandler(showCost);
            gameButton = new GuiButton(new Vector2(550, 550), "Sprites/button", 193, 25, 0);
            gameButton.Enabled = true;
            gameButton.ChangeScreens += new GuiButton.GuiHandler(changeScreens);
            gameButton.Hover += new GuiButton.HoverHandler(gameButton_Hover);
            buttons.Add(pitButton);
            buttons.Add(spikeButton);
            buttons.Add(lionButton);
            buttons.Add(crocButton);
            buttons.Add(nukeButton);

            abilityDesc = new List<string>();

            abilityDesc.Add("Pit:\n\nDig a hole and send the\nzebras to their doom.");
            abilityDesc.Add("Spikes:\n\nLay a bed of spikes to\nimpale the creatures inflicting\nsome damage.");
            abilityDesc.Add("Lion:\n\nUnleash the fury of a lion to\nmaul down the zebras.");
            abilityDesc.Add("Crocodile:\n\nSend the zebras to a deathroll\nas they enter the maw of\nthis creature.");
            abilityDesc.Add("Nuke:\n\nEradicate the zebra race as\nwe know it.");

            for (int i = 0; i < buttons.Count; i++)
            {
                if (buttons[i].Enabled)
                {
                    buttons[i].Click += new GuiButton.ClickHandler(addAbilityToBar);
                    buttons[i].Hover += new GuiButton.HoverHandler(changeText);
                    buttons[i].Drag += new GuiButton.DraggingHandler(dragging);
                    buttons[i].Drop += new GuiButton.DropHandler(dropping);
                }
            }

            input = new StoreInput(buttons);
        }