Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["usuario"] != null)
                {
                    if (Session["usuario"].ToString() != string.Empty)
                    {
                        pro.IdLogin = Convert.ToInt32(Session["idlogin"]);
                        pro         = proDAL.PreencherPeloID(pro);


                        if (pro.IdProfessor.ToString() != null)
                        {
                            if (pro.IdProfessor.ToString() != "")
                            {
                                int idRecebido;
                                int.TryParse(pro.IdProfessor.ToString(), out idRecebido);

                                //pro.IdProfessor = idRecebido;
                                //pro = proDAL.PreencherPeloID(pro);

                                lo.IdLogin = Convert.ToInt32(Session["idlogin"]);
                                lo         = loDAL.PreencherPeloID(lo);

                                if (pro.IdProfessor != 0)
                                {
                                    lblId.Text        = pro.IdProfessor.ToString();
                                    Image1.ImageUrl   = pro.Foto;
                                    txtNome.Text      = pro.Nome;
                                    txtEmail.Text     = pro.Email;
                                    txtTelefone.Text  = pro.Telefone;
                                    txtDescricao.Text = pro.Descricao;
                                    txtCpf.Text       = pro.Cpf;


                                    Image1.ImageUrl   = pro.Foto;
                                    lblNome.Text      = pro.Nome;
                                    lblEmail.Text     = pro.Email;
                                    lblTelefone.Text  = pro.Telefone;
                                    lblDescricao.Text = pro.Descricao;
                                    lblCpf.Text       = pro.Cpf;

                                    lblIdL.Text     = lo.IdLogin.ToString();
                                    txtUsuario.Text = lo.Usuario;
                                    txtSenha.Text   = lo.Senha;
                                }
                                else
                                {
                                    //lblId.Text = "ID INVÁLIDO";
                                }
                            }
                            else
                            {
                                //lblId.Text = "ID INVÁLIDO";
                            }
                        }
                        else
                        {
                            //lblId.Text = "ID INVÁLIDO";
                        }
                    }
                    else
                    {
                        Response.Redirect("../ADMINISTRADOR/LoginAdm.aspx");
                    }
                }
                else
                {
                    Response.Redirect("../ADMINISTRADOR/LoginAdm.aspx");
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["usuario"] != null)
                {
                    if (Session["usuario"].ToString() != string.Empty)
                    {
                        adm.IdAdm = Convert.ToInt32(Session["idlogin"]);
                        adm       = admDAL.PreencherPeloID(adm);

                        if (adm.IdAdm.ToString() != null)
                        {
                            if (adm.IdAdm.ToString() != "")
                            {
                                int idRecebido;
                                int.TryParse(adm.IdAdm.ToString(), out idRecebido);

                                lo.IdLogin = Convert.ToInt32(Session["idlogin"]);
                                lo         = loDAL.PreencherPeloID(lo);

                                if (adm.IdAdm != 0)
                                {
                                    lblId.Text      = adm.IdAdm.ToString();
                                    Image1.ImageUrl = adm.Foto;
                                    txtNome.Text    = adm.Nome;
                                    txtEmail.Text   = adm.Email;

                                    Image1.ImageUrl = adm.Foto;
                                    lblNome.Text    = adm.Nome;
                                    lblEmail.Text   = adm.Email;

                                    lblIdL.Text     = lo.IdLogin.ToString();
                                    txtUsuario.Text = lo.Usuario;
                                }
                                else
                                {
                                    //lblId.Text = "ID INVÁLIDO";
                                }
                            }
                            else
                            {
                                //lblId.Text = "ID INVÁLIDO";
                            }
                        }
                        else
                        {
                            //lblId.Text = "ID INVÁLIDO";
                        }
                    }
                    else
                    {
                        Response.Redirect("LoginAdm.aspx");
                    }
                }
                else
                {
                    Response.Redirect("LoginAdm.aspx");
                }
            }
        }