Пример #1
0
        private void CargaFicha(int Id)
        {
            TrxCARGA_PRESTACIONES_VETERINARIAS_DETALLE PrestacionesVeterinarias = new TrxCARGA_PRESTACIONES_VETERINARIAS_DETALLE();
            var prestaciones = PrestacionesVeterinarias.GetByIdWithReferencesFull(Id);

            if (prestaciones == null)
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "js_carga_prestaciones", "javascript:alert('No existe información asociada.');", true);
            }

            //cargar ficha
            txtNumeroFicha.Text    = prestaciones.FICHA;
            txtNombre.Text         = prestaciones.NOMBRE;
            txtEspecie.Text        = prestaciones.ESPECIE;
            txtRaza.Text           = prestaciones.RAZA;
            txtSexo.Text           = prestaciones.SEXO;
            txtEdad.Text           = prestaciones.EDAD;
            txtTelefono.Text       = prestaciones.TELEFONO;
            txtProcedencia.Text    = prestaciones.PROCEDENCIA;
            txtGarantia.Text       = prestaciones.GARANTIA;
            txtPendiente.Text      = prestaciones.PENDIENTE;
            txtMontoTotal.Text     = prestaciones.TOTAL;
            txtRecepcion.Text      = prestaciones.RECEPCION;
            txtMedico.Text         = prestaciones.MEDICO;
            txtSolicitante.Text    = prestaciones.SOLICITA;
            txtFechaRecepción.Text = prestaciones.VALOR_FECHA_RECEPCION.ToString();//.FECHA_RECEPCION;
            txtFichaClinica.Text   = prestaciones.FICHA_CLINICA;

            //carga grilla
            var lista = prestaciones.CARGA_PRESTACIONES_VETERINARIAS_EXAMEN.Where(e => e.ACTIVO);
            List <DTOExamen> listaDTO = new List <DTOExamen>();

            foreach (var item in lista)
            {
                listaDTO.Add(new DTOExamen(item));
            }
            this.ListaExamen = listaDTO;

            //se carga grilla
            grdExamen.DataSource = listaDTO;
            grdExamen.DataBind();

            //validar
            TrxCARGA_PRESTACIONES_ENCABEZADO PrestacionesEncabezado = new TrxCARGA_PRESTACIONES_ENCABEZADO();
            var listaErrores = PrestacionesEncabezado.ValidarPrestacionVeterinaria(Id);

            grdErroresVeterinarios.DataSource = listaErrores;
            grdErroresVeterinarios.DataBind();
            panelErrores.Visible = listaErrores.Any();

            //Habilitar Edicion de Ficha
            string estado = prestaciones.CARGA_PRESTACIONES_ENCABEZADO.CARGA_PRESTACIONES_ESTADO.NOMBRE;

            if (estado == ENUM_CARGA_PRESTACIONES_ESTADO.Pendiente.ToString())
            {
                EditarFicha();
            }

            CalculoMontoPrestaciones();
        }
Пример #2
0
        protected void btnCancelar_Click(object sender, EventArgs e)
        {
            try
            {
                if (Request.QueryString["Id"] == null)
                {
                    throw new Exception("No se ha indicado identificador de la cuenta registrada");
                }

                int Id = int.Parse(Request.QueryString["Id"].ToString());

                TrxCARGA_PRESTACIONES_VETERINARIAS_DETALLE _TrxCARGA_PRESTACIONES_VETERINARIAS_DETALLE = new TrxCARGA_PRESTACIONES_VETERINARIAS_DETALLE();
                CARGA_PRESTACIONES_VETERINARIAS_DETALLE    _CARGA_PRESTACIONES_VETERINARIAS_DETALLE    = _TrxCARGA_PRESTACIONES_VETERINARIAS_DETALLE.GetByIdWithReferences(Id);
                int IdEncabezado = _CARGA_PRESTACIONES_VETERINARIAS_DETALLE.CARGA_PRESTACIONES_ENCABEZADO.ID;
                Response.Redirect("EditarRegistros.aspx?Id=" + IdEncabezado, false);
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                panelMensaje.CssClass = "MostrarMensaje";
                lblMensaje.Text       = ex.Message;
                return;
            }
        }