Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Katapoka.BLL.Autenticacao.Usuario.UsuarioAtual == null)
        {
            Response.Redirect("~/Default.aspx");
        }

        int idTipoProjeto = 0;

        if (Request.QueryString["id"] != null)
        {
            if (Int32.TryParse(Request.QueryString["id"].ToString(), out idTipoProjeto))
            {
                Katapoka.BLL.Projeto.TipoProjetoBLL tipoProjetoBLL = new Katapoka.BLL.Projeto.TipoProjetoBLL();

                Katapoka.DAO.TipoProjeto_Tb tipoProjetoTb = tipoProjetoBLL.GetTipoProjeto(idTipoProjeto, null).FirstOrDefault();
                if (tipoProjetoTb != null)
                {
                    txtTipoProjeto.Value = tipoProjetoTb.DsTipo;
                }
            }
        }
        this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "IdTipoProjeto", string.Format("var IdTipoProjeto = {0};", idTipoProjeto == 0 ? "null" : idTipoProjeto.ToString()), true);
    }
Ejemplo n.º 2
0
    public Repeater PopularGrid()
    {
        int?   idTipoProjeto = Request.QueryString["idTipoProjeto"] != null && Request.QueryString["idTipoProjeto"].ToString() != "" ? Convert.ToInt32(Request.QueryString["idTipoProjeto"].ToString()) : (int?)null;
        string dsTipoProjeto = Request.QueryString["dsTipoProjeto"] != null ? Request.QueryString["dsTipoProjeto"].ToString() : null;

        Katapoka.BLL.Projeto.TipoProjetoOrder order          = Request.QueryString["order"] != null ? (Katapoka.BLL.Projeto.TipoProjetoOrder)Enum.Parse(typeof(Katapoka.BLL.Projeto.TipoProjetoOrder), Request.QueryString["order"].ToString()) : Katapoka.BLL.Projeto.TipoProjetoOrder.IdC;
        Katapoka.BLL.Projeto.TipoProjetoBLL   tipoProjetoBLL = new Katapoka.BLL.Projeto.TipoProjetoBLL();

        Katapoka.Core.WebControlBind.TotalRegistros = tipoProjetoBLL.GetTipoProjetoCount(idTipoProjeto, dsTipoProjeto, order);
        Katapoka.Core.WebControlBind.RepeaterBind <Katapoka.DAO.TipoProjeto_Tb>(rptGrid, tipoProjetoBLL.GetTipoProjeto(idTipoProjeto, dsTipoProjeto, order,
                                                                                                                       Katapoka.Core.WebControlBind.PaginaAtual * Katapoka.Core.WebControlBind.QtdRegistrosPagina,
                                                                                                                       Katapoka.Core.WebControlBind.QtdRegistrosPagina),
                                                                                Katapoka.Core.WebControlBind.PaginaAtual,
                                                                                Katapoka.Core.WebControlBind.QtdRegistrosPagina,
                                                                                Katapoka.Core.WebControlBind.TotalRegistros,
                                                                                null,
                                                                                PopularDropDownListOrdernacao,
                                                                                null);

        return(rptGrid);
    }