public int Modificar(ExpedienteVob expediente)
        {
            Expediente exp = new Expediente();

            DateTime fecha = new DateTime();

            fecha = DateTime.Today;

            using (var context = new UPC_MUNIEntities())
            {
                var expmodif = (from c in context.Expediente
                                where c.NumeroExpediente == expediente.NumeroExpediente
                                select c).First();



                expmodif.Tipo_Expediente = expediente.Tipo_Expediente;
                expmodif.Asunto          = expediente.Asunto;
                // exp.FechaExpediente = fecha;
                //exp.NumeroExpediente = expediente.NumeroExpediente;
                expmodif.Estado = 1;
                //  context.Expediente.Add(exp);
                context.SaveChanges();

                return(Convert.ToInt32(expediente.NumeroExpediente));
            };
        }
        public async Task <ActionResult> Crear([FromBody] CrearViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Expediente expediente = new Expediente
            {
                idMedico          = model.idMedico,
                idUsuario         = model.idUsuario,
                Nombre            = model.Nombre,
                Nombre_Medico     = model.Nombre_Medico,
                Nombre_Usuario    = model.Nombre_Usuario,
                Fecha             = model.Fecha,
                Detalles_Estudios = model.Detalles_Estudios,
                Detalles_Examenes = model.Detalles_Examenes,
                Recetas           = model.Recetas,
                Costo_Cita        = model.Costo_Cita,
            };

            _context.Expedientes.Add(expediente);

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (Exception)
            {
            }

            return(Ok());
        }
Exemplo n.º 3
0
        // GET: Expedientes
        public ActionResult BuscarExpediente()
        {
            if (Session["usuario"] == null)
            {
                return(RedirectToAction("Index", "Home"));
            }


            if (Session["expediente"] != null)
            {
                int        id         = (int)Session["expediente"];
                Expediente expediente = db.Expedientes.Where(m => m.Id == id).Include(t => t.EtapasDeExpediente).FirstOrDefault();
                if (expediente == null)
                {
                    ViewBag.Error = "No se encontró el expediente";
                    return(View());
                }
                else
                {
                    return(View(expediente.EtapasDeExpediente));
                }
            }

            return(View());
        }
        // GET: /Expediente/Create
        public ActionResult Create(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var dictamenReclamacion = db.DictamenesDeReclamacion.Find(id);
            //todo: revisar el consecutivo del expediente
            var count = db.Expedientes.Count() + 1;
            var año   = DateTime.Now.Year.ToString().Substring(2, 2);

            if (!db.Expedientes.Any(e => e.DictamenDeReclamacionId == id))
            {
                var expediente = new Expediente()
                {
                    Numero = ConfiguracionData.Codigo + "-" + count + "-" + año,
                    DictamenDeReclamacion        = dictamenReclamacion,
                    DictamenDeReclamacionId      = dictamenReclamacion.Id,
                    FechaAfectacion              = DateTime.Now,
                    FechaDeNormalizacionServicio = DateTime.Now,
                    FechaNt = DateTime.Now,
                    FechaRecibidoUebMunicipal = DateTime.Now,
                    FechaVisitaCliente        = DateTime.Now,
                    PagadoHasta = DateTime.Now
                };
                ViewBag.DespachadorId = new SelectList(db.Despachadores, "Id", "NombreCompleto");
                ViewBag.InspectorId   = new SelectList(db.Inspectores, "Id", "NombreCompleto");
                ViewBag.OperarioId    = new SelectList(db.Operarios, "Id", "NombreCompleto");
                return(View(expediente));
            }
            return(RedirectToAction("Details", new{ id = id }));
        }
Exemplo n.º 5
0
        public ActionResult BuscarExpediente(string idExpediente)
        {
            if (Session["usuario"] == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            Session["expediente"] = null;

            int        id;
            Expediente expediente = null;
            bool       esNumero   = Int32.TryParse(idExpediente, out id);

            if (esNumero)
            {
                expediente = db.Expedientes.Where(m => m.Id == id).Include(t => t.EtapasDeExpediente).FirstOrDefault();
            }

            if (expediente == null)
            {
                ViewBag.Error = "No se encontró el expediente";
                return(View());
            }

            Session["expediente"] = id;
            return(View(expediente.EtapasDeExpediente));
        }
Exemplo n.º 6
0
        public ActionResult Index(AltaExpedienteViewModel model)
        {
            if (Session["usuario"] == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            string mail = Session["usuario"].ToString();

            Solicitante solicitante = db.Solicitantes.Find(model.CedulaSolicitante);

            if (ModelState.IsValid && solicitante != null)
            {
                Tramite    tramite = db.Tramites.Where(m => m.Id == model.idTramiteSeleccionado).Include(t => t.Etapas).FirstOrDefault();
                Expediente e       = new Expediente {
                    Solicitante = solicitante, EmailFuncionario = mail, EstaCerrado = false, FechaActual = DateTime.Today, Tramite = tramite, EtapasDeExpediente = new List <EtapasDeExpediente>()
                };

                foreach (Etapa et in e.Tramite.Etapas)
                {
                    EtapasDeExpediente EtapaExpediente = new EtapasDeExpediente {
                        Etapa = et, FechaInicio = e.FechaActual, FechaFin = e.FechaActual, Funcionario = null, Finalizada = false, Foto = ""
                    };
                    e.EtapasDeExpediente.Add(EtapaExpediente);
                }

                db.Expedientes.Add(e);
                db.SaveChanges();
                ViewBag.Mensaje = "Alta de expediente exitosa";
                return(View("Mensaje"));
            }

            ViewBag.Error = "Error al ingresar un nuevo expediente";
            return(View(model));
        }
        public IActionResult ModificarExpediente(int radiobtn)  //radiobtn es el nombre de la variable que recibo desde el javascript en BuscarExpediente.cshtml
        {
            expediente = new Expediente();
            int codigo_paciente = radiobtn;

            expediente = modeloExpediente.Obtener_Expediente(codigo_paciente);

            if (expediente != null)
            {
                ViewBag.codigo_paciente   = expediente.Codigo_paciente;
                ViewBag.codigo_expediente = expediente.Codigo_expediente;
                ViewBag.descripcion       = expediente.Descripcion_expediente;
                ViewBag.nombres           = expediente.Nombres_paciente;
                ViewBag.apellidos         = expediente.Apellidos_paciente;
                ViewBag.direccion         = expediente.Direccion_paciente;
                ViewBag.telefono          = expediente.Telefono_paciente;
                DateTime fecha = expediente.Fecha_nacimiento;
                ViewBag.fecha_nacimiento = fecha.ToString("yyyy-MM-dd");
                ViewBag.seguro_social    = expediente.Seguro_social;
                ViewBag.genero           = expediente.Genero;
                ViewBag.email            = expediente.Email;
            }

            return(View());
        }
Exemplo n.º 8
0
        public Expediente GetById(string id)
        {
            Expediente expe = new Expediente();

            expe = _expedientes.Find(exped => exped.id == id).FirstOrDefault();
            return(expe);
        }
Exemplo n.º 9
0
        // GET: Expediente/Edit/5
        public async Task <ActionResult> Edit(string id)
        {
            if (id == null)
            {
                ViewData["Error"] = await ErrorAsync("Expediente", "Edit", "No se ingreso el Id", 400);

                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var result = await GetAsync("api/Expediente/" + id);

            Expediente expediente = null;

            if (result.IsSuccessStatusCode)
            {
                var resultdata = result.Content.ReadAsStringAsync().Result;
                expediente = JsonConvert.DeserializeObject <Expediente>(resultdata);
            }
            if (expediente == null)
            {
                ViewData["Error"] = await ErrorAsync("Expediente", "Edit", "Error al consultar api", 404);

                return(HttpNotFound());
            }
            return(View(expediente));
        }
        public int Guardar(Expediente entidad)
        {
            int Id = entidad.Id;

            Catalogo.Id                 = Id;
            Catalogo.Folio              = entidad.Folio;
            Catalogo.Fecha              = entidad.Fecha;
            Catalogo.Hora               = entidad.Hora;
            Catalogo.Cliente            = entidad.Cliente;
            Catalogo.TipoCliente        = entidad.TipoCliente;
            Catalogo.Auditor            = entidad.Auditor;
            Catalogo.TipoAuditoria      = entidad.TipoAuditoria;
            Catalogo.Descripcion        = entidad.Descripcion;
            Catalogo.FechaAceptacion    = entidad.FechaAceptacion;
            Catalogo.FechaInicio        = entidad.FechaInicio;
            Catalogo.FechaCierre        = entidad.FechaCierre;
            Catalogo.FechaDictamen      = entidad.FechaDictamen;
            Catalogo.FolioDictamen      = entidad.FolioDictamen;
            Catalogo.NumRecomendaciones = entidad.NumRecomendaciones;
            Catalogo.NumHallazgos       = entidad.NumHallazgos;
            Catalogo.EstatusInforme     = entidad.EstatusInforme;
            Catalogo.PeriodoAuditar     = entidad.PeriodoAuditar;
            Catalogo.Conclusion         = entidad.Conclusion;
            Catalogo.Vencimiento        = entidad.Vencimiento;
            Catalogo.Estatus            = entidad.Estatus;
            Catalogo.Usuario            = entidad.Usuario;
            Catalogo.NumEntregados      = entidad.NumEntregados;
            Catalogo.NumPendientes      = entidad.NumPendientes;
            Catalogo.UsuarioMod         = entidad.UsuarioMod;
            Catalogo.FechaMod           = entidad.FechaMod;
            Id = Catalogo.Guardar();
            return(Id);
        }
Exemplo n.º 11
0
        public async Task <IActionResult> Edit(int id, [Bind("IdExpediente,FechaGen,IdPaciente")] Expediente expediente)
        {
            if (id != expediente.IdExpediente)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(expediente);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ExpedienteExists(expediente.IdExpediente))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdPaciente"] = new SelectList(_context.Paciente, "IdPaciente", "IdPaciente", expediente.IdPaciente);
            return(View(expediente));
        }
Exemplo n.º 12
0
        public ActionResult <Expediente> GetById([FromQuery] string id)
        {
            Expediente expe = new Expediente();

            expe = _expedienteService.GetById(id);
            return(expe);
        }
Exemplo n.º 13
0
        public List <Expediente> ObtenerExpedientes(int IdSocio)
        {
            List <Expediente> lstExpedientes = new List <Expediente>();

            try
            {
                using (db = new DBManager(ConfigurationManager.AppSettings["conexionString"].ToString()))
                {
                    db.Open();
                    db.CreateParameters(1);
                    db.AddParameters(0, "@idSocio", (IdSocio == 0 ? DBNull.Value : (Object)IdSocio));
                    db.ExecuteReader(System.Data.CommandType.StoredProcedure, "[SP_OBTENER_EXPEDIENTES]");
                    while (db.DataReader.Read())
                    {
                        Expediente e = new Expediente();
                        e.nombreDoc        = db.DataReader["nombreDocumento"].ToString();
                        e.pathExpediente   = db.DataReader["pathExpediente"].ToString();
                        e.extencionArchivo = db.DataReader["extencionArchivo"].ToString();
                        e.pesoByte         = Convert.ToInt64(db.DataReader["pesoByte"]);
                        e.id = Convert.ToInt64(db.DataReader["idExpedientes"]);
                        lstExpedientes.Add(e);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lstExpedientes);
        }
        public async Task <IActionResult> Edit(int id, [Bind("IdExpdt,NumExpdt,IdDepInicio,IdOperador,IdUsuario,Extracto,Observaciones,FechaAltaExpte,FechaFinalExpte,Estado")] Expediente expedientes)
        {
            if (id != expedientes.IdExpdt)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(expedientes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ExpedientesExists(expedientes.IdExpdt))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(expedientes));
        }
Exemplo n.º 15
0
        public List <Expediente> TodosExpedientes()
        {
            List <Expediente> luistexp = new List <Expediente>();

            expedienteTableAdapter1.Fill(bdanexoDataSet.expediente);


            foreach (var item in bdanexoDataSet.expediente.Rows)
            {
                Expediente exp = new Expediente();
                exp.id = ((bdanexoDataSet.expedienteRow)item).Id.ToString();
                bdanexoDataSet.usuarioDataTable usuario = usuarioTableAdapter1.UsuarioById(((bdanexoDataSet.expedienteRow)item).idusuario);

                if (usuario.Rows.Count > 0)
                {
                    exp.UsuarioNombre = ((bdanexoDataSet.usuarioRow)usuario.Rows[0]).nombreusuario;
                    exp.Area          = ((bdanexoDataSet.usuarioRow)usuario.Rows[0]).area;
                }

                this.equipoTableAdapter1.Fill(this.bdanexoDataSet.equipo);
                bdanexoDataSet.equipoDataTable equipo = equipoTableAdapter1.GetEquipoByUsuario(((bdanexoDataSet.expedienteRow)item).Id);
                if (equipo.Rows.Count > 0)
                {
                    exp.noinventario = ((bdanexoDataSet.equipoRow)equipo.Rows[0]).noinventario;
                    exp.nombre       = ((bdanexoDataSet.equipoRow)equipo.Rows[0]).nombre;
                    exp.noserie      = ((bdanexoDataSet.equipoRow)equipo.Rows[0]).noserie;
                    exp.estado       = ((bdanexoDataSet.equipoRow)equipo.Rows[0]).estado;
                }

                luistexp.Add(exp);
            }

            return(luistexp);
        }
Exemplo n.º 16
0
 private void GetStudentActualExpediente()
 {
     using (SCPPContext context = new SCPPContext())
     {
         expediente = context.Expediente.FirstOrDefault(i => i.InscripciónID == inscription.InscripciónID);
     }
 }
Exemplo n.º 17
0
        public void TestInitialize()
        {
            CreateTestInscription();

            testExpediente = new Expediente()
            {
                Fechafinpp            = null,
                Fechainiciopp         = thisDay,
                Horasacumuladas       = 84101,
                Numreportesentregados = 1000,
                InscripciónID         = testInscription.InscripciónID
            };

            testExpedienteList = new List <Expediente>()
            {
                new Expediente
                {
                    Fechafinpp            = null,
                    Fechainiciopp         = thisDay.AddDays(2),
                    Horasacumuladas       = 84101,
                    Numreportesentregados = 2000,
                    InscripciónID         = testInscription.InscripciónID
                },

                new Expediente
                {
                    Fechafinpp            = null,
                    Fechainiciopp         = thisDay.AddDays(3),
                    Horasacumuladas       = 84101,
                    Numreportesentregados = 2000,
                    InscripciónID         = testInscription.InscripciónID
                }
            };
        }
Exemplo n.º 18
0
        public int insertarExpediente(Expediente ex)
        {
            try
            {
                SqlConnection cnx = cn.conectar();

                cm = new SqlCommand("Expedient", cnx);
                cm.Parameters.AddWithValue("@b", 1);
                cm.Parameters.AddWithValue("@IdExpediente", "");
                cm.Parameters.AddWithValue("@Cedula", ex.Cedula);
                cm.Parameters.AddWithValue("@Nombres", ex.Nombres);
                cm.Parameters.AddWithValue("@Apellidos", ex.Apellidos);
                cm.Parameters.AddWithValue("@Fecha_Nacimiento", ex.Fecha_Nacimiento);
                cm.Parameters.AddWithValue("@Telefono_Celular", ex.Telefono_Celular);
                cm.Parameters.AddWithValue("@Municipio", ex.Municipio);
                cm.Parameters.AddWithValue("@Departamento", ex.Departamento);

                cm.CommandType = CommandType.StoredProcedure;
                cnx.Open();
                cm.ExecuteNonQuery();
                indicador = 1;
            }
            catch (Exception e)
            {
                e.Message.ToString();
                indicador = 0;
            }
            finally
            {
                cm.Connection.Close();
            }
            return(indicador);
        }
        public string Insertar(ExpedienteDTO expediente)
        {
            using (db = new Contexto())
            {
                try
                {
                    // preparar el cliente para guardar
                    Expediente c = Expediente.MapeoDTOToDAL(expediente);
                    c.Obligacion            = Obligacion.MapeoDTOToDAL(expediente.Obligacion);
                    c.Obligacion.Expediente = c;
                    db.Expedientes.Add(c);
                    //db.Obligaciones.Add(c.Obligacion);
                    db.SaveChanges();
                    // preparar la respuesta
                    respuesta = "Se realizó la operación satisfactoriamente";
                }
                catch (System.Data.Entity.Validation.DbEntityValidationException ex)
                {
                    respuesta = ex.Message;
                }
                catch (Exception ex)
                {
                    respuesta = ex.Message;
                }

                return(respuesta);
            }
        }
Exemplo n.º 20
0
        public async Task <IActionResult> PutExpediente(int id, Expediente expediente)
        {
            if (id != expediente.Id)
            {
                return(BadRequest());
            }

            _context.Entry(expediente).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ExpedienteExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 21
0
        public async Task <ActionResult <Expediente> > PostExpediente(Expediente expediente)
        {
            _context.Expediente.Add(expediente);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetExpediente", new { id = expediente.Id }, expediente));
        }
Exemplo n.º 22
0
        public async Task Salvar(Expediente expediente)
        {
            try
            {
                IList <Expediente> expedientes = await _repositoryExpediente.ObterListaPor(x => x.PontoRetiradaId == expediente.PontoRetiradaId);

                // validar se existe um expediente com dia da semana e horários iguais
                if (expedientes.Any(x => x.Equals(expediente)))
                {
                    throw new RecebaFacilException("Já existe um expediente para este dia da semana");
                }

                if (Guid.Empty.Equals(expediente.Id))
                {
                    // não permitir salvar um dia da semana repetido
                    if (expedientes.Any(x => x.DiaSemana == expediente.DiaSemana))
                    {
                        throw new RecebaFacilException("Já existe um expediente para este dia da semana");
                    }

                    await _repositoryExpediente.Salvar(expediente);
                }
                else
                {
                    await _repositoryExpediente.Atualizar(expediente);
                }
            }
            catch (Exception ex)
            {
                _logger.LogError("ExpedienteService.Salvar", ex.Message);
                throw new RecebaFacilException("Erro ao salvar expediente");
            }
        }
Exemplo n.º 23
0
    //EVENTOS CLICK
    protected void lnkModificarExpediente_Click(object sender, EventArgs e)
    {
        Juzgado oJuzgado = new Juzgado();

        oJuzgado.Nombre = ((Label)GridViewExpedientes.SelectedRow.FindControl("Juzgado")).Text;

        Secretaria oSecretaria = new Secretaria();

        oSecretaria.Nombre = ((Label)GridViewExpedientes.SelectedRow.FindControl("Secretaria")).Text;

        Expediente oExpediente = new Expediente();

        oExpediente.Id          = int.Parse(GridViewExpedientes.SelectedRow.Cells[2].Text);
        oExpediente.Caratula    = GridViewExpedientes.SelectedRow.Cells[3].Text;
        oExpediente.Descripcion = GridViewExpedientes.SelectedRow.Cells[4].Text;
        oExpediente.Actores     = GridViewExpedientes.SelectedRow.Cells[5].Text;
        oExpediente.Consulta    = Controller.traerConsultaAsociada(oExpediente.Id);
        oExpediente.Juzgado     = oJuzgado;
        oExpediente.Secretaria  = oSecretaria;
        oExpediente.FechaInicio = Convert.ToDateTime(GridViewExpedientes.SelectedRow.Cells[8].Text);

        Session["Expediente"] = oExpediente;

        Response.Redirect("~/Abogado/NuevoExpediente.aspx");
    }
Exemplo n.º 24
0
        public async Task <IActionResult> Edit(string id, [Bind("NumCarnet,Nombre,Beneficiario,Parentesco,FechaNacimiento,TipoDeducible,Activo")] Expediente expediente)
        {
            if (id != expediente.NumCarnet)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(expediente);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ExpedienteExists(expediente.NumCarnet))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(expediente));
        }
Exemplo n.º 25
0
        public int insertarExpediente(Expediente ex)
        {
            try
            {
                SqlConnection cnx = cn.conectar();     //Conexión

                cm = new SqlCommand("Expedient", cnx); //Nombre del procedimiento SQL
                cm.Parameters.AddWithValue("@b", 1);   //Valor de parámetro

                //Atributos del procedimiento
                cm.Parameters.AddWithValue("@IdExpediente", "");
                cm.Parameters.AddWithValue("@Cedula", ex.Cedula);
                cm.Parameters.AddWithValue("@Nombres", ex.Nombres);
                cm.Parameters.AddWithValue("@Apellidos", ex.Apellidos);
                cm.Parameters.AddWithValue("@Fecha_Nacimiento", ex.Fecha_Nacimiento);
                cm.Parameters.AddWithValue("@Telefono_Celular", ex.Telefono_Celular);
                cm.Parameters.AddWithValue("@Municipio", ex.Municipio);
                cm.Parameters.AddWithValue("@Departamento", ex.Departamento);

                cm.CommandType = CommandType.StoredProcedure; //Tipo de comando ejecutado
                cnx.Open();                                   //Abrir conexión de BD
                cm.ExecuteNonQuery();                         //Ejecución de consulta
                indicador = 1;                                //Valor del indicador
            }
            catch (Exception e)
            {
                e.Message.ToString();//Muestra mensaje en caso de ERROR
                indicador = 0;
            }
            finally
            {
                cm.Connection.Close();//Cierre de conexión de BD
            }
            return(indicador);
        }
Exemplo n.º 26
0
        public ExpedienteDTO FindExpedienteById(int ExpedienteId)
        {
            //List<Expediente> lista = db.Expedientes.ToList();
            var           exped      = db.Expedientes.Where(t => t.ExpedienteId == ExpedienteId).FirstOrDefault();
            ExpedienteDTO expediente = Expediente.MapeoDALToDTO(exped);     // Busca por llave primaria

            return(expediente);
        }
Exemplo n.º 27
0
        public ActionResult DeleteConfirmed(int id)
        {
            Expediente expediente = db.Expedientes.Find(id);

            db.Expedientes.Remove(expediente);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        [HttpPost] ///GUARDAR UN EXPEDIENTE
        public ActionResult SaveEspxdiexte(Expediente expediente)
        {
            ExpedienteService.AddAExpediente(expediente);
            var expedientes = ExpedienteService.GetListaExpedientes(expediente.PacienteId);
            var paciente    = SessionList.SetListaPaciente(expediente.PacienteId);

            ViewBag.paciente = paciente;
            return(View("Espxdiexte", expedientes));
        }
 public ExpedienteDTO FindById(int ExpedienteId)
 {
     using (Contexto db = new Contexto())
     {
         var           exped      = db.Expedientes.Find(ExpedienteId);
         ExpedienteDTO expediente = Expediente.MapeoDALToDTO(exped); // Busca por llave primaria
         return(expediente);
     }
 }
Exemplo n.º 30
0
    protected void btnCancelar_Click(object sender, EventArgs e)
    {
        try
        {
            GuardarDenuncianteSession(null);
            LimpiarControles();
            HabilitarDesHabilitarControlesDenuncia(false);
            HabilitarDesHabilitarControlesDenunciante(false);

            this.lblNroExpediente.Text = "";
            this.lblFechaArchivo.Text  = "";
            this.lblFechaIngreso.Text  = "";
            this.lblEstado.Text        = "";
            this.cboInformante.Enabled = false;
            this.cboAtendio.Enabled    = false;

            this.btnNuevo.Enabled           = true;
            this.btnNuevo.CssClass          = "ButtonBlue11px";
            this.btnGuardar.Enabled         = false;
            this.btnGuardar.CssClass        = "ButtonBlue11pxDisable";
            this.btnBuscar.Enabled          = true;
            this.btnBuscar.CssClass         = "ButtonBlue11px";
            this.btnCancelar.Enabled        = false;
            this.btnCancelar.CssClass       = "ButtonBlue11pxDisable";
            this.btnModificar.Enabled       = false;
            this.btnModificar.CssClass      = "ButtonBlue11pxDisable";
            this.cboLocalidad.SelectedValue = "0";

            this.btnPrimero.Enabled    = true;
            this.btnPrimero.CssClass   = "ButtonBlue11px";
            this.btnAnterior.Enabled   = true;
            this.btnAnterior.CssClass  = "ButtonBlue11px";
            this.btnSiguiente.Enabled  = true;
            this.btnSiguiente.CssClass = "ButtonBlue11px";
            this.btnUltimo.Enabled     = true;
            this.btnUltimo.CssClass    = "ButtonBlue11px";

            this.btnADMCont.Enabled = true;
            btnADMCont.CssClass     = "ButtonBlue11px";



            Expediente expediente = NegocioExpedientes.TraerExpedienteCompletoPorIdExpediente(1);
            if (expediente != null)
            {
                GuardarExpedienteSession(expediente);
                SetearControlesExpediente(expediente);
                this.btnModificar.Enabled  = true;
                this.btnModificar.CssClass = "ButtonBlue11px";
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
    }