Beispiel #1
0
        private void frmCitas_Load(object sender, EventArgs e)
        {
            // TODO: esta línea de código carga datos en la tabla 'lucySpaDB.Cuarto' Puede moverla o quitarla según sea necesario.
            this.cuartoTableAdapter.Fill(this.lucySpaDB.Cuarto);
            // TODO: This line of code loads data into the 'lucySpaDB.Servicio' table. You can move, or remove it, as needed.
            //this.servicioTableAdapter.Fill(this.lucySpaDB.Servicio);
            // TODO: This line of code loads data into the 'lucySpaDB.vistaEmpleado' table. You can move, or remove it, as needed.
            this.vistaEmpleadoTableAdapter.Fill(this.lucySpaDB.vistaEmpleado);
            // TODO: This line of code loads data into the 'lucySpaDB.vistaCLiente' table. You can move, or remove it, as needed.
            this.vistaCLienteTableAdapter.Fill(this.lucySpaDB.vistaCLiente);
            //Cargar por primera vez el datagridview de servicios del cuarto uno que es el que esta por default en el combobox
            this.servicioTableAdapter.FillByCuartoID(this.lucySpaDB.Servicio, 1);

            //Tomar nombre de cliente
            TAClientes taClientes = new TAClientes();

            RowCliente rowCliente = taClientes.GetDataByClienteID(clienteID)[0];
            String nombreCompleto = rowCliente.Nombre + " " + rowCliente.Apellido;
            tbNombreCliente.Text = nombreCompleto + " (" + clienteID + ")";
            if (ModooVentana == "Modificar")
            {
                // Se crea table adapter para obtener los datos de la cita que se quiere modificar//
                TACitas tacitas = new TACitas();
                rowCitas Fila = tacitas.GetDataByCitaID(citaID)[0];
                int servicioID = Fila.ServicioID;
                int empleadoID = Fila.EmpleadoID;
                clienteID = Fila.ClienteID;
                try
                {
                    Realizado = Fila.Realizado;
                }
                catch { }
                // Se obtiene el tamaño del arreglo de la vista Servicio//
                int tamdgvCitas = dgvServicios.RowCount - 1;

                for (int c = 0; c < tamdgvCitas; c++)
                {
                    int fila = (int)dgvServicios.Rows[c].Cells[0].Value;
                    if (fila == servicioID)
                    {
                        dgvServicios.Rows[c].Selected = true;
                    }

                }
                // Se obtiene el tamaño del arreglo de la vista Servicio//
                int tamdgvEmpleado = dgvEmpleado.RowCount - 1;
                for (int c = 0; c < tamdgvEmpleado; c++)
                {
                    int fila = (int)dgvEmpleado.Rows[c].Cells[0].Value;
                    if (fila == empleadoID)
                    {
                        dgvEmpleado.Rows[c].Selected = true;
                    }
                }
                dtpFechaCita.Text = Fila.Fecha.ToString();

            }
        }