Exemplo n.º 1
0
        /// <summary>
        /// Recupera le informazioni relative al documento
        /// </summary>
        private void Execute()
        {
            S_Controls.Collections.S_ControlsCollection CollezioneControlli = new  S_Controls.Collections.S_ControlsCollection();

            S_Controls.Collections.S_Object s_p_filname = new S_Controls.Collections.S_Object();
            s_p_filname.ParameterName = "p_filname";
            s_p_filname.DbType        = CustomDBType.VarChar;
            s_p_filname.Direction     = ParameterDirection.Input;
            s_p_filname.Index         = 0;
            s_p_filname.Value         = this.filname;
            s_p_filname.Size          = 50;
            CollezioneControlli.Add(s_p_filname);

            Classi.AnagrafeImpianti.DocDWF _DocDWF = new Classi.AnagrafeImpianti.DocDWF();

            DataSet Ds = _DocDWF.GetData(CollezioneControlli);

            Repeater1.DataSource = Ds;
            Repeater1.DataBind();

            if (Ds.Tables[0].Rows.Count > 0)
            {
                GetFile(Ds.Tables[0].Rows[0]["var_percorso_root"].ToString(), Ds.Tables[0].Rows[0]["var_percorso_child"].ToString());
            }
        }
Exemplo n.º 2
0
        public void imageButton_Click(Object sender, CommandEventArgs e)
        {
            string PathFileName = "";
            string PathRoot     = "";
            string PathChild    = "";

            Context.Items.Add("var_doc", (string)e.CommandArgument);

            //string file_name= Context.Items["var_doc"].ToString();
            string[] a_appoggio = Context.Items["var_doc"].ToString().Split(Convert.ToChar("?"));
            string   file_name  = a_appoggio[1];

//			//file_name.Split=
//			//file_name.Split("?",1);
//			//string cont="";
//			//filem[1].ToString()=cont;
//			string s_bl_id=a_appoggio[1];
//			a_appoggio1=a_appoggio[0].ToString().Split(Convert.ToChar("&"));
            file_name = file_name.ToUpper();

            bool zip = (file_name.EndsWith(".ZIP") || file_name.EndsWith(".RAR"));

            //Context.Items.Keys.("var_afm_dwgs_dwg_name").ToString();
            if (zip == false)
            {
                Server.Transfer("VisualDWF.aspx");
            }
            else
            {
                S_Controls.Collections.S_ControlsCollection CollezioneControlli = new  S_Controls.Collections.S_ControlsCollection();

                S_Controls.Collections.S_Object s_p_filname = new S_Controls.Collections.S_Object();
                s_p_filname.ParameterName = "p_filename";
                s_p_filname.DbType        = CustomDBType.VarChar;
                s_p_filname.Direction     = ParameterDirection.Input;
                s_p_filname.Index         = 0;
                s_p_filname.Value         = file_name;
                s_p_filname.Size          = 50;
                CollezioneControlli.Add(s_p_filname);



                Classi.AnagrafeImpianti.DocDWF _DocDWF = new Classi.AnagrafeImpianti.DocDWF();

                DataSet Ds = _DocDWF.GetDataFilename(CollezioneControlli);

                //if (Ds.Tables[0].Rows.Count>0)
                //GetFile(Ds.Tables[0].Rows[0]["var_percorso_root"].ToString(),Ds.Tables[0].Rows[0]["var_percorso_child"].ToString());

                PathRoot     = Ds.Tables[0].Rows[0]["var_percorso_root"].ToString();
                PathChild    = Ds.Tables[0].Rows[0]["var_percorso_child"].ToString();
                PathRoot     = PathRoot.Replace(" ", "_");
                PathChild    = PathChild.Replace(" ", "_").Replace("/", "_");
                PathFileName = "../Doc_DB/" + PathRoot + "/" + PathChild + "/" + file_name;
                Response.Redirect(PathFileName);
            }
        }
Exemplo n.º 3
0
        private void Execute()
        {
            S_Controls.Collections.S_ControlsCollection CollezioneControlli = new  S_Controls.Collections.S_ControlsCollection();

            S_Controls.Collections.S_Object s_p_bl_id = new S_Controls.Collections.S_Object();
            s_p_bl_id.ParameterName = "p_bl_id";
            s_p_bl_id.DbType        = CustomDBType.Integer;
            s_p_bl_id.Direction     = ParameterDirection.Input;
            s_p_bl_id.Index         = 0;
            s_p_bl_id.Value         = this.bl_id;
            CollezioneControlli.Add(s_p_bl_id);

            S_Controls.Collections.S_Object s_p_doc_id_servizio = new S_Controls.Collections.S_Object();
            s_p_doc_id_servizio.ParameterName = "p_doc_id_servizio";
            s_p_doc_id_servizio.DbType        = CustomDBType.Integer;
            s_p_doc_id_servizio.Direction     = ParameterDirection.Input;
            s_p_doc_id_servizio.Index         = 1;
            s_p_doc_id_servizio.Value         = this.doc_id_servizio;
            CollezioneControlli.Add(s_p_doc_id_servizio);

            S_Controls.Collections.S_Object s_p_categoria = new S_Controls.Collections.S_Object();
            s_p_categoria.ParameterName = "p_categoria";
            s_p_categoria.DbType        = CustomDBType.VarChar;
            s_p_categoria.Direction     = ParameterDirection.Input;
            s_p_categoria.Index         = 2;
            s_p_categoria.Value         = this.categoria;
            s_p_categoria.Size          = 50;
            CollezioneControlli.Add(s_p_categoria);

            S_Controls.Collections.S_Object s_p_tipologia = new S_Controls.Collections.S_Object();
            s_p_tipologia.ParameterName = "p_tipologia";
            s_p_tipologia.DbType        = CustomDBType.Integer;
            s_p_tipologia.Direction     = ParameterDirection.Input;
            s_p_tipologia.Index         = 3;
            s_p_tipologia.Value         = this.idtip;
            CollezioneControlli.Add(s_p_tipologia);


            Classi.AnagrafeImpianti.DocDWF _DocDWF = new Classi.AnagrafeImpianti.DocDWF();

            DataSet Ds = _DocDWF.GetDocImage(CollezioneControlli);

            DataListImage.DataSource = Ds;
            DataListImage.DataBind();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Elaborazione delle Certificazioni
        /// </summary>
        /// <param name="Sender"></param>
        /// <param name="e"></param>
        protected void RepeaterCertificazioni_ItemDataBound(Object Sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView Dr = (DataRowView)e.Item.DataItem;

                TableRow  Riga   = new TableRow();
                TableCell Cella1 = new TableCell();
                TableCell Cella2 = new TableCell();
                TableCell Cella3 = new TableCell();
                TableCell Cella4 = new TableCell();

                if (Dr["ext"].ToString().ToUpper() == "PDF")
                {
                    HtmlAnchor href   = new HtmlAnchor();
                    string     script = "javascript:opendoc('var_afm_dwgs_dwg_name=" + Dr["var_nome_doc"] + "');";
                    href.HRef      = script;
                    href.Title     = "Visualizza Documento Tipologia: " + Dr["var_tipologia"].ToString();
                    href.InnerText = Dr["var_nome_doc"].ToString();

                    Cella1.Text = Dr["var_servizio"].ToString();
                    Cella2.Controls.Add(href);
                    //Cella3.Text= "";//Dr["var_afm_dwgs_tipo"].ToString();
                    Cella3.Text = Dr["var_afm_dwgs_tipo"].ToString();
                    Cella4.Text = Dr["var_descrizione"].ToString();
                    Riga.Controls.Add(Cella1);
                    Riga.Controls.Add(Cella2);
                    Riga.Controls.Add(Cella3);
                    Riga.Controls.Add(Cella4);
                    e.Item.Controls.Add(Riga);
                }
                else
                {
                    if (_tipologia != Dr["var_tipologia"].ToString())
                    {
                        _tipologia = Dr["var_tipologia"].ToString();
                        if (Dr["ext"].ToString().ToUpper() == "ZIP")
                        {
                            string PathFileName = "";
                            string PathRoot     = "";
                            string PathChild    = "";

                            HtmlImage img = new HtmlImage();
                            img.Src    = "../Images/zip.jpg";
                            img.Border = 0;
                            img.Alt    = "Download File:" + Dr["var_nome_doc"].ToString();
                            HtmlAnchor href = new HtmlAnchor();

                            S_Controls.Collections.S_ControlsCollection CollezioneControlli = new  S_Controls.Collections.S_ControlsCollection();

                            S_Controls.Collections.S_Object s_p_filname = new S_Controls.Collections.S_Object();
                            s_p_filname.ParameterName = "p_filename";
                            s_p_filname.DbType        = CustomDBType.VarChar;
                            s_p_filname.Direction     = ParameterDirection.Input;
                            s_p_filname.Index         = 0;
                            s_p_filname.Value         = Dr["var_nome_doc"].ToString();
                            s_p_filname.Size          = 50;
                            CollezioneControlli.Add(s_p_filname);

                            Classi.AnagrafeImpianti.DocDWF _DocDWF = new Classi.AnagrafeImpianti.DocDWF();

                            DataSet Ds = _DocDWF.GetDataFilename(CollezioneControlli);
                            PathRoot     = Ds.Tables[0].Rows[0]["var_percorso_root"].ToString();
                            PathChild    = Ds.Tables[0].Rows[0]["var_percorso_child"].ToString();
                            PathRoot     = PathRoot.Replace(" ", "_");
                            PathChild    = PathChild.Replace(" ", "_").Replace("/", "_");
                            PathFileName = "../Doc_DB/" + PathRoot + "/" + PathChild + "/" + Dr["var_nome_doc"].ToString();
                            //Response.Redirect(PathFileName);

                            //string script="Response.Redirect("+PathFileName+")";
                            string script = "javascript:download('" + PathFileName + "');";
                            //string script="javascript:opendoc1('bl_id=" + this.bl_id.ToString() +  "&doc_id_servizio=" + Dr["var_id_servizio"].ToString() + "&categoria=" + Dr["var_categoria"].ToString() + "');";
                            href.HRef = script;
                            href.Controls.Add(img);

                            Cella1.Text = Dr["var_servizio"].ToString();
                            Cella2.Attributes.Add("align", "center");
                            Cella2.Controls.Add(href);
                            Cella3.Text = Dr["var_afm_dwgs_tipo"].ToString();
                            Cella4.Text = Dr["var_descrizione"].ToString();
                            Riga.Controls.Add(Cella1);
                            Riga.Controls.Add(Cella2);
                            Riga.Controls.Add(Cella3);
                            Riga.Controls.Add(Cella4);
                            e.Item.Controls.Add(Riga);
                        }

                        if (Dr["ext"].ToString().ToUpper() == "JPG")
                        {
                            HtmlImage img = new HtmlImage();
                            img.Src    = "../Images/ico_info.gif";
                            img.Border = 0;
                            img.Alt    = "Visualizza Raccolta Immagini";

                            HtmlAnchor href   = new HtmlAnchor();
                            string     script = "javascript:opendoc1('bl_id=" + this.bl_id.ToString() + "&doc_id_servizio=" + Dr["var_id_servizio"].ToString() + "&categoria=" + Dr["var_categoria"].ToString() + "');";
                            href.HRef = script;
                            href.Controls.Add(img);

                            Cella1.Text = Dr["var_servizio"].ToString();
                            Cella2.Attributes.Add("align", "center");
                            Cella2.Controls.Add(href);
                            Cella3.Text = Dr["var_afm_dwgs_tipo"].ToString();
                            Cella4.Text = Dr["var_descrizione"].ToString();
                            Riga.Controls.Add(Cella1);
                            Riga.Controls.Add(Cella2);
                            Riga.Controls.Add(Cella3);
                            Riga.Controls.Add(Cella4);
                            e.Item.Controls.Add(Riga);
                        }
                    }
                }
                #region codice precedente
//				else
//				{
//					if (_tipologia != Dr["var_tipologia"].ToString())
//					{
//
//						_tipologia=Dr["var_tipologia"].ToString();
//
//						HtmlImage img=new HtmlImage();
//						img.Src="../Images/ico_info.gif";
//						img.Border=0;
//						img.Alt="Visualizza Immagine";
//
//						HtmlAnchor href= new HtmlAnchor();
//						string script="javascript:opendoc1('bl_id=" + this.bl_id.ToString() +  "&doc_id_servizio=" + Dr["var_id_servizio"].ToString() + "&categoria=" + Dr["var_categoria"].ToString() + "');";
//						href.HRef=script;
//						href.Controls.Add(img);
//
//						Cella1.Text= Dr["var_servizio"].ToString();
//						Cella2.Attributes.Add("align","center");
//						Cella2.Controls.Add(href);
//						Cella3.Text= "Raccolta Fotografica " + Dr["var_tipologia"].ToString();
//						Cella4.Text= Dr["var_descrizione"].ToString();
//						Riga.Controls.Add(Cella1);
//						Riga.Controls.Add(Cella2);
//						Riga.Controls.Add(Cella3);
//						Riga.Controls.Add(Cella4);
//						e.Item.Controls.Add(Riga);
//					}
//
//				}
                #endregion
            }
        }