コード例 #1
0
    private void preencheDados(Katapoka.DAO.Projeto_Tb projetoTb)
    {
        txtNomeProjeto.Value = projetoTb.DsNome;
        ListItem li = ddlEmpresa.Items.FindByValue(projetoTb.IdEmpresa.ToString());

        if (li != null)
        {
            li.Selected = true;
        }
        if (projetoTb.DtInicioEstimado != null)
        {
            txtDtInicio.Value = projetoTb.DtInicioEstimado.Value.ToString("dd/MM/yyyy");
        }
        if (projetoTb.DtTerminoEstimado != null)
        {
            txtDtTermino.Value = projetoTb.DtTerminoEstimado.Value.ToString("dd/MM/yyyy");
        }
        if (projetoTb.DsCodigoReferencia != null)
        {
            txtCodigoReferencia.Value = projetoTb.DsCodigoReferencia;
        }
        ListItem liDdlFlStatus = ddlFlStatus.Items.FindByValue(projetoTb.FlStatus);

        if (liDdlFlStatus != null)
        {
            liDdlFlStatus.Selected = true;
        }
        ListItem liDdlTipoProjeto = ddlTipoProjeto.Items.FindByValue(projetoTb.IdTipoProjeto.ToString());

        if (liDdlTipoProjeto != null)
        {
            liDdlTipoProjeto.Selected = true;
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int idProjeto = 0;

        if (Katapoka.BLL.Autenticacao.Usuario.UsuarioAtual == null)
        {
            Response.Redirect("~/Login.aspx");
        }
        else
        {
            if (Request.QueryString["pid"] != null)
            {
                Int32.TryParse(Request.QueryString["pid"].ToString(), out idProjeto);
                if (idProjeto > 0)
                {
                    if (new Katapoka.BLL.Atividade.AtividadeBLL().GetCountAtividades(null, idProjeto, null, null, null, null, null, Katapoka.BLL.Atividade.AtividadeBLL.OrdenacaoAtividade.IdC) == 0)
                    {
                        this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "IdProjeto", "var IdProjeto = " + idProjeto.ToString() + ";", true);
                        using (Katapoka.BLL.Atividade.TipoAtividadeBLL tipoAtividadeBLL = new Katapoka.BLL.Atividade.TipoAtividadeBLL())
                        {
                            using (Katapoka.BLL.Projeto.ProjetoBLL projetoBLL = tipoAtividadeBLL.CriarObjetoNoMesmoContexto <Katapoka.BLL.Projeto.ProjetoBLL>())
                            {
                                Katapoka.DAO.Projeto_Tb projetoTb = projetoBLL.GetById(idProjeto);
                                if (projetoTb != null)
                                {
                                    IList <Katapoka.DAO.Atividade.TipoAtividade> atividades =
                                        tipoAtividadeBLL.GetTipoAtividadePorTipoProjeto(projetoTb.IdTipoProjeto);

                                    for (int i = 1; i <= atividades.Count; i++)
                                    {
                                        this.relacoes[atividades[i - 1].IdTipoAtividade.Value] = i;
                                    }

                                    rptAtividades.DataSource = atividades;
                                    rptAtividades.DataBind();
                                }
                                else
                                {
                                    Response.Redirect("~/ListarProjetos.aspx");
                                }
                            }
                        }
                    }
                    else
                    {
                        Response.Redirect("~/ListarProjetos.aspx");
                    }
                }
                else
                {
                    Response.Redirect("~/ListarProjetos.aspx");
                }
            }
            else
            {
                Response.Redirect("~/ListarProjetos.aspx");
            }
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Katapoka.BLL.Autenticacao.Usuario.UsuarioAtual == null)
        {
            Response.Redirect("~/Login.aspx");
        }

        int idProjeto = 0;
        int idEmpresa = 0;

        populaDDLEmpresa();

        if (Request.QueryString["eid"] != null && Int32.TryParse(Request.QueryString["eid"].ToString(), out idEmpresa))
        {
            ListItem eli = ddlEmpresa.Items.FindByValue(idEmpresa.ToString());
            if (eli != null)
            {
                eli.Selected = true;
            }
        }

        populaDDLTipoProjeto();

        if (Request.QueryString["id"] != null && Int32.TryParse(Request.QueryString["id"].ToString(), out idProjeto))
        {
            //Edição
            using (Katapoka.BLL.Projeto.ProjetoBLL projetoBLL = new Katapoka.BLL.Projeto.ProjetoBLL())
            {
                Katapoka.DAO.Projeto_Tb projetoTb = projetoBLL.GetById(idProjeto);
                preencheDados(projetoTb);
            }
        }
        else
        {
            //Criação
        }
        this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "IdProjeto", "var IdProjeto = " + (idProjeto > 0 ? idProjeto.ToString() : "null") + ";", true);
    }