Exemple #1
0
 //Boton para consultar cliente por cedula
 private void btnSearch_Click(object sender, EventArgs e)
 {
     if (txtIDClient.Text.Trim() != "")
     {
         newClient           = daoClient.selectClient(txtIDClient.Text);
         lblNameCliente.Text = newClient.Name;
     }
     else
     {
         txtAmount.Text      = "";
         txtFact.Text        = "";
         lblNameCliente.Text = "---";
         dtpDate.Value       = DateTime.Now;
         MessageBox.Show("Cliente no existente por favor valide la información.", "Validación del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Exemple #2
0
        //Botón busca cliente
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtIdentification.Text.Trim() != "")
                {
                    if (DaoClient.ExistClient(txtIdentification.Text.Trim()))
                    {
                        newClient          = DaoClient.selectClient(txtIdentification.Text.Trim());
                        lblIDClient.Text   = newClient.Id.ToString();
                        lblNameClient.Text = newClient.Name.Trim();
                        lblMail.Text       = newClient.Email;
                        lblAddress.Text    = newClient.Address;
                        lblPhone.Text      = newClient.Phone;
                        lblCel.Text        = newClient.MobilePhone;
                        lblCredit.Text     = newClient.Credit.ToString("C");
                        lblBanda.Text      = newClient.Banda;
                        if (newClient.IdBand >= 1)
                        {
                            cbBandas.SelectedValue = newClient.IdBand;
                        }
                        else
                        {
                            cbBandas.SelectedValue = 1;
                        }

                        getCreditByIDCliente();
                    }
                    else
                    {
                        btnClear_Click(null, null);
                        MessageBox.Show("Cliente no existente",
                                        "Validación del Sistema",
                                        MessageBoxButtons.OK,
                                        MessageBoxIcon.Exclamation);
                    }
                }
                else
                {
                    btnClear_Click(null, null);
                    MessageBox.Show("El Campo Identificación no debe estar vacío",
                                    "Validación",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al cargar datos del Cliente:\n" + ex.Message,
                                "Error del Sistema",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }
Exemple #3
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtIDClient.Text.Trim() != "")
                {
                    if (daoClient.ExistClient(txtIDClient.Text.Trim()))
                    {
                        newClient = daoClient.selectClient(txtIDClient.Text.Trim());

                        txtIDClient.Text      = newClient.ID.Trim();
                        txtNameClient.Text    = newClient.Name.Trim();
                        cbBands.SelectedValue = newClient.IdBand;
                        txtEmailClient.Text   = newClient.Email;
                        txtAddressClient.Text = newClient.Address;
                        txtPhoneClient.Text   = newClient.Phone;
                        txtCelClient.Text     = newClient.MobilePhone;
                        txtCreditClient.Text  = newClient.Credit.ToString("C");
                    }
                    else
                    {
                        MessageBox.Show("Cliente no existente",
                                        "Validación del Sistema",
                                        MessageBoxButtons.OK,
                                        MessageBoxIcon.Exclamation);

                        txtNameClient.Text    = "";
                        cbBands.SelectedValue = "";
                        txtEmailClient.Text   = "";
                        txtAddressClient.Text = "";
                        txtPhoneClient.Text   = "";
                        txtCelClient.Text     = "";
                        txtCreditClient.Text  = "$0";
                    }
                }
                else
                {
                    btnClear_Click(null, null);
                    MessageBox.Show("El Campo Identificación no debe estar vacío",
                                    "Validación del Sistema",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al cargar datos del Cliente:\n" + ex.Message,
                                "Error del Sistema",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }