示例#1
0
        public bool CreateCard(CardCreate model)
        {
            var entity = new Card()
            {
                CardId       = model.CardId,
                Name         = model.Name,
                ImageURL     = model.ImageURL,
                Type         = model.Type,
                SuperType    = model.SuperType,
                SubType      = model.SubType,
                HP           = model.HP,
                RetreatCost  = model.RetreateCost,
                SetNumber    = model.SetNumber,
                Series       = model.Series,
                Set          = model.Set,
                WeaknessId   = model.WeaknessId,
                ResistanceId = model.ResistanceId,
                AbilityId    = model.AbilityId,
                Artist       = model.Artist,
                Rarity       = model.Rarity,
            };


            using (var ctx = new ApplicationDbContext())
            {
                ctx.Cards.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
    // Start is called before the first frame update
    void Start()
    {
        CC = GetComponent <CardCreate>();

        title.volume = 0;
        game.volume  = 0;
    }
    private void Awake()
    {
        CC           = GetComponent <CardCreate>();
        CC.Issetting = 5;

        Back.color += new Color(0, 0, 0, 1);
    }
示例#4
0
        public void GetColorsTest()
        {
            var accessToken = AccessTokenContainer.GetToken(_appId);

            var result = CardCreate.GetColors(accessToken);

            Console.Write(result);
            Assert.IsNotNull(result);
        }
示例#5
0
        public void CreateQRTest()
        {
            var accessToken = AccessTokenContainer.GetToken(_appId);

            var cardIdList = CardBatchGetTest();
            var cardId     = cardIdList.FirstOrDefault();

            var result = CardCreate.CreateQR(accessToken, cardId);

            Console.Write(result);
            Assert.IsNotNull(result);
        }
示例#6
0
        public void CreateCardTest()
        {
            var accessToken = AccessTokenContainer.GetToken(_appId);
            var data        = new Card_GrouponData()
            {
                base_info   = _BaseInfo,
                deal_detail = "测试"
            };

            var result = CardCreate.CreateCard(accessToken, CardType.GROUPON, data);

            Console.Write(result);
            Assert.IsNotNull(result);
        }
示例#7
0
        public bool CreateCard(CardCreate model)
        {
            var entity = new Card()
            {
                OwnerId = _userId,
                Name    = model.CardName
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Cards.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
    private void Awake()
    {
        int i = 0;

        for (i = 0; i < 10; i++)
        {
            GameObject a = Instantiate(effect_bonus);
            efflist.Add(a);
            a.SetActive(false);
        }

        CC  = GetComponent <CardCreate>();
        Cur = GetComponent <Curosormoves>();
    }
示例#9
0
        /// <summary>
        /// Create a new card.
        /// </summary>
        /// <param name="card"></param>
        /// <returns></returns>
        public IHttpActionResult Post(CardCreate card)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var service = CreateCardService();

            if (!service.CreateCard(card))
            {
                return(InternalServerError());
            }

            return(Ok());
        }
        public async Task <CardView> CreateCard(CardCreate card)
        {
            var createEntity = new DataModel.Card()
            {
                CreateDateUtc  = DateTime.UtcNow,
                Handle         = Guid.NewGuid(),
                EstimationMode = card.EstimationMode,
                Name           = card.Name
            };

            var created = await _dbContext.Cards.AddAsync(createEntity);

            await _dbContext.SaveChangesAsync();

            return(_mapper.Map <CardView>(created.Entity));
        }
示例#11
0
        public bool CreateCard(CardCreate model)
        {
            var entity =
                new Card()
            {
                OwnerID  = _userID,
                SentCard = model.SentCard,
                PersonID = model.PersonID,
                Person   = model.Person
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Cards.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
示例#12
0
        public bool CreateCard(CardCreate model)
        {
            var entity =
                new Card()
            {
                UserId          = _userId,
                CardTitle       = model.CardTitle,
                CardDescription = model.CardDescription,
                CreatedUtc      = DateTimeOffset.UtcNow,
                DeckId          = model.DeckId
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Cards.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
        public ActionResult Create(CardCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var service = CreateCardService();

            if (service.CreateCard(model))
            {
                TempData["SaveResult"] = "Your card was created.";
                return(RedirectToAction("Index"));
            }
            ;

            ModelState.AddModelError("", "Card could not be found.");
            return(View(model));
        }
示例#14
0
        public int CreateCard(CardCreate model)
        {
            using (var ctx = new ApplicationDbContext())
            {
                var template = ctx.Templates.Single(t => t.Id == model.TemplateId);

                var entity = new Card(template)
                {
                    Name = model.Name,
                };

                ctx.Cards.Add(entity);
                if (ctx.SaveChanges() == 1)
                {
                    return(entity.Id);
                }
                return(0);
            }
        }
示例#15
0
        public ActionResult Create(CardCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var service = new CardService();
            int id      = service.CreateCard(model);

            if (id != 0)
            {
                TempData["SaveResult"] = "Enter Values";
                return(RedirectToAction("Create", "CardProperty", new { cardId = id }));
            }
            ;

            ModelState.AddModelError("", "Card could not be created.");

            return(View(model));
        }
示例#16
0
        public static CardCreate GetCardCreateModel(CardProvider cardProvider = CardProvider.Visa)
        {
            CardCreate card     = new CardCreate();
            var        baseCard = GetBaseCardModel(cardProvider);

            card.Name           = baseCard.Name;
            card.ExpiryMonth    = baseCard.ExpiryMonth;
            card.ExpiryYear     = baseCard.ExpiryYear;
            card.BillingDetails = baseCard.BillingDetails;

            if (cardProvider == CardProvider.Visa)
            {
                card.Cvv    = "100";
                card.Number = "4242424242424242";
            }
            else
            {
                card.Cvv    = "257";
                card.Number = "5313581000123430";
            }

            return(card);
        }
示例#17
0
 private void Awake()
 {
     CC = GetComponent <CardCreate>();
 }
示例#18
0
        public CardChargeRequestModel()
        {
            Email                = "*****@*****.**";
            AutoCapture          = "Y";
            AutoCapTime          = 0;
            Currency             = "Usd";
            TrackId              = "TRK12345";
            TransactionIndicator = "1";
            CustomerIp           = "82.23.168.254";
            Description          = "Ipad for Ebs travel";
            Value                = "100";

            Card = new CardCreate
            {
                ExpiryMonth    = "06",
                ExpiryYear     = "2018",
                Cvv            = "100",
                Number         = "4242424242424242",
                Name           = "Mehmet Ali",
                BillingDetails = new Address()
                {
                    AddressLine1 = "Flat 1",
                    AddressLine2 = "Glading Fields",
                    Postcode     = "N16 2BR",
                    City         = "London",
                    State        = "Hackney",
                    Country      = "GB",
                    Phone        = new Phone()
                    {
                        CountryCode = "44",
                        Number      = "203 583 44 55"
                    }
                }
            };

            Products = new List <Product>();

            ShippingDetails = new Address
            {
                AddressLine1 = "Flat 1",
                AddressLine2 = "Glading Fields",
                Postcode     = "N16 2BR",
                City         = "London",
                State        = "Hackney",
                Country      = "GB",
                Phone        = new Phone()
                {
                    CountryCode = "44",
                    Number      = "203 583 44 55"
                }
            };

            Metadata = new Dictionary <string, string> {
                { "extraInformation", "EBS travel" }
            };
            Udf1 = "udf1 string";
            Udf2 = "udf2 string";
            Udf3 = "udf3 string";
            Udf4 = "udf4 string";
            Udf5 = "udf5 string";
        }
示例#19
0
 private void openCreateNewDeck()
 {
     DataContext = new CardCreate();
     setUpDeckEditing(false);
 }
示例#20
0
        public Task <HttpResponse <Card> > CreateCardAsync(string customerId, CardCreate requestModel)
        {
            var createCardUri = string.Format(_configuration.ApiUrls.Cards, customerId);

            return(_apiHttpClient.PostRequest <Card>(createCardUri, _configuration.SecretKey, requestModel));
        }
    protected void but_createCard_Click(object sender, EventArgs e)
    {
        // populates test card dropdown list
        switch (dropdown_testCard.SelectedValue)
        {
        case "Visa01":
            expiryMonth = "06";
            expiryYear  = "2018";
            cvv         = "100";
            cardNum     = "4242424242424242";
            break;

        case "Visa02":
            expiryMonth = "06";
            expiryYear  = "2017";
            cvv         = "956";
            cardNum     = "4543474002249996";
            break;

        case "Master01":
            expiryMonth = "06";
            expiryYear  = "2017";
            cvv         = "257";
            cardNum     = "5436031030606378";
            break;

        case "Amex01":
            expiryMonth = "06";
            expiryYear  = "2017";
            cvv         = "1051";
            cardNum     = "345678901234564";
            break;

        case "Amex02":
            expiryMonth = "06";
            expiryYear  = "2018";
            cvv         = "1000";
            cardNum     = "378282246310005";
            break;

        case "Diners01":
            expiryMonth = "06";
            expiryYear  = "2017";
            cvv         = "257";
            cardNum     = "30123456789019";
            break;

        case "Jcb01":
            expiryMonth = "06";
            expiryYear  = "2018";
            cvv         = "100";
            cardNum     = "3530111333300000";
            break;

        case "Discover01":
            expiryMonth = "06";
            expiryYear  = "2018";
            cvv         = "100";
            cardNum     = "6011111111111117";
            break;

        default:
            expiryMonth = "06";
            expiryYear  = "2018";
            cvv         = "100";
            cardNum     = "4242424242424242";
            break;
        }

        // Create payload
        var cardCreateRequest = new CardCreate()
        {
            Name        = dropdown_customerlist.SelectedItem.Text,
            Number      = cardNum,
            ExpiryYear  = expiryYear,
            ExpiryMonth = expiryMonth,
            Cvv         = cvv,
            DefaultCard = cb_defaultCard.Checked,

            BillingDetails = new Address()
            {
                AddressLine1 = tb_addrLine1.Text,
                AddressLine2 = tb_addrLine2.Text,
                Postcode     = tb_postcode.Text,
                City         = tb_city.Text,
                State        = tb_state.Text,
                Country      = tb_country.Text,
                Phone        = new Phone()
                {
                    CountryCode = tb_phoneCountryCode.Text,
                    Number      = tb_phoneNumber.Text
                }
            }
        };

        try
        {
            // Create APIClient instance with your secret key
            APIClient ckoAPIClient = new APIClient();

            // Submit your request and receive an apiResponse
            HttpResponse <Checkout.ApiServices.Cards.ResponseModels.Card> apiResponse = ckoAPIClient.CardService.CreateCard(dropdown_customerlist.SelectedValue, cardCreateRequest);

            if (!apiResponse.HasError)
            {
                // Access the response object retrieved from the api
                var card = apiResponse.Model;

                tb_createRsp.Text = String.Format("Card ID:\n {0} \n\nCustomer Name on Card:\n {1} \n\nLast 4 Numbers:\n {2} \n\nPayment Method:\n {3} \n\nJSON Response: \n {4}",
                                                  card.Id, card.Name, card.Last4, card.PaymentMethod, apiResponse.FullJsonResponse);
            }
            else
            {
                // Api has returned an error object. You can access the details in the error property of the apiResponse.
                // apiResponse.error
                tb_createRsp.Text = string.Format("Event ID:\n{0} \n\nMessage:\n{1} \n\nError Code:\n{2} \n\nErrors:\n{3} \n\n{4}",
                                                  apiResponse.Error.EventId, apiResponse.Error.Message, apiResponse.Error.ErrorCode, apiResponse.Error.Errors, apiResponse.FullJsonResponse);
            }
        }
        catch (Exception exc)
        {
            //... Handle exception
        }
    }
示例#22
0
        public HttpResponse <Card> CreateCard(string customerId, CardCreate requestModel)
        {
            var createCardUri = string.Format(ApiUrls.Cards, customerId);

            return(new ApiHttpClient().PostRequest <Card>(createCardUri, AppSettings.SecretKey, requestModel));
        }
示例#23
0
 // Start is called before the first frame update
 void Start()
 {
     CC = GetComponent <CardCreate>();
 }
示例#24
0
 private void openEditDeck()
 {
     DataContext = new CardCreate((CardDeck)DeckList.SelectedItem);
     setUpDeckEditing(true);
 }
 public async Task <CardView> Initialize([FromBody] CardCreate card)
 {
     return(await _dataAccess.CreateCard(card));
 }
示例#26
0
 public HttpResponse <Card> CreateCard(string customerId, CardCreate requestModel)
 {
     return(_cardServiceAsync.CreateCardAsync(customerId, requestModel).Result);
 }