Esempio n. 1
0
 public string updateCustomer(ref CCCustomer myCustomer, int apiKey)
 {
     object[] results = this.Invoke("updateCustomer", new object[] {
         myCustomer,
         apiKey
     });
     myCustomer = ((CCCustomer)(results[1]));
     return((string)(results[0]));
 }
Esempio n. 2
0
        protected void gvCustomers_RowUpdating(Object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e)
        {
            int rowIndex = e.RowIndex;

            string custID = gvCustomers.Rows[rowIndex].Cells[ID_COL].Text;

            // Retrieve a reference to a TextBox created by the GridView when it's in edit-mode
            TextBox TBox     = (TextBox)gvCustomers.Rows[rowIndex].Cells[LNAME_COL].Controls[FIRST_CONTROL];
            string  lastName = TBox.Text;

            TBox = (TextBox)gvCustomers.Rows[rowIndex].Cells[FNAME_COL].Controls[FIRST_CONTROL];
            string firstName = TBox.Text;

            TBox = (TextBox)gvCustomers.Rows[rowIndex].Cells[PHONE_COL].Controls[FIRST_CONTROL];
            string phone = TBox.Text;

            TBox = (TextBox)gvCustomers.Rows[rowIndex].Cells[SSN_COL].Controls[FIRST_CONTROL];
            string ssn = TBox.Text;

            TBox = (TextBox)gvCustomers.Rows[rowIndex].Cells[ADDR_COL].Controls[FIRST_CONTROL];
            string streetAddress = TBox.Text;

            TBox = (TextBox)gvCustomers.Rows[rowIndex].Cells[CITY_COL].Controls[FIRST_CONTROL];
            string city = TBox.Text;

            DropDownList statesDropDown = (DropDownList)gvCustomers.Rows[rowIndex].FindControl("ddlStatesGv");
            string       state          = statesDropDown.SelectedValue;

            TBox = (TextBox)gvCustomers.Rows[rowIndex].Cells[ZIP_COL].Controls[FIRST_CONTROL];
            string zip = TBox.Text;


            if (validateGvInput(lastName, firstName, streetAddress, city, zip, ssn, phone))
            {
                CreditCardSvc.CCCustomer tempCustomer = new CreditCardSvc.CCCustomer();

                tempCustomer.CustID        = custID;
                tempCustomer.LastName      = lastName;
                tempCustomer.FirstName     = firstName;
                tempCustomer.StreetAddress = streetAddress;
                tempCustomer.City          = city;
                tempCustomer.State         = state;
                tempCustomer.Zip           = zip;
                tempCustomer.SSN           = ssn;
                tempCustomer.Phone         = phone;

                lblDisplay.Text    = pxy.updateCustomer(ref tempCustomer, API_KEY);
                lblDisplay.Visible = true;


                // Set the GridView back to the original state.
                // No rows currently being edited.
                gvCustomers.EditIndex = -1;

                populateCustomers();
            }
        }
Esempio n. 3
0
 /// <remarks/>
 public void updateCustomerAsync(CCCustomer myCustomer, int apiKey, object userState)
 {
     if ((this.updateCustomerOperationCompleted == null))
     {
         this.updateCustomerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnupdateCustomerOperationCompleted);
     }
     this.InvokeAsync("updateCustomer", new object[] {
         myCustomer,
         apiKey
     }, this.updateCustomerOperationCompleted, userState);
 }
Esempio n. 4
0
        //add customer event handler
        protected void btnAddCustomer_Click(object sender, EventArgs e)
        {
            if (validateInputs())
            {
                CreditCardSvc.CCCustomer myCustomer = new CreditCardSvc.CCCustomer();

                myCustomer.LastName      = txtLastName.Text;
                myCustomer.FirstName     = txtFirstName.Text;
                myCustomer.StreetAddress = txtStreetAddress.Text;
                myCustomer.City          = txtCity.Text;
                myCustomer.State         = ddlState.SelectedValue;
                myCustomer.Zip           = txtZip.Text;
                myCustomer.Phone         = txtPhone.Text;
                myCustomer.SSN           = txtSSN.Text;

                lblDisplay.Text    = pxy.addCustomer(ref myCustomer, API_KEY);
                lblDisplay.Visible = true;

                populateCustomers();
            }
        }
Esempio n. 5
0
 /// <remarks/>
 public void updateCustomerAsync(CCCustomer myCustomer, int apiKey)
 {
     this.updateCustomerAsync(myCustomer, apiKey, null);
 }
Esempio n. 6
0
 /// <remarks/>
 public void addCustomerAsync(CCCustomer myCustomer, int apiKey)
 {
     this.addCustomerAsync(myCustomer, apiKey, null);
 }