예제 #1
0
        private void btnAdd(object sender, EventArgs e)
        {
            if (cliente != null)
            {
                frmAgregarLavarropas frm = new frmAgregarLavarropas(cliente.Id);
                frm.ShowDialog();

                cargarLavarropas(cliente.Id);
            }
            else
            {
                MessageBox.Show(
                    "Se necesita un cliente para poder agregarle un Lavarropas al mismo. \n" +
                    "Es por este motivo que a continuacion se abrira una ventana para que pueda seleccionar uno.",
                    "Atencion", MessageBoxButtons.OK, MessageBoxIcon.Information);

                frmSeleccionarCliente frmSeleccionarCliente = new frmSeleccionarCliente();
                frmSeleccionarCliente.ShowDialog();

                int idCliente = frmSeleccionarCliente.ClienteSeleccionado;

                if (idCliente != -1)
                {
                    frmAgregarLavarropas frm = new frmAgregarLavarropas(idCliente);
                    frm.ShowDialog();
                }

                cargarLavarropas(null);
            }
        }
예제 #2
0
        private void crearCliente(object sender, EventArgs e)
        {
            int idCliente = guardarCliente();

            if (idCliente != -1)
            {
                DialogResult resp = MessageBox.Show(
                    "¿Desea agregarle telefonos a este cliente?",
                    "¿Agregar Telefonos?",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Warning
                    );

                if (resp == DialogResult.Yes)
                {
                    frmAgregarTelefono frm = new frmAgregarTelefono(idCliente);
                    frm.ShowDialog();
                }

                resp = MessageBox.Show(
                    "¿Desea registrar Lavarropas a este Cliente?",
                    "¿Agregar Lavarropas?",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Warning
                    );

                if (resp == DialogResult.Yes)
                {
                    frmAgregarLavarropas frm = new frmAgregarLavarropas(idCliente);
                    frm.ShowDialog();
                }

                resp = MessageBox.Show(
                    "Cliente agregador correctamente",
                    "Guardado Correctamente",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information
                    );

                cctbNombre.Text    = "";
                cctbApellido.Text  = "";
                cctbDireccion.Text = "";

                cctbNombre.Focus();
            }
        }