Exemplo n.º 1
0
        protected void btnAddNew_Click(object sender, EventArgs e)
        {
            if (txtCode.Text != empCode)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('Please enter the correct employee code');</script>");
                return;
            }

            if (inpputVal() == false)
            {
                return;
            }
            CreditCardServiceRef.TheWebService pxy = new CreditCardServiceRef.TheWebService();
            CreditCardServiceRef.CreditCardClass creditCard = new CreditCardServiceRef.CreditCardClass();
            CreditCardServiceRef.CustomerClass arthur = new CreditCardServiceRef.CustomerClass();
            DateTime dt = DateTime.Now;
            //Account Number generated uniquely each time using the date time stuff in c# to make a new 10 digit number each time a new card is added
            string accNum = dt.Month.ToString() + dt.Day.ToString() + dt.ToString("yy") + dt.Hour.ToString() + dt.Minute.ToString();
            creditCard.AccountNumber = float.Parse(accNum);
            creditCard.CVV = int.Parse(txtCVV.Text);
            creditCard.CardNumber = int.Parse(txtCCNum.Text);
            creditCard.CreditLimit = float.Parse(txtLimit.Text);
            creditCard.AccountBalance = float.Parse(txtAccBal.Text);
            arthur.Firstname = txtFName.Text;
            arthur.LastName = txtLName.Text;
            pxy.HelloWorld(creditCard, arthur);
        }