示例#1
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         if (Val_NewObject())
         {
             if (PersonaDAL.insertPersona(NewObject, Inicio.CurrentUser))
             {
                 MessageBox.Show("El cliente ha sido registrado exitosamente.", "Registro satisfactorio", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 EditingObject = null;
                 this.Close();
             }
             else
             {
                 MessageBox.Show("Ocurrio un error inesperado al intentar registrar el cliente, por favor cierre el formulario y vuelva a intentarlo. Si el problema persiste contacte con el desarrollador al correo [email protected].", "Registro interrumpido", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     catch (Exception ex)
     {
         string folderName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Errores_" + Assembly.GetExecutingAssembly().GetName().Name + "_V_" + Assembly.GetExecutingAssembly().GetName().Version.ToString();
         string fileName   = "Exeptions_" + Name + ".txt";
         Validation.FormManager frmManager = new Validation.FormManager();
         frmManager.writeException(folderName, fileName, ex, "Ocurrio un error inesperado al intentar registrar el cliente");
         MessageBox.Show("Ocurrio un error inesperado al intentar registrar el cliente, por favor cierre el formulario y vuelva a intentarlo. Si el problema persiste contacte con el desarrollador al correo " + Properties.Settings.Default.developerEmail, "Registro interrumpido", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void btnNuevaPersona_Click(object sender, EventArgs e)
        {
            frmPersona persona = new frmPersona();

            persona.EditingObject = new Persona();
            persona.ShowDialog();
            FillDgv(PersonaDAL.searchPersonaNoParametro(txtBuscar.Text, 60));
        }
示例#3
0
        private void FrmFactura_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IngresoInterno)
                {
                    btnMesualidad.Enabled = false;
                }
                if (EditingObject != null)
                {
                    btnBuscarCliente.Enabled = false;
                    btnMesualidad.Enabled    = false;
                    btnCancelacion.Enabled   = false;
                    btnContado.Enabled       = false;
                    btnGuardar.Text          = "Imprimir";
                    btnRemoveDetalle.Enabled = false;
                    txtNombre.Text           = PersonaDAL.getPersonaById(EditingObject.IdPersona).Nombre;
                    txtTelefono.Text         = "No Disponible";
                    dtpFhRegistro.Value      = Convert.ToDateTime(EditingObject.FhRegistro);
                    lblSucursal.Text         = SucursalDAL.getSucursaloById(EditingObject.IdSucursal).Nombre;
                    lblNFactura.Text         = EditingObject.NFactura;
                    foreach (Detfactura det in EditingObject.DetsFactura)
                    {
                        dgvCursos.Rows.Add(
                            det.Id,
                            det.Producto.Nombre,
                            det.Tipo == "M" ? "Mensualidad" : det.Tipo == "R" ? "Reservación" : "Cancelación",
                            det.Producto.Precio,
                            det.Descuento,
                            det.Total,
                            det.IdProducto);
                    }

                    CalucularTotales();
                }
                else
                {
                    EditingObject             = new Factura();
                    EditingObject.DetsFactura = new List <Detfactura>();
                    dtpFhRegistro.Value       = DateTime.Now;
                    lblSucursal.Text          = Inicio.CurrentSucursal.Nombre;
                    lblNFactura.Text          = "Automático";
                }
            }
            catch (Exception ex)
            {
                string folderName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Errores_" + Assembly.GetExecutingAssembly().GetName().Name + "_V_" + Assembly.GetExecutingAssembly().GetName().Version.ToString();
                string fileName   = "Exeptions_" + Name + ".txt";

                Validation.FormManager frmManager = new Validation.FormManager();
                frmManager.writeException(folderName, fileName, ex, "Ha ocurrido un error al intentar cargar la información de este control");
                MessageBox.Show("Ha ocurrido un error al intentar cargar la información de este control, por favor comuniquese con el desarrollador al correo " + Properties.Settings.Default.developerEmail, "Error fatal", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public List <PersonaVIEW> ListarTodosPersonas()
 {
     try
     {
         PersonaDAL personaDAL = new PersonaDAL();
         return(personaDAL.ListarTodosPersonas());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public PersonaVIEW CargarPersona(int idPersona)
 {
     try
     {
         PersonaDAL personaDAL = new PersonaDAL();
         return(personaDAL.CargarPersona(idPersona));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#6
0
        private void frmConfirmarFactura_Load(object sender, EventArgs e)
        {
            try
            {
                decimal total     = 0;
                decimal descuento = 0;
                decimal subtotal  = 0;
                foreach (Detfactura det in currentFactura.DetsFactura)
                {
                    subtotal += det.Total;
                }
                foreach (Detfactura det in currentFactura.DetsFactura)
                {
                    descuento += det.Descuento;
                }
                total             = subtotal - descuento;
                lblTotal.Text     = Decimal.Round(total, 2).ToString();
                lblDescuento.Text = Decimal.Round(descuento, 2).ToString();
                lblSubtotal.Text  = Decimal.Round(subtotal, 2).ToString();
                if (currentFactura.Id != 0)
                {
                    btnRegistrar.Text      = "Imprimir";
                    txtObservacion.Enabled = false; txtCash.Enabled = false;
                }
                lblfecha.Text   = Convert.ToDateTime(currentFactura.FhRegistro).ToString("dd \"de\" MMMM \"del \" yyyy".ToUpper(), new CultureInfo("ES-es"));
                lblCliente.Text = PersonaDAL.getPersonaById(currentFactura.IdPersona).Nombre;
                if (currentFactura.DetsFactura.Where(a => a.Tipo == "M").FirstOrDefault() != null)
                {
                    lblEstudiante.Text  = MatriculaDAL.getMatriculaById(CuotaDAL.getCuotaById(currentFactura.DetsFactura.Where(a => a.Tipo == "M").FirstOrDefault().Matricdetfac.IdCuota).IdMatricula).Estudiante.Persona.Nombre;
                    lblMensualidad.Text = Convert.ToDateTime(CuotaDAL.getCuotaById(currentFactura.DetsFactura.Where(a => a.Tipo == "M").FirstOrDefault().Matricdetfac.IdCuota).FhRegistro).ToString("MMMM".ToUpper(), new CultureInfo("ES-es"));
                }
                else
                {
                    lbltlEstudiante.Visible  = false;
                    lblTlMensualidad.Visible = false;
                    lblMensualidad.Visible   = false;
                    lblEstudiante.Visible    = false;
                }
            }
            catch (Exception ex)
            {
                string folderName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Errores_" + Assembly.GetExecutingAssembly().GetName().Name + "_V_" + Assembly.GetExecutingAssembly().GetName().Version.ToString();
                string fileName   = "Exeptions_" + Name + ".txt";

                Validation.FormManager frmManager = new Validation.FormManager();
                frmManager.writeException(folderName, fileName, ex, "Ha ocurrido un error al intentar cargar la información de este control");
                MessageBox.Show("Ha ocurrido un error al intentar cargar la información de este control, por favor comuniquese con el desarrollador al correo " + Properties.Settings.Default.developerEmail, "Error fatal", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void txtBuscar_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == Convert.ToChar(Keys.Enter))
     {
         e.Handled = true;
         if (txtBuscar.Text != lastParam)
         {
             FillDgv(PersonaDAL.searchPersonaNoParametro(txtBuscar.Text, 60));
         }
         else
         {
             btnSeleccionar.PerformClick();
         }
     }
 }
示例#8
0
        public JsonResult GetPersonas(FormCollection collection)
        {
            PersonaDAL dal   = new PersonaDAL();
            var        model = dal.GetPersonas();

            if (model != null)
            {
                var result = new { Success = true, Message = "Succes Message", model };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var result = new { Success = false, Message = "Error Message" };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }
        private void frmBuscarPersona_Load(object sender, EventArgs e)
        {
            try
            {
                FillDgv(PersonaDAL.searchPersonaNoParametro(txtBuscar.Text, 60));
            }
            catch (Exception ex)
            {
                string folderName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Errores_" + Assembly.GetExecutingAssembly().GetName().Name + "_V_" + Assembly.GetExecutingAssembly().GetName().Version.ToString();
                string fileName   = "Exeptions_" + Name + ".txt";

                Validation.FormManager frmManager = new Validation.FormManager();
                frmManager.writeException(folderName, fileName, ex, "Ha ocurrido un error al intentar cargar la información de este control");
                MessageBox.Show("Ha ocurrido un error al intentar cargar la información de este control, por favor comuniquese con el desarrollador al correo [email protected]", "Error fatal", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public List <PersonaVIEW> FiltrarPersona(string tipo, string valor)
 {
     try
     {
         if (tipo != "" & valor != "")
         {
             PersonaDAL personaDAL = new PersonaDAL();
             return(personaDAL.FiltrarPersona(tipo, valor));
         }
         else
         {
             return(new List <PersonaVIEW>());
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#11
0
        private void FillDgv(List <Factura> lista)
        {
            dgvIngresos.Rows.Clear();
            numPages = Pages.Count;
            SetCurrentPage();

            foreach (Factura obj in lista)
            {
                string concepto = "";
                foreach (Detfactura det in obj.DetsFactura)
                {
                    concepto += (det.Concepto == "Mensualidad"? "Cuota " + CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Convert.ToDateTime(CuotaDAL.getCuotaById(det.Matricdetfac.IdCuota).FhRegistro).ToString("MMMM")):det.Concepto) + (obj.DetsFactura.Count > 1 ? obj.DetsFactura.Last().Id == det.Id ? "." : ", " : ".");
                }
                decimal total     = 0;
                decimal descuento = 0;
                decimal subtotal  = 0;
                foreach (Detfactura det in obj.DetsFactura)
                {
                    subtotal += det.Total;
                }
                foreach (Detfactura det in obj.DetsFactura)
                {
                    descuento += det.Descuento;
                }
                total = subtotal - descuento;

                dgvIngresos.Rows.Add(obj.Id,
                                     obj.NFactura,
                                     Convert.ToDateTime(obj.FhRegistro).ToString("dd-MM-yyyy"),
                                     PersonaDAL.getPersonaById(obj.IdPersona).Nombre,
                                     concepto,
                                     Decimal.Round(subtotal, 2).ToString(),
                                     Decimal.Round(descuento, 2).ToString(),
                                     "$" + Decimal.Round(total, 2).ToString()
                                     );
            }

            CalcularGanancias(rdbMontYear.Checked ? FacturaDAL.getTotalFacturasByParametro(Convert.ToInt64((cbxYear.SelectedItem as Year).Desde), Convert.ToDateTime("20-" + cbxMonth.SelectedItem.ToString() + "-2010").ToString("MM"), Validation.Validation.Val_Injection(txtBuscar.Text), Inicio.CurrentSucursal.Id, pLimit) : FacturaDAL.getTotalFacturasNoParametro(Validation.Validation.Val_Injection(txtBuscar.Text), Inicio.CurrentSucursal.Id, pLimit),
                              rdbMontYear.Checked ? EgresoDAL.getTotalEgresoByParametro(Convert.ToInt64((cbxYear.SelectedItem as Year).Desde), Convert.ToDateTime("20-" + cbxMonth.SelectedItem.ToString() + "-2010").ToString("MM"), Validation.Validation.Val_Injection(txtBuscar.Text), Inicio.CurrentSucursal.Id, pLimit) : EgresoDAL.getTotalEgresoNoParametro(Validation.Validation.Val_Injection(txtBuscar.Text), Inicio.CurrentSucursal.Id, pLimit));
            lblPages.Text = "Página " + currentPage + " de " + (numPages == 0 ? "1" : numPages.ToString());

            return;
        }
示例#12
0
        private void btnSeleccionar_Click(object sender, EventArgs e)
        {
            try
            {
                if (dgvBuscar.CurrentRow != null)
                {
                    currentObject = PersonaDAL.getPersonaById((Int64)dgvBuscar.CurrentRow.Cells[0].Value);
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                string folderName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Errores_" + Assembly.GetExecutingAssembly().GetName().Name + "_V_" + Assembly.GetExecutingAssembly().GetName().Version.ToString();
                string fileName   = "Exeptions_" + Name + ".txt";

                Validation.FormManager frmManager = new Validation.FormManager();
                frmManager.writeException(folderName, fileName, ex, "Ha ocurrido un error al intentar seleccionar la información de este control");
                MessageBox.Show("Ha ocurrido un error al intentar seleccionar la información de este control, por favor comuniquese con el desarrollador al correo " + Properties.Settings.Default.developerEmail, "Error fatal", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public string CrearPersona(string nombre, string apellido, string rut, DateTime fecha_nac, string direccion, string email, int comuna, string telefono_fijo, string celular, int tipo_persona, int estado_persona)
        {
            try
            {
                PERSONA    persona    = new PERSONA();
                PersonaDAL personaDAL = new PersonaDAL();

                if (nombre != "" & nombre.Trim().Length > 1)
                {
                    if (apellido != "" & apellido.Trim().Length > 1)
                    {
                        if (rut != "" & rut.Trim().Length > 7)
                        {
                            if (RutValido(rut))
                            {
                                if (direccion != "" & direccion.Trim().Length > 4)
                                {
                                    if (email != "" & email.Trim().Length > 4)
                                    {
                                        if (comuna > -1)
                                        {
                                            if (tipo_persona > -1)
                                            {
                                                if (estado_persona > -1)
                                                {
                                                    persona.NOMBRE   = nombre.ToUpper();
                                                    persona.APELLIDO = apellido.ToUpper();
                                                    var    arreglo = rut.Split('-');
                                                    string _rut    = arreglo[0];
                                                    string _dv     = arreglo[1];
                                                    persona.NUM_ID    = int.Parse(_rut);
                                                    persona.DIV_ID    = _dv.ToUpper();
                                                    persona.DIRECCION = direccion.ToUpper();
                                                    int _teleFijo = 0;
                                                    int.TryParse(telefono_fijo, out _teleFijo);
                                                    persona.TELEFONO_FIJO = _teleFijo;
                                                    int _celular = 0;
                                                    int.TryParse(celular, out _celular);
                                                    persona.TELEFONO_CELULAR    = _celular;
                                                    persona.COMUNA_ID           = comuna;
                                                    persona.TIPO_PERSONA_ID     = tipo_persona;
                                                    persona.ESTADO_PERSONA_ID   = estado_persona;
                                                    persona.FECHA_NACIMIENTO    = fecha_nac;
                                                    persona.FECHA_CREACION      = DateTime.Now;
                                                    persona.FECHA_ULTIMO_UPDATE = DateTime.Now;
                                                    persona.CORREO = email;
                                                    return(personaDAL.CrearPersona(persona));
                                                }
                                                else
                                                {
                                                    return("Debe indicar un estado de persona");
                                                }
                                            }
                                            else
                                            {
                                                return("Debe indicar un tipo de persona");
                                            }
                                        }
                                        else
                                        {
                                            return("Debe indicar una comuna");
                                        }
                                    }
                                    else
                                    {
                                        return("Debe indicar correo electrónico del cliente");
                                    }
                                }
                                else
                                {
                                    return("La dirección debe tener al menos 5 caracteres");
                                }
                            }
                            else
                            {
                                return("El rut ingresado no es válido. Debe ingresar el rut sin puntos (9999999-9)");
                            }
                        }
                        else
                        {
                            return("Debe ingresar el rut sin puntos (9999999-9)");
                        }
                    }
                    else
                    {
                        return("El apellido debe tener al menos 2 caracteres");
                    }
                }
                else
                {
                    return("El nombre debe tener al menos 2 caracteres");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#14
0
 public static int Eliminar(Persona pPersona)
 {
     return(PersonaDAL.Eliminar(pPersona));
 }
示例#15
0
 public static int Guardar(Persona pPersona)
 {
     return(PersonaDAL.Guardar(pPersona));
 }
示例#16
0
 public PersonasLogic()
 {
     objPersonaDAL = new PersonaDAL();
 }
示例#17
0
        private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
        {
            try
            {
                StringFormat formato = new StringFormat();
                formato.Alignment     = StringAlignment.Near;
                formato.LineAlignment = StringAlignment.Near;

                e.Graphics.PageUnit    = GraphicsUnit.Millimeter;
                e.PageSettings.Margins = new Margins(0, 0, 0, 0);

                Pen  blackPen   = new Pen(Color.Black, (float)0.2);
                Font fontNormal = new Font("Arial", 9, FontStyle.Regular);
                Font fontSmall  = new Font("Arial", 8, FontStyle.Regular);

                Font fontBold = new Font("Arial", 9, FontStyle.Bold);

                Brush brocha = Brushes.Black;

                Point point1 = new Point(5, 5);
                Point point2 = new Point(205, 5);
                //  e.Graphics.DrawLine(blackPen, point1, point2);

                point1 = new Point(5, 5);
                point2 = new Point(5, 274);
                // e.Graphics.DrawLine(blackPen, point1, point2);

                point1 = new Point(5, 274);
                point2 = new Point(205, 274);
                //  e.Graphics.DrawLine(blackPen, point1, point2);

                point1 = new Point(205, 274);
                point2 = new Point(205, 5);
                // e.Graphics.DrawLine(blackPen, point1, point2);

                ////////////////////////////////////////////////////////////////
                ////                  row1 pictures, Tel, NFact               //
                ////////////////////////////////////////////////////////////////

                int row1PosY = 12, row1Cell0PosX = 10, row1Cell1PosX = 79, row1Cell2PosX = 167;
                e.Graphics.DrawImage(GOLLSYSTEM.Properties.Resources.Goll_Logo_Black, row1Cell0PosX, row1PosY, 60, 24);
                e.Graphics.DrawImage(GOLLSYSTEM.Properties.Resources.Logo_goll_center, row1Cell1PosX, row1PosY, 60, 18);
                e.Graphics.DrawString("TEL.: " + GOLLSYSTEM.Properties.Settings.Default.Tel, fontSmall, brocha, row1Cell1PosX + 18, row1PosY + 15);
                e.Graphics.DrawImage(GOLLSYSTEM.Properties.Resources.box_bill, row1Cell2PosX, row1PosY - 5, 38, 16);

                //   e.Graphics.DrawRectangle(new Pen(Brushes.Black, 1f), Rectangle.FromLTRB(row1Cell2PosX, row1PosY, 205, 25));
                e.Graphics.DrawString(currentFactura.NFactura, fontBold, brocha, row1Cell2PosX + 10, row1PosY + 1);

                ////////////////////////////////////////////////////////////////
                ////                  row2 total                              //
                ////////////////////////////////////////////////////////////////

                int row2PosY = 36, row2Cell0PosX = 8, row2Cell1PosX = 147;
                e.Graphics.DrawString("RECIBO DE INGRESO", fontNormal, brocha, row2Cell0PosX, row2PosY);
                decimal total = 0;
                foreach (Detfactura det in currentFactura.DetsFactura)
                {
                    total += det.Total - det.Descuento;
                }
                e.Graphics.DrawString("POR$ " + Decimal.Round(total, 2), fontNormal, brocha, row2Cell1PosX, row2PosY);
                point1 = new Point(row2Cell1PosX + 10, row2PosY + 4);
                point2 = new Point(190, row2PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                ////////////////////////////////////////////////////////////////
                ////                  row3 cliente                              //
                ////////////////////////////////////////////////////////////////

                int row3PosY = 48, row3Cell0PosX = 10;
                e.Graphics.DrawString("RECIBI DEL SR(ES):  " + PersonaDAL.getPersonaById(currentFactura.IdPersona).Nombre.ToUpper(), fontNormal, brocha, row3Cell0PosX, row3PosY);
                point1 = new Point(row3Cell0PosX + 32, row3PosY + 4);
                point2 = new Point(190, row3PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                ////////////////////////////////////////////////////////////////
                ////                  row4 datos del cliente                  //
                ////////////////////////////////////////////////////////////////

                int row4PosY = 56, row4Cell0PosX = 10, row4Cell1PosX = 64, row4Cell2PosX = 121;
                e.Graphics.DrawString("TEL.:", fontNormal, brocha, row4Cell0PosX, row4PosY);

                point1 = new Point(row4Cell0PosX + 9, row4PosY + 4);
                point2 = new Point(60, row4PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                e.Graphics.DrawString("CEL.:", fontNormal, brocha, row4Cell1PosX, row4PosY);
                point1 = new Point(row4Cell1PosX + 10, row4PosY + 4);
                point2 = new Point(118, row4PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                e.Graphics.DrawString("E-MAIL.:", fontNormal, brocha, row4Cell2PosX, row4PosY);
                point1 = new Point(row4Cell2PosX + 14, row4PosY + 4);
                point2 = new Point(190, row4PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                ////////////////////////////////////////////////////////////////
                ////                  row5 cantidad de                        //
                ////////////////////////////////////////////////////////////////

                int    row5PosY = 64, row5Cell0PosX = 10;
                Moneda moneda   = new Moneda();
                string Dolares  = Decimal.Round(total, 2).ToString().Substring(0, Decimal.Round(total, 2).ToString().Length - 3);
                string Centavos = Decimal.Round(total, 2).ToString().Substring(Decimal.Round(total, 2).ToString().Length - 2, 2);

                e.Graphics.DrawString("LA CANTIDAD DE:    " + moneda.Convertir(Dolares, true, "DOLARES").Substring(0, moneda.Convertir(Dolares, true, "DOLARES").Length - 6) + (Centavos == "00" ? "" : " CON " + moneda.Convertir(Centavos, true, "CENTAVOS").Substring(0, moneda.Convertir(Centavos, true, "CENTAVOS").Length - 6)), fontNormal, brocha, row5Cell0PosX, row5PosY);
                point1 = new Point(row5Cell0PosX + 32, row5PosY + 4);
                point2 = new Point(190, row5PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                ////////////////////////////////////////////////////////////////
                ////                  row6 concepto de                        //
                ////////////////////////////////////////////////////////////////

                int    row6PosY = 72, row6Cell0PosX = 10;
                string concepto = "";
                foreach (Detfactura det in currentFactura.DetsFactura)
                {
                    concepto = concepto + (det.Producto.Nombre + (det.Tipo == "M" ? " \"" + Convert.ToDateTime(CuotaDAL.getCuotaById(det.Matricdetfac.IdCuota).FhRegistro).ToString("MMMM", new CultureInfo("es-ES")) + "\"" : "") + (currentFactura.DetsFactura.Count > 1 ? currentFactura.DetsFactura.Last().Id == det.Id ? "." : ", " : ".") + "");
                }

                e.Graphics.DrawString("EN CONCEPTO DE:  " + concepto.ToUpper(), fontNormal, brocha, row6Cell0PosX, row6PosY);
                point1 = new Point(row6Cell0PosX + 32, row6PosY + 4);
                point2 = new Point(190, row6PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                ////////////////////////////////////////////////////////////////
                ////                  row7 total                              //
                ////////////////////////////////////////////////////////////////

                int row7PosY = 80, row7Cell0PosX = 10, row7Cell1PosX = 64, row7Cell2PosX = 121;

                e.Graphics.DrawString("RESERVACION", fontNormal, brocha, row7Cell0PosX, row7PosY);
                e.Graphics.DrawRectangle(new Pen(Brushes.Black, 0.5f), Rectangle.FromLTRB(row7Cell0PosX + 30, row7PosY, row7Cell0PosX + 40, row7PosY + 5));
                foreach (Detfactura det in currentFactura.DetsFactura)
                {
                    if (det.Tipo == "R")
                    {
                        e.Graphics.DrawImage(GOLLSYSTEM.Properties.Resources.marca_de_verificacion, row7Cell0PosX + 33, row7PosY, 5, 5);
                    }
                }


                e.Graphics.DrawString("MENSUALIDAD", fontNormal, brocha, row7Cell1PosX, row7PosY);
                e.Graphics.DrawRectangle(new Pen(Brushes.Black, 0.5f), Rectangle.FromLTRB(row7Cell1PosX + 30, row7PosY, row7Cell1PosX + 40, row7PosY + 5));
                foreach (Detfactura det in currentFactura.DetsFactura)
                {
                    if (det.Tipo == "M")
                    {
                        e.Graphics.DrawImage(GOLLSYSTEM.Properties.Resources.marca_de_verificacion, row7Cell1PosX + 33, row7PosY, 5, 5);
                    }
                }


                e.Graphics.DrawString("CANCELACION", fontNormal, brocha, row7Cell2PosX, row7PosY);
                e.Graphics.DrawRectangle(new Pen(Brushes.Black, 0.5f), Rectangle.FromLTRB(row7Cell2PosX + 30, row7PosY, row7Cell2PosX + 40, row7PosY + 5));
                foreach (Detfactura det in currentFactura.DetsFactura)
                {
                    if (det.Tipo == "C" || det.Tipo == "F")
                    {
                        e.Graphics.DrawImage(GOLLSYSTEM.Properties.Resources.marca_de_verificacion, row7Cell2PosX + 33, row7PosY, 5, 5);
                    }
                }


                ////////////////////////////////////////////////////////////////
                ////                  row8 Observacion                        //
                ////////////////////////////////////////////////////////////////

                int    row8PosY = 89, row8Cell0PosX = 10;
                string Obs1   = "";
                string Obs2   = "";
                string Obs3   = "";
                char[] letras = currentFactura.Observacion.ToArray();
                foreach (char letra in letras)
                {
                    if (Obs1.Length < 81)
                    {
                        Obs1 += letra;
                    }
                    else
                    if (Obs2.Length < 91)
                    {
                        Obs2 += letra;
                    }
                    else
                    if (Obs3.Length < 91)
                    {
                        Obs3 += letra;
                    }
                }
                e.Graphics.DrawString("OBSERVACION ", fontNormal, brocha, row8Cell0PosX, row8PosY);
                point1 = new Point(row8Cell0PosX + 28, row8PosY + 4);
                point2 = new Point(190, row8PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);
                e.Graphics.DrawString(Obs1.ToUpper(), fontSmall, brocha, row8Cell0PosX + 28, row8PosY);

                point1 = new Point(row8Cell0PosX, row8PosY + 4 + 7);
                point2 = new Point(190, row8PosY + 4 + 7);
                e.Graphics.DrawLine(blackPen, point1, point2);
                e.Graphics.DrawString(Obs2.ToUpper(), fontSmall, brocha, row8Cell0PosX, row8PosY + 7);

                point1 = new Point(row8Cell0PosX, row8PosY + 4 + 7 + 7);
                point2 = new Point(190, row8PosY + 4 + 7 + 7);
                e.Graphics.DrawLine(blackPen, point1, point2);
                e.Graphics.DrawString(Obs3.ToUpper(), fontSmall, brocha, row8Cell0PosX, row8PosY + 7 + 7);

                ////////////////////////////////////////////////////////////////
                ////                  row9 mora                               //
                ////////////////////////////////////////////////////////////////

                int row9PosY = 110, row9Cell0PosX = 57;

                e.Graphics.DrawString("NOTA: DESPUES DE " + Properties.Settings.Default.DaysMora + " DIAS SE COBRARA $" + Properties.Settings.Default.Mora + " POR MORA", fontNormal, brocha, row9Cell0PosX, row9PosY);

                ////////////////////////////////////////////////////////////////
                ////                  row10 recibo, fwcha                     //
                ////////////////////////////////////////////////////////////////

                int row10PosY = 128, row10Cell0PosX = 14, row10Cell1PosX = 149;

                point1 = new Point(row10Cell0PosX, row10PosY);
                point2 = new Point(54, row10PosY);
                e.Graphics.DrawLine(blackPen, point1, point2);

                e.Graphics.DrawString("RECIBO", fontNormal, brocha, row10Cell0PosX + 13, row10PosY + 1);

                point1 = new Point(row10Cell1PosX, row10PosY);
                point2 = new Point(190, row10PosY);
                e.Graphics.DrawLine(blackPen, point1, point2);

                e.Graphics.DrawString(YearDAL.getServerDate().ToString("dd/MM/yyyy"), fontBold, brocha, row10Cell1PosX + 11, row10PosY - 4);
                e.Graphics.DrawString("FECHA", fontNormal, brocha, row10Cell1PosX + 14, row10PosY + 1);

                ////////////////////////////////////////////////////////////////
                ////                  Duplicado                               //
                ////////////////////////////////////////////////////////////////
                point1 = new Point(5, 137);
                point2 = new Point(205, 137);
                e.Graphics.DrawLine(blackPen, point1, point2);
                int duplicatedTop = 137;
                ////////////////////////////////////////////////////////////////
                ////                  row1 pictures, Tel, NFact               //
                ////////////////////////////////////////////////////////////////

                row1PosY = 12 + duplicatedTop;
                e.Graphics.DrawImage(GOLLSYSTEM.Properties.Resources.Goll_Logo_Black, row1Cell0PosX, row1PosY, 60, 24);
                e.Graphics.DrawImage(GOLLSYSTEM.Properties.Resources.Logo_goll_center, row1Cell1PosX, row1PosY, 60, 18);
                e.Graphics.DrawString("TEL.: " + GOLLSYSTEM.Properties.Settings.Default.Tel, fontNormal, brocha, row1Cell1PosX + 18, row1PosY + 15);
                e.Graphics.DrawImage(GOLLSYSTEM.Properties.Resources.box_bill, row1Cell2PosX, row1PosY - 5, 38, 16);

                //   e.Graphics.DrawRectangle(new Pen(Brushes.Black, 1f), Rectangle.FromLTRB(row1Cell2PosX, row1PosY, 205, 25));
                e.Graphics.DrawString(currentFactura.NFactura, fontBold, brocha, row1Cell2PosX + 10, row1PosY + 1);

                ////////////////////////////////////////////////////////////////
                ////                  row2 total                              //
                ////////////////////////////////////////////////////////////////

                row2PosY = 36 + duplicatedTop;
                e.Graphics.DrawString("RECIBO DE INGRESO", fontNormal, brocha, row2Cell0PosX, row2PosY);
                e.Graphics.DrawString("POR$ " + Decimal.Round(total, 2), fontNormal, brocha, row2Cell1PosX, row2PosY);
                point1 = new Point(row2Cell1PosX + 10, row2PosY + 4);
                point2 = new Point(190, row2PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                ////////////////////////////////////////////////////////////////
                ////                  row3 cliente                              //
                ////////////////////////////////////////////////////////////////

                row3PosY = 48 + duplicatedTop;
                e.Graphics.DrawString("RECIBI DEL SR(ES):  " + PersonaDAL.getPersonaById(currentFactura.IdPersona).Nombre.ToUpper(), fontNormal, brocha, row3Cell0PosX, row3PosY);
                point1 = new Point(row3Cell0PosX + 32, row3PosY + 4);
                point2 = new Point(190, row3PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                ////////////////////////////////////////////////////////////////
                ////                  row4 datos del cliente                  //
                ////////////////////////////////////////////////////////////////

                row4PosY = 56 + duplicatedTop;
                e.Graphics.DrawString("TEL.:", fontNormal, brocha, row4Cell0PosX, row4PosY);

                point1 = new Point(row4Cell0PosX + 9, row4PosY + 4);
                point2 = new Point(60, row4PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                e.Graphics.DrawString("CEL.:", fontNormal, brocha, row4Cell1PosX, row4PosY);
                point1 = new Point(row4Cell1PosX + 10, row4PosY + 4);
                point2 = new Point(118, row4PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                e.Graphics.DrawString("E-MAIL.:", fontNormal, brocha, row4Cell2PosX, row4PosY);
                point1 = new Point(row4Cell2PosX + 14, row4PosY + 4);
                point2 = new Point(190, row4PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                ////////////////////////////////////////////////////////////////
                ////                  row5 cantidad de                        //
                ////////////////////////////////////////////////////////////////

                row5PosY = 64 + duplicatedTop;
                e.Graphics.DrawString("LA CANTIDAD DE:    " + moneda.Convertir(Dolares, true, "DOLARES").Substring(0, moneda.Convertir(Dolares, true, "DOLARES").Length - 6) + (Centavos == "00" ? "" : " CON " + moneda.Convertir(Centavos, true, "CENTAVOS").Substring(0, moneda.Convertir(Centavos, true, "CENTAVOS").Length - 6)), fontNormal, brocha, row5Cell0PosX, row5PosY);
                point1 = new Point(row5Cell0PosX + 32, row5PosY + 4);
                point2 = new Point(190, row5PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                ////////////////////////////////////////////////////////////////
                ////                  row6 concepto de                        //
                ////////////////////////////////////////////////////////////////

                row6PosY = 72 + duplicatedTop;
                e.Graphics.DrawString("EN CONCEPTO DE:  " + concepto.ToUpper(), fontNormal, brocha, row6Cell0PosX, row6PosY);
                point1 = new Point(row6Cell0PosX + 32, row6PosY + 4);
                point2 = new Point(190, row6PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);

                ////////////////////////////////////////////////////////////////
                ////                  row7 total                              //
                ////////////////////////////////////////////////////////////////

                row7PosY = 80 + duplicatedTop;

                e.Graphics.DrawString("RESERVACION", fontNormal, brocha, row7Cell0PosX, row7PosY);
                e.Graphics.DrawRectangle(new Pen(Brushes.Black, 0.5f), Rectangle.FromLTRB(row7Cell0PosX + 30, row7PosY, row7Cell0PosX + 40, row7PosY + 5));
                foreach (Detfactura det in currentFactura.DetsFactura)
                {
                    if (det.Tipo == "R")
                    {
                        e.Graphics.DrawImage(GOLLSYSTEM.Properties.Resources.marca_de_verificacion, row7Cell0PosX + 33, row7PosY, 5, 5);
                    }
                }


                e.Graphics.DrawString("MENSUALIDAD", fontNormal, brocha, row7Cell1PosX, row7PosY);
                e.Graphics.DrawRectangle(new Pen(Brushes.Black, 0.5f), Rectangle.FromLTRB(row7Cell1PosX + 30, row7PosY, row7Cell1PosX + 40, row7PosY + 5));
                foreach (Detfactura det in currentFactura.DetsFactura)
                {
                    if (det.Tipo == "M")
                    {
                        e.Graphics.DrawImage(GOLLSYSTEM.Properties.Resources.marca_de_verificacion, row7Cell1PosX + 33, row7PosY, 5, 5);
                    }
                }


                e.Graphics.DrawString("CANCELACION", fontNormal, brocha, row7Cell2PosX, row7PosY);
                e.Graphics.DrawRectangle(new Pen(Brushes.Black, 0.5f), Rectangle.FromLTRB(row7Cell2PosX + 30, row7PosY, row7Cell2PosX + 40, row7PosY + 5));
                foreach (Detfactura det in currentFactura.DetsFactura)
                {
                    if (det.Tipo == "C" || det.Tipo == "F")
                    {
                        e.Graphics.DrawImage(GOLLSYSTEM.Properties.Resources.marca_de_verificacion, row7Cell2PosX + 33, row7PosY, 5, 5);
                    }
                }


                ////////////////////////////////////////////////////////////////
                ////                  row8 Observacion                        //
                ////////////////////////////////////////////////////////////////

                row8PosY = 89 + duplicatedTop;

                e.Graphics.DrawString("OBSERVACION ", fontNormal, brocha, row8Cell0PosX, row8PosY);
                point1 = new Point(row8Cell0PosX + 28, row8PosY + 4);
                point2 = new Point(190, row8PosY + 4);
                e.Graphics.DrawLine(blackPen, point1, point2);
                e.Graphics.DrawString(Obs1.ToUpper(), fontSmall, brocha, row8Cell0PosX + 28, row8PosY);

                point1 = new Point(row8Cell0PosX, row8PosY + 4 + 7);
                point2 = new Point(190, row8PosY + 4 + 7);
                e.Graphics.DrawLine(blackPen, point1, point2);
                e.Graphics.DrawString(Obs2.ToUpper(), fontSmall, brocha, row8Cell0PosX, row8PosY + 7);

                point1 = new Point(row8Cell0PosX, row8PosY + 4 + 7 + 7);
                point2 = new Point(190, row8PosY + 4 + 7 + 7);
                e.Graphics.DrawLine(blackPen, point1, point2);
                e.Graphics.DrawString(Obs3.ToUpper(), fontSmall, brocha, row8Cell0PosX, row8PosY + 7 + 7);

                ////////////////////////////////////////////////////////////////
                ////                  row9 mora                               //
                ////////////////////////////////////////////////////////////////

                row9PosY = 110 + duplicatedTop;

                e.Graphics.DrawString("NOTA: DESPUES DE " + Properties.Settings.Default.DaysMora + " DIAS SE COBRARA $" + Properties.Settings.Default.Mora + " POR MORA", fontNormal, brocha, row9Cell0PosX, row9PosY);

                ////////////////////////////////////////////////////////////////
                ////                  row10 recibo, fwcha                     //
                ////////////////////////////////////////////////////////////////

                row10PosY = 128 + duplicatedTop;

                point1 = new Point(row10Cell0PosX, row10PosY);
                point2 = new Point(54, row10PosY);
                e.Graphics.DrawLine(blackPen, point1, point2);

                e.Graphics.DrawString("RECIBO", fontNormal, brocha, row10Cell0PosX + 13, row10PosY + 1);

                point1 = new Point(row10Cell1PosX, row10PosY);
                point2 = new Point(190, row10PosY);
                e.Graphics.DrawLine(blackPen, point1, point2);

                e.Graphics.DrawString(YearDAL.getServerDate().ToString("dd/MM/yyyy"), fontBold, brocha, row10Cell1PosX + 11, row10PosY - 4);
                e.Graphics.DrawString("FECHA", fontNormal, brocha, row10Cell1PosX + 14, row10PosY + 1);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString());
            }
        }
示例#18
0
 public PersonaBLL()
 {
     PersonaDAL = new PersonaDAL(ref bdConn);
 }
示例#19
0
 public static Persona BuscarPorId(byte pId)
 {
     return(PersonaDAL.BuscarPorId(pId));
 }
示例#20
0
 public Persona Obtener(int pId)
 {
     return PersonaDAL.Obtener(pId);
 }
示例#21
0
 private void icUpdate_Click(object sender, EventArgs e)
 {
     FillDgv(PersonaDAL.searchPersonaNoParametro(Validation.Validation.Val_Injection(txtBuscar.Text), 60));
 }
示例#22
0
 public static int Modificar(Persona pPersona)
 {
     return(PersonaDAL.Modificar(pPersona));
 }
示例#23
0
 public List<Persona> Listar()
 {
     return PersonaDAL.Listar();
 }
示例#24
0
 public static List <Persona> ObtenerTodos()
 {
     return(PersonaDAL.ObtenerTodos());
 }
示例#25
0
 public int Guardar(Persona pPersona)
 {
     return PersonaDAL.Guardar(pPersona);
 }
示例#26
0
 public int Eliminar(Persona pPersona)
 {
     return PersonaDAL.Eliminar(pPersona);
 }
示例#27
0
        public PersonaVM consultaPersonaSITU(string nroDocumento)
        {
            //consultarPersonaEnSITUS
            var persona = new PersonaDAL(ref bdConn).consultarPersonaEnSITUS(nroDocumento);

            if (persona.NRO_DOCUMENTO != null)
            {
                string texto   = nroDocumento.ToString();
                int[]  digitos = new int[texto.Length];
                for (int i = 0; i < texto.Length; i++)
                {
                    digitos[i] = int.Parse(texto.Substring(i, 1));
                }
                var digiti1 = digitos[0] * 3;
                var digiti2 = digitos[1] * 2;
                var digiti3 = digitos[2] * 7;
                var digiti4 = digitos[3] * 6;
                var digiti5 = digitos[4] * 5;
                var digiti6 = digitos[5] * 4;
                var digiti7 = digitos[6] * 3;
                var digiti8 = digitos[7] * 2;

                var sumar  = digiti1 + digiti2 + digiti3 + digiti4 + digiti5 + digiti6 + digiti7 + digiti8;
                var div    = Math.Truncate(Convert.ToDecimal(sumar / 11));
                var multi  = div * 11;
                var resta  = sumar - multi;
                var resta2 = 11 - resta;
                var sumar2 = Convert.ToInt32(resta2 + 1);

                switch (sumar2)
                {
                case 1:
                    persona.ULTIMO_DIGITO = 6;

                    break;

                case 2:
                    persona.ULTIMO_DIGITO = 7;

                    break;

                case 3:
                    persona.ULTIMO_DIGITO = 8;

                    break;

                case 4:
                    persona.ULTIMO_DIGITO = 9;

                    break;

                case 5:
                    persona.ULTIMO_DIGITO = 0;

                    break;

                case 6:
                    persona.ULTIMO_DIGITO = 1;

                    break;

                case 7:
                    persona.ULTIMO_DIGITO = 1;

                    break;

                case 8:
                    persona.ULTIMO_DIGITO = 2;
                    break;

                case 9:
                    persona.ULTIMO_DIGITO = 3;
                    break;

                case 10:
                    persona.ULTIMO_DIGITO = 4;
                    break;

                case 11:
                    persona.ULTIMO_DIGITO = 5;
                    break;

                default:
                    persona.ULTIMO_DIGITO = 0;
                    break;
                }
            }
            return(persona);
        }