protected void EditClient()
        {
            lblAmendError.Text = "";
            bool   success    = false;
            string clientName = tbClientDesc.Text;

            try
            {
                Client editClient = new Client
                {
                    CellularNumber     = tbCellular.Text != "" ? tbCellular.Text : null,
                    AccountingCode     = tbAccountingCode.Text,
                    ClientCode         = tbClientCode.Text,
                    ClientName         = tbClientDesc.Text,
                    ContactMethod      = ddlPrefContactMethod.SelectedIndex == 0 ? 4 : int.Parse(ddlPrefContactMethod.SelectedValue),
                    IdClient           = int.Parse(tbClientId.Text),
                    MaxCallDuration    = tbMaxDuration.Text != "" ? int.Parse(tbMaxDuration.Text) : (int?)null,
                    MaxCallPrice       = tbMaxPrice.Text != "" ? decimal.Parse(tbMaxPrice.Text) : (decimal?)null,
                    MaxIntCallDuration = tbMaxIntDuration.Text != "" ? int.Parse(tbMaxIntDuration.Text) : (int?)null,
                    MaxIntCallPrice    = tbMaxIntPrice.Text != "" ? decimal.Parse(tbMaxIntPrice.Text) : (decimal?)null,
                    RangeFrom          = tbRangeFrom.Text != "" ? int.Parse(tbRangeFrom.Text) : (int?)null,
                    RangeTo            = tbRangeTo.Text != "" ? int.Parse(tbRangeTo.Text) : (int?)null,
                    Email = tbEmail.Text != "" ? tbEmail.Text : null
                };
                using (QCAstServiceClient client = new QCAstServiceClient())
                {
                    success = client.EditClient(editClient);
                }
                if (success)
                {
                    ClearListAndTextboxes();
                    lblSuccess.Text = string.Format("Client {0} has been successfully amended.", clientName);
                }
            }
            catch (Exception ex)
            {
                NotifyWebmasterOfError("Billing", "Client Management EditClient", ex.ToString());
                lblAmendError.Text = string.Format("The website experienced a problem editing client {0}. The webmaster has been notified and will be attending to the problem.", clientName);
            }
        }