示例#1
0
        void BtnModFoto_Click(object sender, EventArgs e)
        {
            ClUsuario.Insertar_Actividad_Pagina(14, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_ActividadPagina(), 2);
            if (UploadFoto.UploadedFiles.Count > 0)
            {
                Stream fileStream      = UploadFoto.UploadedFiles[0].InputStream;
                byte[] attachmentBytes = new byte[fileStream.Length];
                fileStream.Read(attachmentBytes, 0, Convert.ToInt32(fileStream.Length));
                ClPersona.Actualiza_Foto(Convert.ToInt32(Session["PersonaId"]), attachmentBytes, UploadFoto.UploadedFiles[0].ContentType, UploadFoto.UploadedFiles[0].FileName);
                fileStream.Close();
            }
            LblMensajeGodDatGen.Text = "Foto actualizada exitosamente";
            Btnsuccesdatgen.Visible  = true;
            StringBuilder sbScript = new StringBuilder();

            sbScript.Append("<script language='JavaScript' type='text/javascript'>\n");
            sbScript.Append("<!--\n");
            sbScript.Append(this.GetPostBackEventReference(this, "PBArg") + ";\n");
            sbScript.Append("// -->\n");
            sbScript.Append("</script>\n");

            this.RegisterStartupScript("AutoPostBackScript", sbScript.ToString());
        }
示例#2
0
 void BtnYes_Click(object sender, EventArgs e)
 {
     ClProfesion.Actualiza_Profesion(Convert.ToInt32(TxtProfesionId.Text), TxtProfesion.Text, Convert.ToInt32(CboCategoria.SelectedValue), Convert.ToInt32(CboEstatus.SelectedValue));
     ClUsuario.Insertar_Actividad_Pagina(22, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_ActividadPagina(), 2);
     BtnGood.Visible = true;
     LblGood.Text    = "Profesión modificada exitosamente";
     GrdProfesion.Rebind();
     Nuevo();
 }
        void GrdInmuebles_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "CmdPreview")
            {
                DataSet DsArchivo = new DataSet();
                DsArchivo = ClInmueble.Archivo_Inmueble(Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["InmuebleId"]));
                byte[] bytes;
                string fileName, contentType;
                bytes       = (byte[])DsArchivo.Tables["DATOS"].Rows[0]["Archivo_Propiedad"];
                contentType = DsArchivo.Tables["DATOS"].Rows[0]["ContenyType"].ToString();
                fileName    = DsArchivo.Tables["DATOS"].Rows[0]["Nombre_Archivo"].ToString();

                Response.Clear();
                Response.Buffer  = true;
                Response.Charset = "";
                Response.Cache.SetCacheability(HttpCacheability.NoCache);


                Response.ContentType = contentType;
                Response.AddHeader("content-disposition", "attachment; filename=" + fileName);
                Response.AddHeader("content-length", (bytes.Length - 1).ToString());
                Response.BinaryWrite(bytes.ToArray());
                Response.Flush();
                Response.End();
            }
            else if (e.CommandName == "CmdEdit")
            {
                DataSet ds = new DataSet();
                TxtInmuebleId.Text = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["InmuebleId"].ToString();
                ds = ClInmueble.Inmueble_Get(Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["InmuebleId"]));
                if (ds.Tables["DATOS"].Rows[0]["PersonaJuridicaId"].ToString() == "")
                {
                    ChkOtraJur.Checked  = false;
                    DivJuridico.Visible = false;
                }
                else
                {
                    ChkOtraJur.Checked            = true;
                    DivJuridico.Visible           = true;
                    CboJuridico.SelectedValue     = ds.Tables["DATOS"].Rows[0]["PersonaJuridicaId"].ToString();
                    CboJuridico.SelectedItem.Text = ds.Tables["DATOS"].Rows[0]["jur"].ToString();
                }
                TxtDirccion.Text = ds.Tables["DATOS"].Rows[0]["Direccion"].ToString();
                TxtAldea.Text    = ds.Tables["DATOS"].Rows[0]["Aldea"].ToString();
                TxtFinca.Text    = ds.Tables["DATOS"].Rows[0]["Finca"].ToString();
                CboDepartamento.SelectedValue     = ds.Tables["DATOS"].Rows[0]["DepartamentoId"].ToString();
                CboDepartamento.SelectedItem.Text = ds.Tables["DATOS"].Rows[0]["Departamento"].ToString();
                ClUtilitarios.LlenaCombo(ClCatalogos.ListadoMunicipios(Convert.ToInt32(CboDepartamento.SelectedValue)), CboMunicipio, "MunicipioId", "Municipio");
                CboMunicipio.SelectedValue         = ds.Tables["DATOS"].Rows[0]["MunicipioId"].ToString();
                CboMunicipio.SelectedItem.Text     = ds.Tables["DATOS"].Rows[0]["Municipio"].ToString();
                CboTipoDocumento.SelectedValue     = ds.Tables["DATOS"].Rows[0]["TipoDoc_PropiedadId"].ToString();
                CboTipoDocumento.SelectedItem.Text = ds.Tables["DATOS"].Rows[0]["TipoDocPropiedad"].ToString();
                TxtFecEmi.SelectedDate             = Convert.ToDateTime(ds.Tables["DATOS"].Rows[0]["Fec_Emision"].ToString());
                if (CboTipoDocumento.SelectedValue == "1")
                {
                    DivPropiedad.Visible = true;
                    DivMun.Visible       = false;
                    DiVPos.Visible       = false;
                    TxtNoFinca.Text      = ds.Tables["DATOS"].Rows[0]["NoFinca"].ToString();
                    TxtFolio.Text        = ds.Tables["DATOS"].Rows[0]["Folio"].ToString();
                    TxtLibro.Text        = ds.Tables["DATOS"].Rows[0]["Libro"].ToString();
                    TxtDe.Text           = ds.Tables["DATOS"].Rows[0]["De"].ToString();
                }
                else if (CboTipoDocumento.SelectedValue == "2")
                {
                    DivPropiedad.Visible = false;
                    DivMun.Visible       = true;
                    DiVPos.Visible       = false;
                    TxtNoCerti.Text      = ds.Tables["DATOS"].Rows[0]["NoCertificacion"].ToString();
                }
                else if (CboTipoDocumento.SelectedValue == "3")
                {
                    DivPropiedad.Visible        = false;
                    DivMun.Visible              = false;
                    DiVPos.Visible              = true;
                    TxtNoEscritura.Text         = ds.Tables["DATOS"].Rows[0]["NoEscritura"].ToString();
                    CboTitulo.SelectedValue     = ds.Tables["DATOS"].Rows[0]["TituloNotarioId"].ToString();
                    CboTitulo.SelectedItem.Text = ds.Tables["DATOS"].Rows[0]["TituloNotario"].ToString();
                }
                if (ds.Tables["DATOS"].Rows[0]["En_Area"].ToString() == "1")
                {
                    OptAreasPro.SelectedValue = "1";
                    DivArea.Visible           = true;
                    CboArea.SelectedValue     = ds.Tables["DATOS"].Rows[0]["AreaProtegidaId"].ToString();
                    CboArea.SelectedItem.Text = ds.Tables["DATOS"].Rows[0]["AreaPro"].ToString();
                }
                else
                {
                    OptAreasPro.SelectedValue = "0";
                    DivArea.Visible           = false;
                }
                TxtArea.Text = ds.Tables["DATOS"].Rows[0]["Area"].ToString();
                if (ds.Tables["DATOS"].Rows[0]["EsRepresentante"].ToString() == "1")
                {
                    ChkRepreseanteyPropietario.Checked = true;
                    ChkRepresentanteVariasPer.Checked  = false;
                }
                if (ds.Tables["DATOS"].Rows[0]["EsRepresentanteVarios"].ToString() == "1")
                {
                    ChkRepresentanteVariasPer.Checked  = true;
                    ChkRepreseanteyPropietario.Checked = false;
                }
                DivGrigPropietarios.Visible = true;
                GrdPropietarios.Rebind();
                BtnGrabar.Visible = false;
                GrdPropietarios.Columns[5].Visible = false;
            }
            else if (e.CommandName == "CmdDel")
            {
                ClUsuario.Insertar_Actividad_Pagina(16, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_ActividadPagina(), 3);
                ClInmueble.Elimina_Inmueble(Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["InmuebleId"]));
                GrdInmuebles.Rebind();
                Limpiar();
                BtnGoodInmueble.Visible = true;
                LblGoodInmueble.Text    = "Inmueble eliminado";
            }
        }