示例#1
0
    protected void gridFolio_ItemCommand(object source, GridCommandEventArgs e)
    {
        string field = "IdFolio";
        string campo = "idLiberacion";

        if (e.CommandName == "ReviewFolio")
        {
            try
            {
                IDictionary itemValues = new Dictionary <object, object>();
                var         item       = (Telerik.Web.UI.GridDataItem)e.Item;
                item.ExtractValues(itemValues);
                itemValues[field]  = gridFolio.Items[item.ItemIndex][field].Text;
                ViewState[field]   = itemValues[field];
                ViewState[campo]   = gridFolio.Items[item.ItemIndex][campo].Text;
                ViewState["Folio"] = gridFolio.Items[item.ItemIndex]["Folio"].Text;
                //Tiene Id de Release y estatus cerrado
                if ((int.Parse(gridFolio.Items[item.ItemIndex][campo].Text) > 0) && (gridFolio.Items[item.ItemIndex]["Estado"].Text == "Cerrado"))
                {
                    FolioCerrado(gridFolio.Items[item.ItemIndex]["Fecha"].Text);
                }
                //Tiene Id de release y estatus diferente de cerrado
                else if ((int.Parse(gridFolio.Items[item.ItemIndex][campo].Text) > 0) && (gridFolio.Items[item.ItemIndex]["Estado"].Text != "Cerrado"))
                {
                    FolioAbierto();
                }
                else if ((int.Parse(gridFolio.Items[item.ItemIndex][campo].Text) == 0) && (gridFolio.Items[item.ItemIndex]["Estado"].Text != "Cerrado"))
                {
                    FolioAbierto();
                }
                lblCurrentFolio.Text    = ViewState["Folio"].ToString();
                gridReporte.DataSource  = null;
                PanelDocumentos.Visible = true;
                var folios = new BO.Cierre();
                gridReporte.DataSource = folios.GetArchivosByCierre(int.Parse(ViewState[campo].ToString()));
                gridReporte.DataBind();
            }
            catch (Exception ex)
            {
            }
        }
    }
示例#2
0
    protected void btnDocumentos_Click(object sender, EventArgs e)
    {
        var folios   = new BO.Cierre();
        int registro = 0;

        try
        {
            util.GetActionMenu(mpMenu.SelectedItem.Value);
            string pathSave = ConfigurationManager.AppSettings["rutaLiberacion"] + "\\" + ViewState["IdFolio"].ToString();
            var    dt       = folios.Get_RegFile(int.Parse(ViewState["IdFolio"].ToString()), int.Parse(ViewState["Release"].ToString()), txtDescDocumento.Text, RadAsyncUpload1.UploadedFiles[0].FileName, pathSave);
            registro = int.Parse(dt.Rows[0][0].ToString());
            gridReporte.DataSource = null;
            if (registro > 0)
            {
                util.AccessDocument(pathSave);
                RadAsyncUpload1.UploadedFiles[0].SaveAs(dt.Rows[0][1].ToString());
                gridReporte.DataSource = folios.GetArchivosByCierre(int.Parse(ViewState["Release"].ToString()));
            }
            else
            {
                folios.Del_RegFile(registro);
            }
            gridFolio.DataBind();
            gridReporte.DataBind();
            PanelEstatus.Visible    = false;
            PanelDocumentos.Visible = true;
        }
        catch (AccessViolationException ave)
        {
            Alert.Permisos(this.Page);
        }
        catch (Exception ex)
        {
            if (registro > 0)
            {
                folios.Del_RegFile(registro);
            }
        }
    }