protected void DataGet(getCardsResponse getCards)
        {
            DataTable dt = new DataTable();

            dt.Columns.AddRange(new DataColumn[10] {
                new DataColumn("CardId", typeof(string)),
                new DataColumn("CardBrand", typeof(string)),
                new DataColumn("Alias", typeof(string)),
                new DataColumn("MaskedCardNo", typeof(string)),
                new DataColumn("IsDefault", typeof(string)),
                new DataColumn("IsExpired", typeof(string)),
                new DataColumn("ShowEulaId", typeof(string)),
                new DataColumn("IsThreeDValidated", typeof(string)),
                new DataColumn("IsOTPValidated", typeof(string)),
                new DataColumn("ActivationDate", typeof(string))
            });

            if (getCards != null && getCards.cardList != null)
            {
                foreach (card item in getCards.cardList)
                {
                    dt.Rows.Add(item.cardId, item.cardBrand, item.alias, item.maskedCardNo, item.isDefault, item.isExpired, item.showEulaId,
                                item.isThreeDValidated, item.isOTPValidated, item.activationDate);
                }
            }
            TempDataTable(dt);
            GetCardsGridView.DataSource = dt;
            GetCardsGridView.DataBind();
        }
Пример #2
0
        public getCardsResponse GetCards()
        {
            GetCardsClientService client   = new GetCardsClientService();
            getCardsRequest       request  = TestData();
            getCardsResponse      response = new getCardsResponse();

            // for SOAP
            //response = client.SoapClient(request);
            //Assert.IsNotNull(response);

            // for REST
            response = client.RestClient(Constants.GET_CARDS_URL, TestData());

            return(response);
        }
        protected void SearchButtonOnClick(Object sender, EventArgs e)
        {
            string msisdn = ((TextBox)form1.FindControl("Msisdn")).Text;

            getCardsResponse response = GetCards(msisdn);

            if (response != null)
            {
                if (response.cardList == null || response.cardList.Length == 0)
                {
                    ShowMessage("Kart Bulunamadı!");
                }
                else
                {
                    DataGet(response);
                }
            }
        }
        private getCardsResponse GetCards(string msisdn)
        {
            GetCardsClientService client   = new GetCardsClientService();
            getCardsResponse      response = null;
            getCardsRequest       request  = null;

            GetCardsRequestFactory factory = new GetCardsRequestFactory();

            factory.request.msisdn = msisdn;

            try
            {
                request  = factory.Build();
                response = client.OptionalRequest(MySession.Current.requestFilter, request);
                return(response);
            } catch (Exception ex)
            {
                ShowMessage(ex.Message);
                return(null);
            }
        }
Пример #5
0
        public void RunTest()
        {
            getCardsResponse response = GetCards();

            Assert.IsNotNull(response);
        }