Example #1
0
        private void clientesToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmCustomerSearch pc = new frmCustomerSearch();

            pc.type = false;
            pc.Show();
        }
Example #2
0
        // when buscar demandado button is clicked.
        private void btnSearchDemandado_Click(object sender, EventArgs e)
        {
            frmCustomerSearch pCustomer = new frmCustomerSearch();

            pCustomer.type       = true;
            pCustomer.Text       = "Busqueda Demandados";
            pCustomer.pGetStatus = "Demandado";
            pCustomer.ShowDialog();
            if (pCustomer.pCustSelectedID != null)
            {
                try
                {
                    if (clientes.getCustomerObject(pCustomer.pCustSelectedID, "") != null)
                    {
                        clientes pClientes = clientes.getCustomerObject(pCustomer.pCustSelectedID, "");
                        if (pClientes.Status == "Demandado")
                        {
                            pDemandado                 = pClientes;
                            cID2                       = pClientes.ID;
                            pbDemandado.Image          = Image.FromFile(pClientes.Image);
                            txtIDDemandado.Text        = pClientes.ID;
                            txtNameDemandado.Text      = pClientes.Nombre;
                            txtLastNameDemandado.Text  = pClientes.Apellido;
                            txtPhoneDemandado.Text     = pClientes.Telefono;
                            txtCellphoneDemandado.Text = pClientes.Celular;
                            if (Convert.ToInt32(clientes.verifyDocument(pCustomer.pCustSelectedID, "")) <= 0)
                            {
                                rbCedulaO.Checked = true;
                            }
                            else
                            {
                                rbPasaporteO.Checked = true;
                            }
                            txtCedulaDemandado.Text = pClientes.Cedula;
                        }
                        else
                        {
                            MessageBox.Show("El cliente no ha sido registrado como un demandado, seleccione uno diferente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            btnSearchDemandado.Focus();
                        }
                    }
                    else
                    {
                        MessageBox.Show("No existe el cliente, digite un id valido", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        txtIDDemandado.Clear();
                        txtIDDemandado.Focus();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("No se selecciono el Demandado, Intentelo nuevamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #3
0
        // when buscar button is clicked.
        private void btnSearchBuy_Click(object sender, EventArgs e)
        {
            frmCustomerSearch pComprador = new frmCustomerSearch();

            pComprador.type       = true;
            pComprador.Text       = "Buscar Comprador";
            pComprador.pGetStatus = "Comprador";
            pComprador.ShowDialog();
            if (pComprador.pCustSelectedID != null)
            {
                try
                {
                    if (clientes.getCustomerObject(pComprador.pCustSelectedID, "") != null)
                    {
                        clientes pClientes = clientes.getCustomerObject(pComprador.pCustSelectedID, "");
                        if (pClientes.Status == "Comprador")
                        {
                            cID                 = pClientes.ID;
                            pComprador1         = pClientes;
                            pbComprador.Image   = Image.FromFile(pClientes.Image);
                            txtIDBuy.Text       = pClientes.ID;
                            txtNameBuy.Text     = pClientes.Nombre;
                            txtLastNameBuy.Text = pClientes.Apellido;
                            if (Convert.ToInt32(clientes.verifyDocument(pComprador.pCustSelectedID, "")) <= 0)
                            {
                                rbCedulaCo.Checked = true;
                            }
                            else
                            {
                                rbPasaporteCo.Checked = true;
                            }
                            txtCedulaBuy.Text  = pClientes.Cedula;
                            txtCelularBuy.Text = pClientes.Celular;
                            txtPhoneBuy.Text   = pClientes.Telefono;
                        }
                        else
                        {
                            MessageBox.Show("No se ha seleccionado un comprador", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            btnSearchBuy.Focus();
                        }
                    }
                    else
                    {
                        MessageBox.Show("No existe el comprador, digite un ID valido", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        txtIDBuy.Clear();
                        txtIDBuy.Focus();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("No se selecciono un comprador", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #4
0
        // when buscar cliente is clicked.
        private void btnSearchCustomer_Click(object sender, EventArgs e)
        {
            frmCustomerSearch pc = new frmCustomerSearch();

            pc.type       = true;
            pc.Text       = "Busqueda de Clientes";
            pc.pGetStatus = "Cliente";
            pc.ShowDialog();

            if (pc.pCustSelectedID != null)
            {
                // assign the ID value to the variable.
                cID = pc.pCustSelectedID;
                // load the customer.
                clientes pClientes = clientes.getCustomerObject(pc.pCustSelectedID, "");
                if (pClientes.Status == "Cliente")
                {
                    pCliente             = pClientes;
                    txtCustID.Text       = pClientes.ID;
                    pbCliente.Image      = Image.FromFile(pClientes.Image);
                    txtCustName.Text     = pClientes.Nombre;
                    txtCustLastName.Text = pClientes.Apellido;
                    txtCustPhone.Text    = pClientes.Telefono;
                    txtCustCell.Text     = pClientes.Celular;
                    if (Convert.ToInt32(clientes.verifyDocument(pc.pCustSelectedID, "")) <= 0)
                    {
                        rbCedulaCli.Checked = true;
                    }
                    else
                    {
                        rbPasaporteCli.Checked = true;
                    }
                    txtCedulaClie.Text = pCliente.Cedula;
                }
                else
                {
                    MessageBox.Show("El cliente seleccionado no esta correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    btnSearchCustomer.Focus();
                }
            }
            else
            {
                MessageBox.Show("NO se selecciono el cliente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #5
0
        private void btnSearchInqui_Click(object sender, EventArgs e)
        {
            frmCustomerSearch pSearch = new frmCustomerSearch();

            pSearch.type       = true;
            pSearch.Text       = "Busqueda de Inquilino";
            pSearch.pGetStatus = "Inquilino";
            pSearch.ShowDialog();
            if (pSearch.pCustSelectedID != null)
            {
                // assign the ID value to the variable.
                iID = pSearch.pCustSelectedID;
                // load the customer.
                clientes pClientes = clientes.getCustomerObject(pSearch.pCustSelectedID, "");
                if (pClientes.Status == "Inquilino")
                {
                    pInquilino             = pClientes;
                    txtIDInqui.Text        = pClientes.ID;
                    pbInquilino.Image      = Image.FromFile(pClientes.Image);
                    txtNameInqui.Text      = pClientes.Nombre;
                    txtLastNameInqui.Text  = pClientes.Apellido;
                    txtPhoneInqui.Text     = pClientes.Telefono;
                    txtCellphoneInqui.Text = pClientes.Celular;
                    if (Convert.ToInt32(clientes.verifyDocument(pSearch.pCustSelectedID, "")) <= 0)
                    {
                        rbCedulaIn.Checked = true;
                    }
                    else
                    {
                        rbPasaporteIn.Checked = true;
                    }
                    txtCedulaIn.Text = pClientes.Cedula;
                }
                else
                {
                    MessageBox.Show("El cliente no esta clasificado exitosamente, seleccione un Inquilino de la tabla", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    btnSearchInqui.Focus();
                }
            }
            else
            {
                MessageBox.Show("No se selecciono un inquilino", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #6
0
        // when buscar Garante is clicked.
        private void btnSearchGaran_Click(object sender, EventArgs e)
        {
            frmCustomerSearch pSearch = new frmCustomerSearch();

            pSearch.type       = true;
            pSearch.Text       = "Busqueda de Garantes";
            pSearch.pGetStatus = "Garante";
            pSearch.ShowDialog();
            if (pSearch.pCustSelectedID != null)
            {
                // assign the ID value to the variable.
                gID = pSearch.pCustSelectedID;
                // load the customer.
                clientes pClientes = clientes.getCustomerObject(pSearch.pCustSelectedID, "");
                if (pClientes.Status == "Garante")
                {
                    pGarante               = pClientes;
                    txtIDGaran.Text        = pClientes.ID;
                    pbGarante.Image        = Image.FromFile(pClientes.Image);
                    txtNameGaran.Text      = pClientes.Nombre;
                    txtLastNameGaran.Text  = pClientes.Apellido;
                    txtPhoneGaran.Text     = pClientes.Telefono;
                    txtCellphoneGaran.Text = pClientes.Celular;
                    if (Convert.ToInt32(clientes.verifyDocument(pSearch.pCustSelectedID, "")) <= 0)
                    {
                        rbCedulaGa.Checked = true;
                    }
                    else
                    {
                        rbPasaporteGa.Checked = true;
                    }
                    txtCedulaGa.Text = pClientes.Cedula;
                }
                else
                {
                    MessageBox.Show("No se ha seleccionado el garante", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    btnSearchGaran.Focus();
                }
            }
        }
Example #7
0
 // when buscar Garante is clicked.
 private void btnSearchGaran_Click(object sender, EventArgs e)
 {
     frmCustomerSearch pSearch = new frmCustomerSearch();
     pSearch.type = true;
     pSearch.Text = "Busqueda de Garantes";
     pSearch.pGetStatus = "Garante";
     pSearch.ShowDialog();
     if(pSearch.pCustSelectedID != null)
     {
         // assign the ID value to the variable.
         gID = pSearch.pCustSelectedID;
         // load the customer.
         clientes pClientes = clientes.getCustomerObject(pSearch.pCustSelectedID, "");
         if (pClientes.Status == "Garante")
         {
             pGarante = pClientes;
             txtIDGaran.Text = pClientes.ID;
             pbGarante.Image = Image.FromFile(pClientes.Image);
             txtNameGaran.Text = pClientes.Nombre;
             txtLastNameGaran.Text = pClientes.Apellido;
             txtPhoneGaran.Text = pClientes.Telefono;
             txtCellphoneGaran.Text = pClientes.Celular;
             if(Convert.ToInt32(clientes.verifyDocument(pSearch.pCustSelectedID, "")) <= 0)
             {
                 rbCedulaGa.Checked = true;
             }
             else
             {
                 rbPasaporteGa.Checked = true;
             }
             txtCedulaGa.Text = pClientes.Cedula;
         }
         else
         {
             MessageBox.Show("No se ha seleccionado el garante", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             btnSearchGaran.Focus();
         }
     }
 }
Example #8
0
        // when buscar cliente is clicked.
        private void btnSearchCustomer_Click(object sender, EventArgs e)
        {
            frmCustomerSearch pc = new frmCustomerSearch();
            pc.type = true;
            pc.Text = "Busqueda de Clientes";
            pc.pGetStatus = "Cliente";
            pc.ShowDialog();

            if(pc.pCustSelectedID != null)
            {
                // assign the ID value to the variable.
                cID = pc.pCustSelectedID;
                // load the customer.
                clientes pClientes = clientes.getCustomerObject(pc.pCustSelectedID, "");
                if (pClientes.Status == "Cliente")
                {
                    pCliente = pClientes;
                    txtCustID.Text = pClientes.ID;
                    pbCliente.Image = Image.FromFile(pClientes.Image);
                    txtCustName.Text = pClientes.Nombre;
                    txtCustLastName.Text = pClientes.Apellido;
                    txtCustPhone.Text = pClientes.Telefono;
                    txtCustCell.Text = pClientes.Celular;
                    if(Convert.ToInt32(clientes.verifyDocument(pc.pCustSelectedID, "")) <= 0)
                    {
                        rbCedulaCli.Checked = true;
                    }
                    else
                    {
                        rbPasaporteCli.Checked = true;
                    }
                    txtCedulaClie.Text = pCliente.Cedula;
                }
                else
                {
                    MessageBox.Show("El cliente seleccionado no esta correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    btnSearchCustomer.Focus();
                }
            }
            else
            {
                MessageBox.Show("NO se selecciono el cliente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #9
0
 private void btnSearchInqui_Click(object sender, EventArgs e)
 {
     frmCustomerSearch pSearch = new frmCustomerSearch();
     pSearch.type = true;
     pSearch.Text = "Busqueda de Inquilino";
     pSearch.pGetStatus = "Inquilino";
     pSearch.ShowDialog();
     if(pSearch.pCustSelectedID != null)
     {
         // assign the ID value to the variable.
         iID = pSearch.pCustSelectedID;
         // load the customer.
         clientes pClientes = clientes.getCustomerObject(pSearch.pCustSelectedID, "");
         if (pClientes.Status == "Inquilino")
         {
             pInquilino = pClientes;
             txtIDInqui.Text = pClientes.ID;
             pbInquilino.Image = Image.FromFile(pClientes.Image);
             txtNameInqui.Text = pClientes.Nombre;
             txtLastNameInqui.Text = pClientes.Apellido;
             txtPhoneInqui.Text = pClientes.Telefono;
             txtCellphoneInqui.Text = pClientes.Celular;
             if(Convert.ToInt32(clientes.verifyDocument(pSearch.pCustSelectedID, "")) <= 0)
             {
                 rbCedulaIn.Checked = true;
             }
             else
             {
                 rbPasaporteIn.Checked = true;
             }
             txtCedulaIn.Text = pClientes.Cedula;
         }
         else
         {
             MessageBox.Show("El cliente no esta clasificado exitosamente, seleccione un Inquilino de la tabla", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             btnSearchInqui.Focus();
         }
     }
     else
     {
         MessageBox.Show("No se selecciono un inquilino", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Example #10
0
 // when buscar button is clicked.
 private void btnSearchBuy_Click(object sender, EventArgs e)
 {
     frmCustomerSearch pComprador = new frmCustomerSearch();
     pComprador.type = true;
     pComprador.Text = "Buscar Comprador";
     pComprador.pGetStatus = "Comprador";
     pComprador.ShowDialog();
     if(pComprador.pCustSelectedID != null)
     {
         try
         {
             if (clientes.getCustomerObject(pComprador.pCustSelectedID, "") != null)
             {
                 clientes pClientes = clientes.getCustomerObject(pComprador.pCustSelectedID, "");
                 if (pClientes.Status == "Comprador")
                 {
                     cID = pClientes.ID;
                     pComprador1 = pClientes;
                     pbComprador.Image = Image.FromFile(pClientes.Image);
                     txtIDBuy.Text = pClientes.ID;
                     txtNameBuy.Text = pClientes.Nombre;
                     txtLastNameBuy.Text = pClientes.Apellido;
                     if(Convert.ToInt32(clientes.verifyDocument(pComprador.pCustSelectedID, "")) <= 0)
                     {
                         rbCedulaCo.Checked = true;
                     }
                     else
                     {
                         rbPasaporteCo.Checked = true;
                     }
                     txtCedulaBuy.Text = pClientes.Cedula;
                     txtCelularBuy.Text = pClientes.Celular;
                     txtPhoneBuy.Text = pClientes.Telefono;
                 }
                 else
                 {
                     MessageBox.Show("No se ha seleccionado un comprador", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                     btnSearchBuy.Focus();
                 }
             }
             else
             {
                 MessageBox.Show("No existe el comprador, digite un ID valido", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 txtIDBuy.Clear();
                 txtIDBuy.Focus();
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("No se selecciono un comprador", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #11
0
 private void clientesToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     frmCustomerSearch pc = new frmCustomerSearch();
     pc.type = false;
     pc.Show();
 }
Example #12
0
 // when buscar demandado button is clicked.
 private void btnSearchDemandado_Click(object sender, EventArgs e)
 {
     frmCustomerSearch pCustomer = new frmCustomerSearch();
     pCustomer.type = true;
     pCustomer.Text = "Busqueda Demandados";
     pCustomer.pGetStatus = "Demandado";
     pCustomer.ShowDialog();
     if (pCustomer.pCustSelectedID != null)
     {
         try
         {
             if (clientes.getCustomerObject(pCustomer.pCustSelectedID, "") != null)
             {
                 clientes pClientes = clientes.getCustomerObject(pCustomer.pCustSelectedID, "");
                 if (pClientes.Status == "Demandado")
                 {
                     pDemandado = pClientes;
                     cID2 = pClientes.ID;
                     pbDemandado.Image = Image.FromFile(pClientes.Image);
                     txtIDDemandado.Text = pClientes.ID;
                     txtNameDemandado.Text = pClientes.Nombre;
                     txtLastNameDemandado.Text = pClientes.Apellido;
                     txtPhoneDemandado.Text = pClientes.Telefono;
                     txtCellphoneDemandado.Text = pClientes.Celular;
                     if(Convert.ToInt32(clientes.verifyDocument(pCustomer.pCustSelectedID, "")) <= 0)
                     {
                         rbCedulaO.Checked = true;
                     }
                     else
                     {
                         rbPasaporteO.Checked = true;
                     }
                     txtCedulaDemandado.Text = pClientes.Cedula;
                 }
                 else
                 {
                     MessageBox.Show("El cliente no ha sido registrado como un demandado, seleccione uno diferente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                     btnSearchDemandado.Focus();
                 }
             }
             else
             {
                 MessageBox.Show("No existe el cliente, digite un id valido", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 txtIDDemandado.Clear();
                 txtIDDemandado.Focus();
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("No se selecciono el Demandado, Intentelo nuevamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }