예제 #1
0
        protected void lkFoto_Click(object sender, EventArgs e)
        {
            LinkButton drp = (LinkButton)sender;

            GridViewRow gv = (GridViewRow)drp.NamingContainer;

            int index = gv.RowIndex;

            LinkButton lkFoto      = (LinkButton)gvDenuList.Rows[index].FindControl("lkFoto");
            int        id_denuncia = Convert.ToInt32(gvDenuList.Rows[index].Cells[0].Text);

            id_denu.Value = id_denuncia.ToString();
            Models.Denuncias denuncia = DenunciasDAO.GetDenunciaByID(id_denuncia);
            Equip            equip    = EquipDAO.GetEquipByID(denuncia.id_equip);
            string           jpg      = "/Content/Imagens/Denuncias/" + equip.descri + "_" + denuncia.data_denuncia.ToString("MM-dd-yyyy") + ".jpg";

            if (File.Exists(Server.MapPath(jpg)))
            {
                imgFoto.ImageUrl = jpg;
            }
            else
            {
                imgFoto.ImageUrl = "../../Content/Imagens/ImgNotFound.png";
            }
            tbxComentarios.Text = denuncia.comentarios;
            MPE_Foto.Show();
        }
예제 #2
0
        protected void btSalvarComentarios_Click(object sender, EventArgs e)
        {
            int returncode = DenunciasDAO.UpdateComentarios(Convert.ToInt32(id_denu.Value), tbxComentarios.Text);

            if (returncode == -1)
            {
                String str = "<script>alertify.error('Alterações feita sem sucesso!');</script>";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", str, false);
            }
            else
            {
                String str = "<script>alertify.success('Alterações guardadas com sucesso!');</script>";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", str, false);
            }
            DataBindGrid();
            btSalvarComentarios.Visible = false;
            MPE_Foto.Show();
        }
예제 #3
0
        protected void lkFoto_Click(object sender, EventArgs e)
        {
            LinkButton drp = (LinkButton)sender;

            GridViewRow gv = (GridViewRow)drp.NamingContainer;

            int index = gv.RowIndex;

            int id_user = Convert.ToInt32(gvUsers.Rows[index].Cells[0].Text);

            MPE_Foto.Show();
            User   user = UserDAO.GetUserByID(id_user);
            string png  = "/Content/Imagens/Users/" + user.Username + ".png";

            if (File.Exists(Server.MapPath(png)))
            {
                imgFoto.ImageUrl = png;
            }
            else
            {
                imgFoto.ImageUrl = "../../Content/Imagens/ImgNotFound.png";
            }
        }
예제 #4
0
        protected void lkFoto_Click(object sender, EventArgs e)
        {
            LinkButton drp = (LinkButton)sender;

            GridViewRow gv = (GridViewRow)drp.NamingContainer;

            int index = gv.RowIndex;

            LinkButton lkFoto   = (LinkButton)gvEquipList.Rows[index].FindControl("lkFoto");
            int        id_equip = Convert.ToInt32(gvEquipList.Rows[index].Cells[0].Text);

            MPE_Foto.Show();
            Equip  equip = EquipDAO.GetEquipByID(id_equip);
            string jpg   = "/Content/Imagens/Equips/" + equip.descri + ".jpg";

            if (File.Exists(Server.MapPath(jpg)))
            {
                imgFoto.ImageUrl = jpg;
            }
            else
            {
                imgFoto.ImageUrl = "../../Content/Imagens/ImgNotFound.png";
            }
        }
예제 #5
0
 protected void tbxComentarios_TextChanged(object sender, EventArgs e)
 {
     btSalvarComentarios.Visible = true;
     MPE_Foto.Show();
 }