public frmPagoMat(Service.matricula c)
        {
            InitializeComponent();

            txtTotalAPagar.Text = c.monto.ToString();
            txtAbonar.Text      = "0";
            txtPendiente.Text   = c.monto.ToString();
        }
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            int idClase;

            //validar los datos antes

            //se construye clase particular
            cp                = new Service.claseParticular();
            cp.colaborador    = docente;
            cp.descripcion    = txtDescripcion.Text;
            cp.direccion      = txtDireccion.Text;
            cp.distrito       = cboDistrito.SelectedItem.ToString();
            cp.fecha          = dtpFechaMatricula.Value;
            cp.fechaSpecified = true;
            //se debe revisar la hora en el DateTime

            //cp.horaIni = (DateTime.Parse(cboHoraIni.SelectedItem.ToString()));
            //cp.horaFin = (DateTime.Parse(cboHoraFin.SelectedItem.ToString()));

            cp.horaIni = DateTime.Now;
            cp.horaFin = DateTime.Now;

            cp.horaFinSpecified = true;
            cp.horaIniSpecified = true;
            cp.nombre           = txtNombreServicio.Text;
            cp.observaciones    = txtObservaciones.Text;
            cp.precio           = float.Parse(txtPrecio.Text);
            //insertar clase particular
            idClase        = Program.dbController.insertarClaseParticular(cp);
            cp.id_servicio = idClase;

            //se construye la matricula
            Service.matricula mat = new Service.matricula();
            mat.cliente        = cliente;
            mat.descuento      = (Service.descuento)cboDescuentos.SelectedItem;
            mat.fecha          = DateTime.Today;
            mat.fechaSpecified = true;
            mat.monto          = cp.precio;
            mat.saldo          = float.Parse(txtSaldo.Text);
            mat.servicio       = cp;

            //cuota
            if (txtAbonar.Text != "0")
            {
                Service.cuota cuota = new Service.cuota();
                cuota.fecha          = DateTime.Today;
                cuota.fechaSpecified = true;
                cuota.formaPago      = cboFormaPago.SelectedItem.ToString();
                cuota.monto          = float.Parse(txtAbonar.Text);
                //insertar cuota
                mat.saldo = mat.saldo - cuota.monto;
            }
            Program.dbController.insertarMatricula(mat);

            frmMensaje mensaje = new frmMensaje("Clase Particular Registrada", "Mensaje de confirmación", "");
        }
Beispiel #3
0
 private void btnCancelar_Click(object sender, EventArgs e)
 {
     cliente                    = null;
     servMat                    = null;
     txtDNI.Text                = "";
     txtNombreCliente.Text      = "";
     txtNombreServicio.Text     = "";
     txtAbonar.Text             = "0";
     txtPendiente.Text          = "";
     cboFormaPago.SelectedIndex = -1;
 }
        public frmPagoMat(Service.matricula c)
        {
            InitializeComponent();
            Formateador f = new Formateador();
            Paleta      p = new Paleta();

            this.BackColor = p.Blanco;
            f.formatearBotonNaranja(btnGuardar);


            txtTotalAPagar.Text        = c.monto.ToString();
            txtAbonar.Text             = "0";
            txtPendiente.Text          = c.monto.ToString();
            cboFormaPago.SelectedIndex = 0;
        }
 private void btnListarServicios_Click(object sender, EventArgs e)
 {
     if (cliente != null)
     {
         frmBuscarServicioPorCliente formBuscarServicioPorCliente = new frmBuscarServicioPorCliente(cliente);
         if (formBuscarServicioPorCliente.Matriculas != null)
         {
             if (formBuscarServicioPorCliente.ShowDialog() == DialogResult.OK)
             {
                 limpiarComponentes();
                 mat = formBuscarServicioPorCliente.ServMat;
                 txtNombreServicio.Text = mat.servicio.nombre;
                 txtDescripcion.Text    = mat.servicio.descripcion;
                 txtSaldo.Text          = mat.saldo.ToString();
                 txtPrecio.Text         = (mat.servicio.precio * (1 - (mat.descuento.porcentaje / 100))).ToString("0.0");
                 if (mat.descuento.porcentaje != 0)
                 {
                     txtDescuento.Text = mat.descuento.nombre + " - " + mat.descuento.porcentaje.ToString() + "%";
                 }
                 dtpFechaMatricula.Value = mat.fecha;
                 //datagridview
                 //List<Service.cuota> cuotas = Program.dbController.listarCuotasPorMatricula(mat.idMatricula).ToList<Service.cuota>();
                 IEnumerable <Service.cuota> cuotas = Program.dbController.listarCuotasPorMatricula(mat.idMatricula);
                 if (cuotas != null)
                 {
                     dgvHistorico.RowCount = 0;
                     foreach (Service.cuota c in cuotas)
                     {
                         Object[] fila = new Object[3];
                         fila[0] = c.fecha.ToShortDateString();
                         fila[1] = c.monto.ToString("0.0");
                         fila[2] = c.formaPago;
                         dgvHistorico.Rows.Add(fila);
                     }
                 }
             }
         }
     }
     else
     {
         frmMensaje mensaje = new frmMensaje("Seleccione un Cliente", "", "Confirmar");   if (mensaje.ShowDialog() == DialogResult.OK)
         {
         }
         ;
     }
 }
Beispiel #6
0
 public void RegistroCuota(Service.matricula matricula, string abonar)
 {
     using (MailMessage mail = new MailMessage())
     {
         mail.From = new MailAddress(emailFromAddress);
         mail.To.Add(matricula.cliente.email);
         mail.Subject    = "Se ha registrado un nuevo pago";
         mail.Body       = "Estimada/o cliente, <br><br>Se ha registrado un nuevo pago en su curso " + matricula.servicio.nombre;
         mail.Body      += "<br>Monto Registrado: " + abonar + "<br>Nuevo Saldo Adeudado: " + matricula.saldo;
         mail.IsBodyHtml = true;
         using (SmtpClient smtp = new SmtpClient(smtpAddress, portNumber))
         {
             smtp.Credentials = new NetworkCredential(emailFromAddress, password);
             smtp.EnableSsl   = enableSSL;
             smtp.Send(mail);
         }
     }
 }
Beispiel #7
0
 private void btnListarServicios_Click(object sender, EventArgs e)
 {
     if (cliente != null)
     {
         frmBuscarServicioDeudaPorCliente formBuscarServicioPorCliente = new frmBuscarServicioDeudaPorCliente(cliente);
         if (formBuscarServicioPorCliente.ShowDialog() == DialogResult.OK)
         {
             servMat = formBuscarServicioPorCliente.ServMat;
             txtNombreServicio.Text  = servMat.servicio.nombre;
             dtpFechaMatricula.Value = servMat.fecha;
             txtPendiente.Text       = servMat.saldo.ToString();
         }
     }
     else
     {
         frmMensaje mensaje = new frmMensaje("Seleccione un Cliente", "", "");
     }
 }
Beispiel #8
0
 private void btnListarServicios_Click(object sender, EventArgs e)
 {
     if (cliente != null)
     {
         frmBuscarServicioDeudaPorCliente formBuscarServicioPorCliente = new frmBuscarServicioDeudaPorCliente(cliente);
         if (formBuscarServicioPorCliente.Matriculas != null)
         {
             if (formBuscarServicioPorCliente.ShowDialog() == DialogResult.OK)
             {
                 servMat = formBuscarServicioPorCliente.ServMat;
                 txtNombreServicio.Text  = servMat.servicio.nombre;
                 dtpFechaMatricula.Value = servMat.fecha;
                 txtPendiente.Text       = servMat.saldo.ToString("0.0");
             }
         }
     }
     else
     {
         MessageBox.Show("Seleccione un Cliente", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }