コード例 #1
0
        void CargarTurno()
        {
            NTurnos        n     = new NTurnos();
            List <ETurnos> lista = n.ListaTurnos();

            cbmTurno.DisplayMember = "Turno";
            cbmTurno.ValueMember   = "TurnoID";
            cbmTurno.DataSource    = lista;
        }
コード例 #2
0
ファイル: docenteAsignatura.cs プロジェクト: fredreyes/SGA
 void CargarTurnos()
 {
     try
     {
         NTurnos        n     = new NTurnos();
         List <ETurnos> Lista = n.ListaTurnos();
         cbmTurno.DataSource    = Lista;
         cbmTurno.DisplayMember = "Turno";
         cbmTurno.ValueMember   = "TurnoId";
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #3
0
ファイル: Matricula.cs プロジェクト: fredreyes/SGA
 void cargarTurno()
 {
     try
     {
         NTurnos        n           = new NTurnos();
         List <ETurnos> listaTurnos = n.ListaTurnos();
         cbmTurnos.DataSource    = listaTurnos;
         cbmTurnos.DisplayMember = "Turno";
         cbmTurnos.ValueMember   = "TurnoId";
         cbmTurnos.Text          = "Seleccione un Turno";
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #4
0
ファイル: Turnos.cs プロジェクト: fredreyes/SGA
        void CargaLista()
        {
            NTurnos        n     = new NTurnos();
            List <ETurnos> Lista = n.ListaTurnos();

            dataGridView1.DataSource         = Lista;
            dataGridView1.Columns[0].Visible = false;
            for (int i = 0; i < dataGridView1.RowCount; i++)
            {
                if (Convert.ToBoolean(dataGridView1.Rows[i].Cells["Activo"].Value.ToString()) == false)
                {
                    dataGridView1.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
                }
                else
                {
                    dataGridView1.Rows[i].DefaultCellStyle.ForeColor = Color.Black;
                }
            }
        }
コード例 #5
0
ファイル: Turnos.cs プロジェクト: fredreyes/SGA
        private void btningresar_Click_1(object sender, EventArgs e)
        {
            ETurnos t = new ETurnos();
            NTurnos n = new NTurnos();

            try
            {
                if (Bandera == 0)
                {
                    t.Turno       = txtTurno.Text;
                    t.Descripcion = txtObservacion.Text;
                    n.IngresarTurno(t);
                    LimpiarControles();
                    MessageBox.Show("Turno Ingresado con exito", "SGA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    CargaLista();
                }
                if (Bandera == 1)
                {
                    if (chkeditar.Checked)
                    {
                        t.TurnoId     = Convert.ToInt32(txtTurno.Tag);
                        t.Turno       = txtTurno.Text;
                        t.Descripcion = txtObservacion.Text;
                        t.Activo      = Convert.ToBoolean(rbtnActivo.Checked ? 1 : 0);
                        n.ModificarTurno(t);
                        LimpiarControles();
                        MessageBox.Show("Turno Modificado con exito", "SGA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        CargaLista();
                        OcultarControles();
                    }
                    else
                    {
                        MessageBox.Show("si has seleccionado un dato, por favor vuelve a marcar EDITAR", "SGA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "SGA", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #6
0
ファイル: Turnos.cs プロジェクト: fredreyes/SGA
        private void eliminarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                ETurnos t = new ETurnos();
                NTurnos n = new NTurnos();

                t.TurnoId = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["TurnoId"].Value.ToString());
                var          tu = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["Turno"].Value.ToString();
                DialogResult o  = MessageBox.Show("¿Realmente deseas eliminar el turno " + tu + "?", "SGA", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (o == DialogResult.OK)
                {
                    n.EliminarTurno(t);
                    MessageBox.Show("Turno eliminado con exito", "SGA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    LimpiarControles();
                    CargaLista();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "SGA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #7
0
        private async void LoadReporteDiario(DateTime fecha)
        {
            MensajeEspera.ShowWait("Cargando reporte...");
            StringBuilder info = new StringBuilder();
            //Obtener el turno de esta fecha
            DataTable dtTurnos =
                NTurnos.BuscarTurnos("FECHA INICIO", fecha.ToString("yyyy-MM-dd"), out string rpta);

            if (dtTurnos != null)
            {
                Turnos turno = new Turnos(dtTurnos.Rows[0]);
                info.Append("Valor inicial en caja ").Append(turno.Valor_inicial.ToString("C")).Append(Environment.NewLine);
                info.Append("Se empezó con ").Append(turno.Clientes_iniciales).Append(" clientes y se terminó con ").Append(turno.Clientes_total).Append(Environment.NewLine);

                //Obtener los clientes nuevos
                var(rpta1, dtVentas) =
                    await NVentas.BuscarVentas("FECHA ID COBRO", fecha.ToString("yyyy-MM-dd"));

                if (dtVentas != null)
                {
                    info.Append("Clientes nuevos o renovados ").Append(dtVentas.Rows.Count).Append(Environment.NewLine);
                }
                else
                {
                    info.Append("No hubieron clientes nuevos o renovados ");
                }

                info.Append("Total de ventas y renovaciones ").Append(turno.Recaudo_ventas_nuevas.ToString("C")).Append(Environment.NewLine);
                info.Append("Recaudo pretendido ").Append(turno.Recaudo_pretendido_turno.ToString("C")).Append(Environment.NewLine);

                decimal porcentajeRecaudado = (turno.Recaudo_cuotas * 100) / turno.Recaudo_pretendido_turno;

                info.Append("Total recaudado ").Append(turno.Recaudo_cuotas.ToString("C")).Append(" (" + ((int)porcentajeRecaudado) + "%)").Append(Environment.NewLine);
                info.Append("Otros ingresos ").Append(turno.Recaudo_otros.ToString("C")).Append(Environment.NewLine);

                if (turno.Gastos_total == 0)
                {
                    info.Append("No hubieron gastos").Append(Environment.NewLine);
                }
                else
                {
                    info.Append("Gastos/Egresos ").Append(turno.Gastos_total.ToString("C")).Append(Environment.NewLine);
                }

                info.Append(Environment.NewLine);
                info.Append("CAJA FINAL ").Append(turno.Recaudo_real.ToString("C")).Append(Environment.NewLine);
                info.Append(Environment.NewLine);

                if (dtVentas != null)
                {
                    info.Append("Resumen de clientes nuevos o renovados").Append(Environment.NewLine);
                    foreach (DataRow row in dtVentas.Rows)
                    {
                        Ventas venta = new Ventas(row);
                        info.Append("* Nombre: ").Append(venta.Cliente.NombreCompleto).Append(" - Celular: ").Append(venta.Cliente.Celular).Append(Environment.NewLine);
                        info.Append("- Valor préstamo: ").Append(venta.Valor_venta.ToString("C")).Append(" - Plazo: ").Append(venta.Numero_cuotas).Append(Environment.NewLine);
                    }
                }

                DataTable dtGastos =
                    NGastos.BuscarGastos("FECHA ID COBRO", fecha.ToString("yyyy-MM-dd"), out rpta);
                if (dtGastos != null)
                {
                    info.Append(Environment.NewLine);
                    info.Append("Resumen de gastos o egresos").Append(Environment.NewLine);
                    foreach (DataRow row in dtGastos.Rows)
                    {
                        Gastos gasto = new Gastos(row);
                        info.Append("* " + gasto.Tipo_gasto.Nombre_tipo_gasto + " - ").Append(" - Observaciones: ").Append(gasto.Observaciones_gasto);
                        info.Append(" - Valor: ").Append(gasto.Valor_gasto.ToString("C")).Append(Environment.NewLine);
                    }
                }

                FrmReporteDiario frmReporteDiario = new FrmReporteDiario
                {
                    FormBorderStyle  = FormBorderStyle.None,
                    TopMost          = false,
                    TopLevel         = false,
                    Dock             = DockStyle.Fill,
                    InformacionTurno = info.ToString(),
                    FechaHoraReporte = "Fecha y hora de generación: " + DateTime.Now.ToLongDateString(),
                    FechaHoraTurno   = "Fecha y hora de turno: " + turno.Fecha_inicio_turno.ToLongDateString(),
                };

                if (this.gbResultados.Controls.Count > 0)
                {
                    this.gbResultados.Controls.Clear();
                }

                this.gbResultados.Controls.Add(frmReporteDiario);
                frmReporteDiario.Show();
            }
            else
            {
                MensajeEspera.CloseForm();
                info.Append("No se encontró el turno");
                Mensajes.MensajeInformacion("No se encontró el turno, o bien, se encuentra cerrado en la fecha seleccionada", "Entendido");
            }
            MensajeEspera.CloseForm();
        }