Example #1
0
        public frmAgregarUsuario(string idEditando)
        {
            InitializeComponent();

            this._ID_EDITANDO         = idEditando;
            _EDITANDO                 = true;
            txtIdentificador.ReadOnly = true;

            var ps = new CTRL.Persistencia();

            ps.AbrirConexion();

            var reg = ps.SelPorLlave <USUARIO>(idEditando);

            this.Text = this.lblProd.Text = "Editando Usuario";

            txtNombres.Text       = reg.NOMBRES;
            txtApellidos.Text     = reg.APELLIDOS;
            txtTelefono.Text      = reg.TELEFONO;
            txtCorreo.Text        = reg.CORREO;
            txtIdentificador.Text = reg.ID_USUARIO;
            cbTipo.SelectedIndex  = cbTipo.Items.IndexOf(reg.TIPO);
            txtContra.Text        = "(Sin Cambios)";
            ps.CerrarConexion();
            cbTipo.SelectedIndex = 0;
        }
Example #2
0
        public frmAgregarTalonario(long ID)
        {
            InitializeComponent();

            this.dOCTORESTableAdapter.Fill(this.dsSysLab.DOCTORES);

            this._ID_EDITAR = ID;
            this._EDITANDO  = true;

            var ps = new CTRL.Persistencia();

            ps.AbrirConexion();

            var reg = ps.SelPorLlave <TALONARIO>(ID.ToString());

            this.Text = this.lblTitulo.Text = "Editando Entrega de Talonario";

            nudCantidad.Value = (decimal)reg.CANTIDAD;
            dtpFecha.Value    = reg.FECHA ?? dtpFecha.Value;

            if (_EDITANDO)
            {
                this.cbDoctor.SelectedValue = reg.ID_DOCTOR;
            }

            ps.CerrarConexion();
        }
Example #3
0
        public frmAgregarPaciente(long ID, bool Visor = false)
        {
            InitializeComponent();

            this._ID_EDITAR = ID;
            this._EDITANDO  = true;

            var ps = new CTRL.Persistencia();

            ps.AbrirConexion();

            var reg = ps.SelPorLlave <PACIENTE>(ID.ToString());

            this.Text = this.lblProd.Text = "Editando paciente";

            txtNombres.Text      = reg.NOMBRES;
            txtTelefono.Text     = reg.TELEFONO;
            dtpFecha.Value       = reg.FECHA_NAC.Value;
            txtGiro.Text         = reg.GIRO;
            txtDireccion.Text    = reg.DIRECCION;
            txtMunicipio.Text    = reg.MUNICIPIO;
            txtDepartamento.Text = reg.DEPARTAMENTO;
            txtNIT.Text          = reg.NIT;
            txtCorreo.Text       = reg.CORREO;

            ckCredito.Checked           = reg.CREDITO;
            ckCFiscal.Checked           = reg.CREDITO_FISCAL;
            ckExento.Checked            = reg.EXENTO;
            ckTasaCero.Checked          = reg.TASA_CERO;
            ckGranContribuyente.Checked = reg.GRAN_CONTRIBUYENTE;
            nudDiasCredito.Value        = reg.CREDITO_DIAS;
            nudPrecioSel.Value          = reg.PRECIO_SEL;

            if (Visor)
            {
                this.ControlBox = true;
                this.Text       = this.lblProd.Text = "Visualizando cliente";

                txtNombres.ReadOnly        = txtTelefono.ReadOnly = txtGiro.ReadOnly = txtDireccion.ReadOnly =
                    txtMunicipio.ReadOnly  = txtDepartamento.ReadOnly = txtNIT.ReadOnly = txtNRC.ReadOnly =
                        txtCorreo.ReadOnly = true;

                nudPrecioSel.Enabled       = dtpFecha.Enabled = ckCredito.Enabled = ckExento.Enabled = ckGranContribuyente.Enabled = ckTasaCero.Enabled =
                    nudDiasCredito.Enabled = cmdGuardar.Visible = cmdCancelar.Visible = false;
            }

            ps.CerrarConexion();
        }
Example #4
0
        public frmResultadoAnalisis(long ID_SOLICITUD, long ID_ANALISIS, bool visor)
        {
            InitializeComponent();

            this.ID_SOL      = ID_SOLICITUD;
            this.ID_ANALISIS = ID_ANALISIS;

            var ps = new CTRL.Persistencia();

            ps.AbrirConexion();

            var reg = ps.SelPorLlave <ANALISI>(ID_ANALISIS.ToString());

            txtNombre.Text        = reg.NOMBRE;
            txtDesc.Text          = reg.DESCRIPCION;
            txtObservaciones.Text = ps.DB.SOLICITUD_RESULTADOs.Where(c => c.ID_ANALISIS == ID_ANALISIS && c.ID_SOLICITUD == ID_SOLICITUD)
                                    .Select(c => c.OBSERVACIONES).SingleOrDefault();

            foreach (ANALISIS_DATO item in reg.ANALISIS_DATOs)
            {
                var fila = dgCampos.Rows[
                    dgCampos.Rows.Add(new object[] { item.CAMPO, item.UMEDIDA, item.REF, item.RMIN, item.RMAX,
                                                     item.SOLICITUD_RESULTADO_DETALLEs.Where(
                                                         c => c.SOLICITUD_RESULTADO.ID_SOLICITUD == ID_SOLICITUD &&
                                                         c.SOLICITUD_RESULTADO.ID_ANALISIS == ID_ANALISIS).Select(c => c.VALOR).SingleOrDefault(),
                                                     item.SOLICITUD_RESULTADO_DETALLEs.Where(
                                                         c => c.SOLICITUD_RESULTADO.ID_SOLICITUD == ID_SOLICITUD &&
                                                         c.SOLICITUD_RESULTADO.ID_ANALISIS == ID_ANALISIS).Select(c => c.COMENTARIOS).SingleOrDefault(), })
                           ];
                fila.Tag = item.ID_ANALISIS_DATO;
            }

            ps.CerrarConexion();

            if (visor)
            {
                dgCampos.ReadOnly      = true;
                colValor.ReadOnly      = true;
                colComentario.ReadOnly = true;

                txtObservaciones.ReadOnly = true;

                this.Text = lblTitulo.Text = "Visualizando resultado de análisis clínico";
                this.cmdCancelar.Visible = this.cmdGuardar.Visible = false;

                this.ControlBox = true;
            }
        }
Example #5
0
        public frmAgregarEmpresa(long ID_EMPRESA, bool Visor = false)
        {
            InitializeComponent();

            this._ID_EDITAR = ID_EMPRESA;
            this._EDITANDO  = true;

            var ps = new CTRL.Persistencia();

            ps.AbrirConexion();

            var reg = ps.SelPorLlave <EMPRESA>(ID_EMPRESA.ToString());

            this.Text = this.lblTitulo.Text = "Editando empresa";

            txtNombres.Text             = reg.NOMBRE;
            txtGiro.Text                = reg.GIRO;
            txtDireccion.Text           = reg.DIRECCION;
            txtMunicipio.Text           = reg.MUNICIPIO;
            txtDepartamento.Text        = reg.DEPARTAMENTO;
            txtNIT.Text                 = reg.NIT;
            txtNRC.Text                 = reg.NRC;
            txtCorreo.Text              = reg.CORREO;
            ckCredito.Checked           = reg.CREDITO;
            ckGranContribuyente.Checked = reg.GRAN_CONTRIBUYENTE;
            nudDiasCredito.Value        = reg.CREDITO_DIAS;

            txtContactoNombre.Text   = reg.CONTACTO_NOMBRE;
            txtContactoTelefono.Text = reg.CONTACTO_TELEFONO;
            txtContactoNIT.Text      = reg.CONTACTO_NIT;
            txtContactoCorreo.Text   = reg.CONTACTO_CORREO;

            if (Visor)
            {
                this.ControlBox = true;
                this.Text       = this.lblTitulo.Text = "Visualizando empresa";

                txtNombres.ReadOnly        = txtGiro.ReadOnly = txtDireccion.ReadOnly =
                    txtMunicipio.ReadOnly  = txtDepartamento.ReadOnly = txtNIT.ReadOnly = txtNRC.ReadOnly =
                        txtCorreo.ReadOnly = txtContactoCorreo.ReadOnly = txtContactoNIT.ReadOnly = txtContactoNombre.ReadOnly =
                            txtContactoTelefono.ReadOnly = true;

                ckCredito.Enabled          = ckGranContribuyente.Enabled =
                    nudDiasCredito.Enabled = cmdGuardar.Visible = cmdCancelar.Visible = false;
            }

            ps.CerrarConexion();
        }
Example #6
0
        public frmAgregarAnalisis(long ID)
        {
            InitializeComponent();

            this.fAMILIATableAdapter.Fill(this.dsSysLab.FAMILIA);
            this.cATEGORIATableAdapter.Fill(this.dsSysLab.CATEGORIA);

            this._ID_EDITAR = ID;
            this._EDITANDO  = true;

            var ps = new CTRL.Persistencia();

            ps.AbrirConexion();

            var reg = ps.SelPorLlave <ANALISI>(ID.ToString());

            this.Text = this.lblTitulo.Text = "Editando Tipo de Análisis";

            cmbCateg.SelectedValue = reg.FAMILIA.ID_CATEGORIA;
            cmbFam.SelectedValue   = reg.ID_FAMILIA;

            txtNombre.Text = reg.NOMBRE;
            txtDesc.Text   = reg.DESCRIPCION;

            nudP1.Value = reg.PRECIO1;
            nudP2.Value = reg.PRECIO2;
            nudP3.Value = reg.PRECIO3;

            foreach (ANALISIS_DATO item in reg.ANALISIS_DATOs)
            {
                var fila = dgCampos.Rows[
                    dgCampos.Rows.Add(new object[] { item.CAMPO, null, item.UMEDIDA, item.REF, item.RMIN, item.RMAX })
                           ];

                var cmb = ((DataGridViewComboBoxCell)fila.Cells[1]);

                cmb.DataSource = this.TipoDato;
                cmb.Value      = this.TipoDato[item.TIPO];
            }

            ps.CerrarConexion();
        }
Example #7
0
        public frmAgregarCategoria(long ID)
        {
            InitializeComponent();

            this._ID_EDITAR = ID;
            this._EDITANDO  = true;

            var ps = new CTRL.Persistencia();

            ps.AbrirConexion();

            var reg = ps.SelPorLlave <CATEGORIA>(ID.ToString());

            this.Text = this.lblTitulo.Text = "Editando Categoría";

            txtNombres.Text = reg.NOMBRE;
            txtDesc.Text    = reg.DESCRIPCION;

            ps.CerrarConexion();
        }
Example #8
0
        public frmAgregarSector(long ID, long ID_EMPRESA)
        {
            InitializeComponent();

            this._ID_EDITAR = ID;
            this._EDITANDO  = true;

            var ps = new CTRL.Persistencia();

            ps.AbrirConexion();

            var reg = ps.SelPorLlave <EMPRESA_SECTOR>(ID.ToString());

            this.Text = this.lblTitulo.Text = "Editando Sector";

            txtNombres.Text = reg.NOMBRE;
            txtDesc.Text    = reg.DESCRIPCION;

            ps.CerrarConexion();
        }
Example #9
0
        void Cargar()
        {
            dgRegistros.Rows.Clear();

            var ps = new CTRL.Persistencia();

            ps.AbrirConexion();

            var reg = ps.SelPorLlave <SOLICITUD>(ID_SOLICITUD.ToString());

            if (reg != null)
            {
                dtpFecha.Value     = reg.FECHA_EMISION;
                dtpRequerido.Value = reg.FECHA_ENTREGA.Value;

                txtNombres.Text = reg.NOMBRES;

                decimal A = reg.SOLICITUD_RESULTADOs.Count();
                decimal B = reg.SOLICITUD_DETALLEs.Count();

                var progreso = (int)((A / B) * 100);

                pbProgreso.Value = progreso;

                foreach (var item in reg.SOLICITUD_DETALLEs)
                {
                    dgRegistros.Rows.Add(
                        new object[] {
                        item.ID_ANALISIS.ToString(), item.ANALISI.NOMBRE,
                        reg.SOLICITUD_RESULTADOs.Where(c => c.ID_ANALISIS == item.ID_ANALISIS)
                        .Select(c => c.OBSERVACIONES).SingleOrDefault()
                    }
                        );
                }
            }

            ps.CerrarConexion();
        }
Example #10
0
        public frmAgregarDoctor(long ID, bool Visor = false)
        {
            InitializeComponent();

            this._ID_EDITAR = ID;
            this._EDITANDO  = true;

            var ps = new CTRL.Persistencia();

            ps.AbrirConexion();

            var reg = ps.SelPorLlave <DOCTORE>(ID.ToString());

            this.Text = this.lblTitulo.Text = "Editando doctor";

            txtNombres.Text         = reg.NOMBRES;
            txtTelefono.Text        = reg.TELEFONO;
            txtDireccion.Text       = reg.DIRECCION;
            txtNIT.Text             = reg.NIT;
            txtDUI.Text             = reg.DUI;
            txtCorreo.Text          = reg.CORREO;
            txtClinicaNombre.Text   = reg.CLINICA_NOMBRE;
            txtClinicaTelefono.Text = reg.CLINICA_TELEFONO;

            if (Visor)
            {
                this.ControlBox = true;
                this.Text       = this.lblTitulo.Text = "Visualizando doctor";

                txtNombres.ReadOnly           = txtTelefono.ReadOnly = txtDUI.ReadOnly = txtDireccion.ReadOnly =
                    txtClinicaNombre.ReadOnly = txtClinicaTelefono.ReadOnly = txtNIT.ReadOnly = txtCorreo.ReadOnly = true;

                cmdGuardar.Visible = cmdCancelar.Visible = false;
            }

            ps.CerrarConexion();
        }
Example #11
0
        public frmAgregarSolicitud(long ID, bool visor = false)
        {
            InitializeComponent();

            this._EDITANDO      = true;
            this.lblTitulo.Text = this.Text = "Editando Solicitud";

            this._ID_SOLICITUD = ID;

            var ps = new CTRL.Persistencia();

            ps.AbrirConexion();

            var reg = ps.SelPorLlave <SOLICITUD>(ID.ToString());

            if (reg != null)
            {
                this.nudIVA.Value   = reg.PORCENTAJE_IVA * 100;
                this.nudReten.Value = reg.PORCENTAJE_RETENCION * 100;

                txtPacienteID.Text   = reg.ID_PACIENTE.ToString();
                txtDoctorID.Text     = reg.ID_DOCTOR.ToString();
                txtDoctorNombre.Text = reg.DOCTORE.NOMBRES;
                txtNombre.Text       = reg.NOMBRES;
                txtNRC.Text          = reg.NRC;
                txtNIT.Text          = reg.NIT;
                txtGiro.Text         = reg.GIRO;
                txtFactura.Text      = reg.NO_FACTURA.ToString();

                dtpFecha.Value     = reg.FECHA_EMISION;
                dtpRequerido.Value = reg.FECHA_ENTREGA.Value;

                ckCFinal.Checked    = !reg.CREDITO_FISCAL;
                ckCFiscal.Checked   = reg.CREDITO_FISCAL;
                ckRetencion.Checked = reg.RETENCION;

                //AGREGANDO DETALLE
                this._AGREGANDO_FILAS = true;

                foreach (var item in reg.SOLICITUD_DETALLEs)
                {
                    int f = dgMovs.Rows.Add();

                    dgMovs.Rows[f].SetValues(new object[] { item.ID_ANALISIS, item.ANALISI.NOMBRE, item.PRECIO, item.OBSERVACIONES,
                                                            item.EXENTO });
                }
                this._AGREGANDO_FILAS = false;

                if (visor)
                {
                    this.cmdPaciente.Enabled = cmdDoctor.Enabled = ckRetencion.Enabled = ckCFiscal.Enabled = ckCFinal.Enabled =
                        dtpFecha.Enabled     = dtpRequerido.Enabled = cmdEliminarMov.Enabled = nudIVA.Enabled = nudReten.Enabled = false;

                    txtNombre.ReadOnly = txtNRC.ReadOnly = txtNIT.ReadOnly = txtFactura.ReadOnly = txtGiro.ReadOnly = true;
                }

                ActualizarTotales();
            }
            else
            {
                MessageBox.Show("El registro no fue encontrado.", "ContaClic", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }
        }
Example #12
0
        private void dgMovs_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            //SI SE CHECKEO QUE ES EXENTO Y LA FACTURA ESTÁ EN CONSUMIDOR FINAL SE DEBE QUITAR EL IVA
            if (e.ColumnIndex == 4 && !_AGREGANDO_FILAS && e.RowIndex >= 0)
            {
                if (ckCFinal.Checked && (bool)dgMovs[4, e.RowIndex].Value)
                {
                    dgMovs[2, e.RowIndex].Value = decimal.Round((decimal)dgMovs[2, e.RowIndex].Value / (1 + this.ptjIVA), 2);
                }
                else if (ckCFinal.Checked && !(bool)dgMovs[4, e.RowIndex].Value)
                {
                    dgMovs[2, e.RowIndex].Value = decimal.Round((decimal)dgMovs[2, e.RowIndex].Value * (1 + this.ptjIVA), 2);
                }

                var fila = dgMovs.Rows[e.RowIndex];

                if (fila.Tag != null)
                {
                    var  lsPrecios   = (List <decimal>)fila.Tag;
                    bool fila_Exenta = (bool)fila.Cells[4].FormattedValue;


                    if (fila_Exenta)
                    {
                        //CONSUMIDOR FINAL, LISTA DE PRECIOS TIENE IVA, SE DEBE QUITAR
                        if (ckCFinal.Checked)
                        {
                            lsPrecios[0] = decimal.Round((lsPrecios[0] / (1 + this.ptjIVA)), 4);
                            lsPrecios[1] = decimal.Round((lsPrecios[1] / (1 + this.ptjIVA)), 4);
                            lsPrecios[2] = decimal.Round((lsPrecios[2] / (1 + this.ptjIVA)), 4);
                        }
                    }
                    else
                    {
                        //CONSUMIDOR FINAL, LISTA DE PRECIOS TIENE IVA, SE DEBE PONER
                        if (ckCFinal.Checked)
                        {
                            lsPrecios[0] = decimal.Round((lsPrecios[0] * (1 + this.ptjIVA)), 4);
                            lsPrecios[1] = decimal.Round((lsPrecios[1] * (1 + this.ptjIVA)), 4);
                            lsPrecios[2] = decimal.Round((lsPrecios[2] * (1 + this.ptjIVA)), 4);
                        }
                    }
                    fila.Tag = lsPrecios;
                }
            }
            ActualizarTotales();

            if (e.ColumnIndex == 0 && e.RowIndex >= 0 && dgMovs[0, e.RowIndex].EditedFormattedValue.ToString() != string.Empty)
            {
                var ps = new CTRL.Persistencia();
                ps.AbrirConexion();
                var db = ps.DB;

                try
                {
                    List <decimal> precios = new List <decimal>();

                    var analisis = db.ANALISIs.Where(p => p.ID_ANALISIS ==
                                                     long.Parse(dgMovs[0, e.RowIndex].Value.ToString())).SingleOrDefault();

                    if (analisis != null)
                    {
                        precios.Add(decimal.Round(analisis.PRECIO1 * ((ckCFinal.Checked) ? (1 + this.ptjIVA) : 1), 2));
                        precios.Add(decimal.Round(analisis.PRECIO2 * ((ckCFinal.Checked) ? (1 + this.ptjIVA) : 1), 2));
                        precios.Add(decimal.Round(analisis.PRECIO3 * ((ckCFinal.Checked) ? (1 + this.ptjIVA) : 1), 2));

                        dgMovs.Rows[e.RowIndex].Tag = precios;

                        dgMovs.Rows[e.RowIndex].Cells[2].Value = precios[_PRECIO_SEL - 1];
                    }
                }
                catch (Exception)
                {
                    ps.CerrarConexion();
                }
            }
            else if (e.RowIndex >= 0 && e.ColumnIndex == 0)
            {
                dgMovs.Rows[e.RowIndex].Tag = null;
            }
        }