Esempio n. 1
0
        protected void dataload()
        {
            int qishu = 0;

            qishu = Convert.ToInt16(Request.QueryString["qishu"]);
            if (qishu != 0)
            {
                Maticsoft.BLL.peixunban1 pxb = new BLL.peixunban1();
                Literal biaoti = (Literal)Page.Master.FindControl("Literal1");
                biaoti.Text = pxb.GetList("id=" + qishu).Tables[0].Rows[0]["name"].ToString() + "总结视频";
                StringBuilder        str = new StringBuilder();
                Maticsoft.BLL.photos ph  = new BLL.photos();
                DataTable            dt  = ph.GetList("qishu =" + qishu + " and fileExtension = '.mp4'").Tables[0];
                if (dt.Rows.Count == 0)
                {
                    Literal1.Text = "暂无视频";
                }
                else
                {
                    string video_url = "../images/" + dt.Rows[0]["FileName"].ToString();
                    string _type     = dt.Rows[0]["ContentType"].ToString();
                    str.Append(" <video id='example_video_1' class='video-js vjs-default-skin' controls preload='none' width='800' height='550'   poster='http://video-js.zencoder.com/oceans-clip.png'   data-setup='{}'>");
                    str.Append(" <source src='" + video_url + "' type='" + _type + "' />");
                    str.Append("<track kind='captions' src='demo.captions.vtt' srclang='en' label='English'></track><!-- Tracks need an ending tag thanks to IE9 -->");
                    str.Append(" <track kind='subtitles' src='demo.captions.vtt' srclang='en' label='English'></track><!-- Tracks need an ending tag thanks to IE9 -->");
                    Literal1.Text = str.ToString();
                }
            }
            else
            {
                Response.Redirect("showlist.aspx");
            }
        }
        protected void dataload()
        {
            qishu = Convert.ToInt16(Request.QueryString["qishu"]);
            if (qishu != 0)
            {
                Maticsoft.BLL.peixunban1 pxb = new BLL.peixunban1();
                pxb_name    = pxb.GetList("id=" + qishu).Tables[0].Rows[0]["name"].ToString();
                biaoti.Text = pxb_name;
            }
            else
            {
                Response.Redirect("showlist.aspx");
            }

            Maticsoft.BLL.photos ph   = new BLL.photos();
            DataTable            dtph = ph.get_fenlei(qishu.ToString()).Tables[0];

            if (dtph.Rows.Count > 0)
            {
                TableRow row = new TableRow();
                for (int i = 0; i < dtph.Rows.Count; i++)
                {
                    TableCell cell = new TableCell();
                    Button    bt   = new Button();
                    bt.Text   = dtph.Rows[i][0].ToString();
                    bt.Click += new EventHandler(bt_Click);
                    cell.Controls.Add(bt);
                    row.Cells.Add(cell);
                }
                Table1.Rows.Add(row);
            }
        }
        private string photos(string leibie)
        {
            Maticsoft.BLL.photos ph = new BLL.photos();
            DataTable            dt = ph.GetList("qishu = " + qishu + " and fenlei2 = '" + leibie + "' and ContentType = 'image/jpeg'").Tables[0];


            StringBuilder str      = new StringBuilder();
            string        big_name = "";

            if (dt.Rows.Count == 0)
            {
                str.Append("此类别暂无照片");
            }
            else
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    big_name = dt.Rows[i]["FileName"].ToString().Replace("_small_", "");
                    str.Append("<li class='item-thumbs col-lg-3 design' data-id='id-0' data-type='" + leibie + "'>");
                    str.Append("<a class='hover-wrap fancybox' data-fancybox-group='gallery' title='" + pxb_name + "' href='../images/" + big_name + "'");
                    str.Append("<span class='overlay-img'></span>");
                    str.Append("<span class='overlay-img-thumb'><i class='icon-info-blocks fa fa-search'></i></span></a>");
                    str.Append("<img src='../images/" + dt.Rows[i]["FileName"] + "' alt=''></li>");
                }
            }
            return(str.ToString());
        }
Esempio n. 4
0
        protected void UploadButton_Click(object sender, EventArgs e)
        {
            ///'遍历File表单元素
            HttpFileCollection files = HttpContext.Current.Request.Files;

            /// '状态信息
            System.Text.StringBuilder strMsg = new System.Text.StringBuilder("培训班为:" + qishu_dro.SelectedValue + "<br/>");
            strMsg.Append("上传的文件分别是:<hr color='red'/>");
            int count = 0;

            try
            {
                for (int iFile = 0; iFile < files.Count; iFile++)
                {
                    ///'检查文件扩展名字
                    HttpPostedFile postedFile = files[iFile];
                    string         fileName, fileExtension;
                    fileName = System.IO.Path.GetFileNameWithoutExtension(postedFile.FileName) + DateTime.Today.GetDateTimeFormats('D')[0].ToString() + System.IO.Path.GetExtension(postedFile.FileName);
                    if (fileName != "")
                    {
                        fileExtension = System.IO.Path.GetExtension(fileName);

                        strMsg.Append("上传的文件类型:" + postedFile.ContentType.ToString() + "<br>");
                        strMsg.Append("客户端文件地址:" + postedFile.FileName + "<br>");
                        strMsg.Append("上传文件的文件名:" + fileName + "<br>");
                        strMsg.Append("上传文件的扩展名:" + fileExtension + "<br><hr>");
                        ///'可根据扩展名字的不同保存到不同的文件夹
                        ///注意:可能要修改你的文件夹的匿名写入权限。
                        postedFile.SaveAs(System.Web.HttpContext.Current.Request.MapPath("../images/") + fileName);
                        Maticsoft.Model.photos ph_m = new Model.photos();
                        ph_m.ContentType        = postedFile.ContentType.ToString();
                        ph_m.postedFileFileName = postedFile.FileName;
                        ph_m.FileName           = fileName;
                        ph_m.fileExtension      = fileExtension;
                        ph_m.qishu = qishu_dro.SelectedValue;
                        if (fenlei_txt.Text == "")
                        {
                            ph_m.fenlei2 = fenlei_dro.SelectedValue;
                        }
                        else
                        {
                            ph_m.fenlei2 = fenlei_txt.Text.Trim();
                        }
                        Maticsoft.BLL.photos pho = new BLL.photos();
                        count += pho.Add(ph_m);
                    }
                }
                strMsg.Append("共上传图片" + count + "张");
                strStatus.Text = strMsg.ToString();
            }
            catch (System.Exception Ex)
            {
                strStatus.Text = Ex.Message;
            }
        }
        protected void dataload()
        {
            Maticsoft.BLL.photos ph = new BLL.photos();

            DataTable     dt  = ph.get_photolist();
            StringBuilder str = new StringBuilder();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                str.Append("<li class='con'>");
                str.Append("<a href='show.aspx?qishu=");
                str.Append(dt.Rows[i]["qishu"].ToString());
                str.Append("' target='_blank'>");
                str.Append("<img src='../images/");
                str.Append(dt.Rows[i]["FileName"].ToString());
                str.Append("' alt='con'/>");
                str.Append("<div class='txt'><h3>");
                str.Append(dt.Rows[i]["name"].ToString());
                str.Append("</h3><p>");
                str.Append(Convert.ToDateTime(dt.Rows[i]["start_time"].ToString()).ToShortDateString() + " 到 " + Convert.ToDateTime(dt.Rows[i]["end_time"].ToString()).ToShortDateString());
                str.Append("</p></div> </a></li>");
            }
            Literal2.Text = str.ToString();
        }