示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Usuario = Utilerias.FiltrarUsuario(this);
            Periodo = Usuario.ConsultarPeriodoActual();

            if (!IsPostBack)
            {
                txtFechaCreacion.Text = DateTime.Today.Date.ToShortDateString();

                Estatus = EstatusNecesidadDAO.Listar();
                aux.Add(Estatus[2]);
                cmbEstatus.DataSource = aux;
                cmbEstatus.DataBind();

                necesidadesArea = Usuario.Area.Rellenar().Necesidades;

                string Filas = "";
                foreach (Necesidad p in necesidadesArea)
                {
                    p.Rellenar();
                    string url = ResolveUrl("~/App/Area/RegistroNecesidadDetalle.aspx?id=" + p.Clave);
                    Filas += Disenio.GenerarFilaTabla(p.FechaCreacion.ToShortDateString(),
                                                      p.Periodo.Descripcion,
                                                      p.Estatus.Descripcion,
                                                      "<a href='" + url + "' class='btn btn-default btn-block'>Editar</a>");


                    if ((p.Estatus.Descripcion == "En revisión" && p.ClavePeriodo == Periodo.Clave) || p.Estatus.Descripcion == "Inicial" && p.ClavePeriodo == Periodo.Clave)
                    {
                        btnRegistrarNecesidad.Visible = false;
                    }
                }
                litTBody.Text = Filas;
            }
        }
示例#2
0
 public Necesidad Rellenar()
 {
     try
     {
         Area      = AreaDAO.Get(ClaveArea);
         Periodo   = PeriodoDAO.Get(ClavePeriodo);
         Estatus   = EstatusNecesidadDAO.Get(ClaveEstatus);
         Detalles  = NecesidadDetalleDAO.Listar().Where(n => n.ClaveNecesidad == Clave).ToList();
         Programas = ProgramaDAO.Listar().Where(p => p.ClaveNecesidad == Clave).ToList();
         return(this);
     }
     catch (Exception e)
     {
         throw e;
     }
 }