コード例 #1
0
    protected void GridView_RESULTADOS_BUSQUEDA_SelectedIndexChanged(object sender, EventArgs e)
    {
        Ocultar();
        Clausula clausula = new Clausula(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataRow  dataRow  = clausula.ObtenerPorId(Convert.ToDecimal(this.GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["ID_CLAUSULA"].ToString()));

        Cargar(dataRow);
        Mostrar(Acciones.Editar);
    }
コード例 #2
0
    private void Actualizar()
    {
        tools _tools = new tools();

        Byte[]  archivo           = null;
        Int32   archivo_tamaño    = 0;
        String  archivo_extension = null;
        String  archivo_tipo      = null;
        bool    actualizado       = false;
        decimal id_ocupacion      = 0;

        try
        {
            if (FileUpload_archivo.HasFile == true)
            {
                using (BinaryReader reader = new BinaryReader(FileUpload_archivo.PostedFile.InputStream))
                {
                    archivo           = reader.ReadBytes(FileUpload_archivo.PostedFile.ContentLength);
                    archivo_tamaño    = FileUpload_archivo.PostedFile.ContentLength;
                    archivo_tipo      = FileUpload_archivo.PostedFile.ContentType;
                    archivo_extension = _tools.obtenerExtensionArchivo(FileUpload_archivo.PostedFile.FileName);
                }
            }

            if (DropDownList_ID_OCUPACION.Text.Equals(string.Empty))
            {
                id_ocupacion = 0;
            }
            else
            {
                id_ocupacion = Convert.ToDecimal(DropDownList_ID_OCUPACION.SelectedValue);
            }

            Clausula clausula = new Clausula(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
            actualizado = clausula.Actualizar(Convert.ToDecimal(HiddenField_id_clausula.Value), DropDownList_ID_TIPO_CLAUSULA.SelectedValue,
                                              DropDownList_ID_ESTADO.SelectedValue, TextBox_DESCRIPCION.Text, Convert.ToDecimal(HiddenField_ID_EMPRESA.Value), id_ocupacion, archivo, archivo_tamaño, archivo_extension, archivo_tipo);
            if (actualizado.Equals(true))
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "La Clausula fue actualizada correctamente.", Proceso.Correcto);
                Bloquear();
                Ocultar();
                Mostrar(Acciones.Editar);
                DataRow dataRow = clausula.ObtenerPorId(Convert.ToDecimal(HiddenField_id_clausula.Value));
                Cargar(dataRow);
            }
            else
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "Error al actualizar la Clausula ", Proceso.Error);
            }
        }
        catch (Exception e)
        {
            Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, e.Message, Proceso.Error);
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        tools             _tools = new tools();
        SecureQueryString QueryStringSeguro;

        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]);

        Decimal id_clausula = Convert.ToDecimal(QueryStringSeguro["id_clausula"]);

        Clausula clausula = new Clausula(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataRow  dataRow  = clausula.ObtenerPorId(id_clausula);

        Response.Clear();
        Response.AddHeader("content-disposition", string.Format("attachment;filename={0}", "Clausula" + dataRow["ID_TIPO_CLAUSULA"].ToString() + dataRow["EXTENSION"].ToString()));

        Response.ContentType = dataRow["TIPO"].ToString().Trim();

        Response.BinaryWrite((byte[])dataRow["ARCHIVO"]);

        Response.End();
    }